Skip to content

[CDF-28013, CDF-25289, CDF-28083]🐛Bugfixes - #3317

Open
doctrino wants to merge 7 commits into
mainfrom
bugfixes
Open

doctrino wants to merge 7 commits into
mainfrom
bugfixes

Conversation

@doctrino

@doctrino doctrino commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Combined two minor improvements to avoid having two PRs.

Check workflow version tasks on build instead of deploy

now

image

this PR

image

Bump

  • Patch
  • Skip

Changelog

Improved

  • Workflows without a task now fails on cdf build instead of cdf deploy.
  • If the client times out causing a ToolkitAPIError, the user is now informed how to increase the timeout.

Fixed

  • [alpha] When deploying a ResourceViewMapping Toolkit always treat the property view.version as a string in the YAML file.

@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 changed the title [CDF-28013, ]🐛Bugfixes [CDF-28013, CDF-25289]🐛Bugfixes Oct 3, 2026
@doctrino
doctrino marked this pull request as ready for review October 3, 2026 10:48
@doctrino
doctrino requested review from a team as code owners October 3, 2026 10:48
@doctrino
doctrino enabled auto-merge (squash) October 3, 2026 10:48
@doctrino

doctrino commented Oct 3, 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 introduces a default client timeout of 60 seconds, suggests increasing it via the 'CDF_CLIENT_TIMEOUT' environment variable on request failures, and enforces a minimum of one task in workflow definitions. Feedback recommends dynamically initializing the default timeout constant from the environment variable and improving the error message's formatting.

Comment thread cognite_toolkit/_cdf_tk/constants.py
Comment thread cognite_toolkit/_cdf_tk/client/http_client/_data_classes.py
@doctrino doctrino changed the title [CDF-28013, CDF-25289]🐛Bugfixes [CDF-28013, CDF-25289, CDF-28083]🐛Bugfixes Oct 3, 2026
@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

☂️ Code Coverage

current status: ✅

Overall Coverage

Statements Covered Coverage Threshold Status
43747 37165 85% 80% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
cognite_toolkit/_cdf_tk/client/config.py 83% 🟢
cognite_toolkit/_cdf_tk/client/http_client/_data_classes.py 92% 🟢
cognite_toolkit/_cdf_tk/constants.py 100% 🟢
cognite_toolkit/_cdf_tk/resource_ios/_migration.py 91% 🟢
cognite_toolkit/_cdf_tk/yaml_classes/workflow_version.py 100% 🟢
TOTAL 93% 🟢

updated for commit: 60b7251 by action🐍

@codecov

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.95%. Comparing base (9542082) to head (60b7251).

Files with missing lines Patch % Lines
...oolkit/_cdf_tk/client/http_client/_data_classes.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3317      +/-   ##
==========================================
- Coverage   85.55%   84.95%   -0.61%     
==========================================
  Files         463      463              
  Lines       45574    43747    -1827     
==========================================
- Hits        38991    37165    -1826     
+ Misses       6583     6582       -1     
Files with missing lines Coverage Δ
cognite_toolkit/_cdf_tk/client/config.py 83.33% <100.00%> (+0.35%) ⬆️
cognite_toolkit/_cdf_tk/constants.py 100.00% <100.00%> (ø)
cognite_toolkit/_cdf_tk/resource_ios/_migration.py 90.58% <100.00%> (+0.46%) ⬆️
...e_toolkit/_cdf_tk/yaml_classes/workflow_version.py 100.00% <100.00%> (ø)
...oolkit/_cdf_tk/client/http_client/_data_classes.py 91.50% <80.00%> (-1.35%) ⬇️

... and 193 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

if request.connect_attempt > 1:
message += (
f"\n You can try to increase the timeout by setting the 'CDF_CLIENT_TIMEOUT' "
f"environment variable. {os.environ.get('CDF_CLIENT_TIMEOUT', DEFAULT_CLIENT_TIMEOUT)}"

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.

Suggested change
f"environment variable. {os.environ.get('CDF_CLIENT_TIMEOUT', DEFAULT_CLIENT_TIMEOUT)}"
f"environment variable. Timeout is currently set to {os.environ.get('CDF_CLIENT_TIMEOUT', DEFAULT_CLIENT_TIMEOUT)}s"

COGNITE_CLI_KEYRING_SERVICE = "cognite-cli-session"
COGNITE_CLI_ACCESS_TOKEN_LEEWAY_SECONDS = 5 * 60

DEFAULT_CLIENT_TIMEOUT = 60

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.

There is a bit of a discrepancy unless we also change EnvironmentVariables.CDF_CLIENT_TIMEOUT (commands/auth/data_classes/_environment_variables.py:120) as this is currently set to 30 and not 60

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.

2 participants