Remove broken client.branch.diff_data() - #1229
Merged
saltas888 merged 8 commits intoAug 11, 2026
Merged
Conversation
Deploying infrahub-sdk-python with
|
| Latest commit: |
2859aa0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d4f41933.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://dsa-06082026-remove-branch-d.infrahub-sdk-python.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## infrahub-develop #1229 +/- ##
====================================================
+ Coverage 84.00% 84.09% +0.08%
====================================================
Files 147 147
Lines 13063 13041 -22
Branches 1932 1930 -2
====================================================
- Hits 10974 10967 -7
+ Misses 1522 1507 -15
Partials 567 567
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This was referenced Aug 6, 2026
Closed
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 8 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
The method targeted GET /api/diff/data, a REST endpoint that does not exist in Infrahub, so every call returned a 404 (and the URL builder was also missing the ? separator). Instead of adding a server endpoint for it, drop the method and point users at the existing GraphQL-based client.get_diff_tree() / client.get_diff_summary(). Also removes InfraHubBranchManagerBase, whose only content was the diff_data URL builder, and updates the branches guide accordingly. Closes #325 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The DiffTree GraphQL query exposes previous/new values per property but the SDK only fetched summary counts, so removing diff_data() would have left no way to retrieve the data-level diff it was meant to provide. With include_properties=True the diff tree now includes value-level details per attribute property and peer id/label per relationship element. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The query already fetched them but the parser dropped them for ONE relationships, leaving the IS_RELATED property as the only way to identify the changed peer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Extract the element-to-peer conversion into a helper shared by both cardinality branches, and stop silently dropping trailing elements when a cardinality-one relationship unexpectedly carries several: they now come back as peers, same shape as cardinality-many. The include_properties addition is folded into the removal changelog entry since it exists as the diff_data() replacement. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…inality-one flattening Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
saltas888
force-pushed
the
dsa-06082026-remove-branch-diff-data
branch
from
August 7, 2026 09:06
a9e6022 to
6550507
Compare
…ity-one flattening Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ajtmccarty
approved these changes
Aug 10, 2026
…data removal Nobody uses the value-level diff data, so the broken method is deleted without a replacement API. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
After the approval, I discussed with @ogenstad that we would much rather remove a broken functionality and assume nobody uses it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
client.branch.diff_data()has never worked: it callsGET /api/diff/data, an endpoint removed from Infrahub in opsmill/infrahub#4865, and its URL builder is also missing the?separator, so every call returns a 404 (#325).opsmill/infrahub#8594 tried to fix this by adding the missing REST endpoint back, but as @ogenstad pointed out there, the SDK should use existing queries/mutations rather than get a server endpoint of its own, and the broken method should be removed instead. Since the method has returned a 404 for as long as the endpoint has been absent, nobody can be using it, so it is deleted without a replacement.
For branch diffs the SDK already has the GraphQL-based
get_diff_tree()andget_diff_summary(), both backed by theDiffTreequery.Closes #325
What changed
diff_data()fromInfrahubBranchManagerandInfrahubBranchManagerSyncInfraHubBranchManagerBase, whose only content was thediff_dataURL builder (generate_diff_data_url)client.get_diff_tree()/client.get_diff_summary()removed)An earlier iteration also extended
get_diff_tree()with aninclude_propertiesoption to preserve the value-level diff thatdiff_data()was meant to return, we agreed the broken functionality is unused so a plain removal is preferable. Those commits are reverted on the branch, the net diff is the removal only.How to review
infrahub_sdk/branch.py, pure deletiondocs/docs/python-sdk/guides/branches.mdx, the replacement guidanceHow to test
Impact & rollout
get_diff_tree()/get_diff_summary()(note there is nobranch_onlyequivalent,DiffTreealways compares the branch against its base).Checklist