Skip to content

Merge infrahub-release-1.12 into infrahub-develop - #1465

Merged
infrahub-github-bot-app[bot] merged 2 commits into
infrahub-developfrom
infrahub-release-1.12
Oct 29, 2026
Merged

infrahub-github-bot-app[bot] merged 2 commits into
infrahub-developfrom
infrahub-release-1.12

Conversation

@infrahub-github-bot-app

@infrahub-github-bot-app infrahub-github-bot-app Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Merging infrahub-release-1.12 into infrahub-develop after merging pull request #1278.


Summary by cubic

Merges infrahub-release-1.12 into infrahub-develop, bringing in the tracking group reconciliation fixes after PR #1278.

Written for commit 23386bd. Summary will update on new commits.

View guided diff Turn on auto-fix

update_group() returned early whenever a run tracked zero members, so it never
diffed the previous membership against the empty set. A generator that
legitimately produced nothing, or a repository whose last object file was
removed, left every previously tracked node behind as an orphan. With
delete_unused_nodes=True a run that tracks nothing now prunes an existing
group; one with no group creates none, and an already-empty group is not
re-saved. A context reused without finding a group has nothing to reap.

The reap deletes on the tracking context's branch rather than the client's
default branch, and both context-manager exits reset the client mode in a
finally block so a raising update_group() cannot leave the client tracking.

delete_unused() attempts every candidate and returns a ReapResult instead of
raising. A failure about the member is recorded against it and the rest are
still attempted; the refused members stay in the group so a later run retries
them, and update_group() reports them together as TrackingGroupCleanupError,
again on every run until whatever blocks the deletion is removed. A failure
about the request stops the reap and is re-raised as itself rather than
recorded against each remaining member. That includes a timeout and an
unreachable server, and also the coded failures the GraphQL path raises as a
GraphQLError: an expired or missing token, and a branch that is gone, merged,
needs a rebase or is locked by a merge.

The group write is attempted first, listing this run's nodes plus the refused
members and the ones never reached, so an interrupted reap cannot leave the
nodes the run created in no group at all. The member whose delete was
interrupted is kept only when the server answered: without an answer the
delete may have gone through, and a write naming a node that no longer exists
is rejected. When the write fails too, the error that stopped the reap is
raised with the write's failure as its cause.

A member already removed by another member's cascade is tolerated through the
catalogue's NodeNotFoundError, with the legacy message check kept only for
servers that report no code. The async and sync contexts share the decisions
around the reap and the write, keeping only their own calls.

TrackingGroupCleanupError is exported from infrahub_sdk.exceptions, survives
pickling, and infrahubctl renders it as a table of each member and the
server's reason rather than a traceback. The changed contract of
delete_unused() and the new exception type get a changed fragment of their
own.
fix(tracking): reconcile tracking groups on runs that save no nodes
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 23386bd
Status: ✅  Deploy successful!
Preview URL: https://1d7bd873.infrahub-sdk-python.pages.dev
Branch Preview URL: https://infrahub-release-1-12.infrahub-sdk-python.pages.dev

View logs

@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.50350% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
infrahub_sdk/query_groups.py 95.68% 2 Missing and 3 partials ⚠️
@@                 Coverage Diff                  @@
##           infrahub-develop    #1465      +/-   ##
====================================================
+ Coverage             87.57%   87.74%   +0.17%     
====================================================
  Files                   155      155              
  Lines                 15431    15518      +87     
  Branches               2078     2085       +7     
====================================================
+ Hits                  13513    13616     +103     
+ Misses                 1358     1345      -13     
+ Partials                560      557       -3     
Flag Coverage Δ
integration-tests 42.51% <57.34%> (+0.12%) ⬆️
python-3.10 62.52% <72.02%> (+0.60%) ⬆️
python-3.11 62.52% <72.02%> (+0.60%) ⬆️
python-3.12 62.52% <72.02%> (+0.58%) ⬆️
python-3.13 62.52% <72.02%> (+0.60%) ⬆️
python-3.14 62.54% <72.02%> (+0.61%) ⬆️
python-3.15 62.52% <72.02%> (+0.60%) ⬆️
python-filler-3.12 23.16% <18.88%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
infrahub_sdk/client.py 86.15% <100.00%> (+0.02%) ⬆️
infrahub_sdk/ctl/utils.py 76.27% <100.00%> (+1.72%) ⬆️
infrahub_sdk/exceptions/__init__.py 100.00% <ø> (ø)
infrahub_sdk/exceptions/base.py 95.52% <100.00%> (+0.13%) ⬆️
infrahub_sdk/query_groups.py 93.89% <95.68%> (+13.62%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@infrahub-github-bot-app
infrahub-github-bot-app Bot merged commit 1444d2f into infrahub-develop Oct 29, 2026
30 checks passed
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