Skip to content

Fix view implements order normalization on deploy - #3117

Draft
atussak wants to merge 1 commit into
mainfrom
fix/view-implements-topological-sort-on-deploy
Draft

Fix view implements order normalization on deploy#3117
atussak wants to merge 1 commit into
mainfrom
fix/view-implements-topological-sort-on-deploy

Conversation

@atussak

@atussak atussak commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Description

Extended views (implements) can resolve property overrides differently depending on parent order in the implements list. CDF expects ancestors before descendants (e.g. grandparent, then parent), but deploy was sending YAML order as-is. Dump already sorted topologically, so push/pull cycles could mix up semantics for views with multiple parents.

This change normalizes implements to topological order on load, create, and dump, using views from the current deploy batch when parent views are not yet in CDF.

Bump

  • Patch
  • Skip

Changelog

Fixed

  • Normalize view implements order on deploy so extended views keep correct property override semantics.

Test plan

  • uv run pytest tests/test_unit/test_cdf_tk/test_cruds/test_data_model.py::TestViewLoader -q
  • uv run pytest tests/test_unit/test_cdf_tk/test_cruds/test_data_model.py -q
  • Deploy a data model with a multi-parent extended view and verify implements order in CDF matches topological order after push

Made with Cursor

CDF resolves property overrides from implements order, but deploy previously sent YAML order as-is while only dump sorted topologically. Normalize implements on load, create, and dump so extended views keep correct override semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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.

@github-actions

Copy link
Copy Markdown

☂️ Code Coverage

current status: ✅

Overall Coverage

Statements Covered Coverage Threshold Status
44500 38295 86% 80% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
cognite_toolkit/_cdf_tk/commands/dump_resource.py 77% 🟢
cognite_toolkit/_cdf_tk/dataio/_instances.py 75% 🟢
cognite_toolkit/_cdf_tk/resource_ios/_resource_ios/datamodel.py 89% 🟢
TOTAL 81% 🟢

updated for commit: 9b9c249 by action🐍

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.05%. Comparing base (b1d20fd) to head (9b9c249).
⚠️ Report is 183 commits behind head on main.

Files with missing lines Patch % Lines
cognite_toolkit/_cdf_tk/dataio/_instances.py 0.00% 1 Missing ⚠️
...it/_cdf_tk/resource_ios/_resource_ios/datamodel.py 95.65% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3117      +/-   ##
==========================================
+ Coverage   85.64%   86.05%   +0.40%     
==========================================
  Files         462      476      +14     
  Lines       41316    44500    +3184     
==========================================
+ Hits        35386    38295    +2909     
- Misses       5930     6205     +275     
Files with missing lines Coverage Δ
cognite_toolkit/_cdf_tk/commands/dump_resource.py 77.42% <100.00%> (ø)
cognite_toolkit/_cdf_tk/dataio/_instances.py 75.30% <0.00%> (-1.07%) ⬇️
...it/_cdf_tk/resource_ios/_resource_ios/datamodel.py 88.83% <95.65%> (-0.14%) ⬇️

... and 184 files with indirect coverage changes

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

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