Skip to content

[CDF-28691] Replace Cognite-SDK dependency in GroupIO - #3320

Open
doctrino wants to merge 5 commits into
mainfrom
remove-dependency
Open

doctrino wants to merge 5 commits into
mainfrom
remove-dependency

Conversation

@doctrino

@doctrino doctrino commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

Using our own scope and acl definitions instead. This lead me to accidentally find this bug.

Bump

  • Patch
  • Skip

Changelog

Fixed

  • When deploying a Group with an id scoped securityCategoriesAcl or timeSeriesAcl, Toolkit nor correctly does a lookup of security category names and timeseries IDs.

@doctrino
doctrino requested review from a team as code owners October 4, 2026 16:38
@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@doctrino
doctrino enabled auto-merge (squash) October 4, 2026 16:39
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

☂️ Code Coverage

current status: ✅

Overall Coverage

Statements Covered Coverage Threshold Status
43722 37133 85% 80% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
cognite_toolkit/_cdf_tk/resource_ios/_auth.py 72% 🟢
TOTAL 72% 🟢

updated for commit: 91a815a by action🐍

Comment on lines +271 to 279
(SecurityCategoriesAcl, IDScopeLowerCase): ReplaceMethod(
self.client.lookup.security_categories.id,
self.client.lookup.security_categories.external_id,
id_name="ids",
),
(cap.TimeSeriesAcl, cap.TimeSeriesAcl.Scope.ID): ReplaceMethod(
(TimeSeriesAcl, IDScopeLowerCase): ReplaceMethod(
self.client.lookup.time_series.id,
self.client.lookup.time_series.external_id,
id_name="ids",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug caught by replacing SDK.

@doctrino

doctrino commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors GroupIO to import ACL and Scope classes directly from the toolkit's group resource classes rather than using cognite.client capabilities, updating scope and ACL name lookups to use Pydantic model_fields defaults. It also adds support for IDScopeLowerCase for datasets and extraction pipelines, and updates the unit test import violation count. Feedback is provided regarding a redundant try-except block in load_resource that catches a broad Exception only to re-raise it, which violates the repository's error handling style guide.

Comment thread cognite_toolkit/_cdf_tk/resource_ios/_auth.py Outdated

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant