Skip to content

Merge develop into infrahub-develop - #1584

Merged
infrahub-github-bot-app[bot] merged 3 commits into
infrahub-developfrom
develop
Dec 3, 2026
Merged

infrahub-github-bot-app[bot] merged 3 commits into
infrahub-developfrom
develop

Conversation

@infrahub-github-bot-app

@infrahub-github-bot-app infrahub-github-bot-app Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Merging develop into infrahub-develop after merging pull request #1581.

View guided diff Turn on auto-fix

polmichel and others added 3 commits December 3, 2026 17:02
…1557)

* fix(analyzer): report an operation wrapped in a top-level fragment

GraphQLQueryAnalyzer.operations enumerated only the FieldNode children of
each operation's top-level selection set, so an operation written inside an
inline fragment (`... on Mutation { X }`, `... { X }`) or reached through a
fragment spread was skipped. A developer using the analyzer directly got
contains_mutation False for a document whose selected operation is a mutation.

Resolve inline fragments and fragment spreads when enumerating an operation's
fields, mirroring the fix already released in Infrahub's own
InfrahubGraphQLQueryAnalyzer. Each fragment is expanded once per operation, so
a fragment reached through a cycle or through two spreads neither loops nor
contributes its fields twice.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test(analyzer): hold the hidden-mutation documents in a dataclass

The hidden-mutation documents were a list of `pytest.param` strings. Express
each as a `HiddenMutationCase`, the dataclass pattern the other SDK test
modules use and the shape the backend's shared `hidden_mutation_cases.py`
already has, so a case carries its name next to its query and the two suites
read side by side.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test(analyzer): pin the whole operations list of each hidden-mutation case

Each case asserted that `TestPersonCreate` appeared among the operations, so a
case that also gained or lost an unrelated operation still passed. Carry the
expected list in `HiddenMutationCase` and compare `operations` against it, in
document order: the multi-operation documents now also pin the `__typename`
field of their first operation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
#1569)

* fix(utils): extract the fields of an inline fragment nested in another

extract_fields read .name on every child of an inline fragment, so a
nested inline fragment raised AttributeError. Infrahub calls it through
GraphQLQueryAnalyzer.calculate_depth after it runs an operation, and
answered such a query with HTTP 500.

An inline fragment now contributes the fields that extract_fields
returns for its selection set. A fragment spread inside an inline
fragment is skipped, as it already was outside one, instead of being
reported as a field named after the fragment.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* fix(utils): keep every sub-field of a field selected twice

extract_fields merged two selections of the same field with dict.update,
which replaced the nested dictionaries of the first selection. For
`cars { edges { node { id } } } cars { edges { node { name } } }` only
`name` remained under `node`. A field selected first without
sub-fields and then with them kept none.

The merge now uses deep_merge_dict, so the selections are combined at
every level.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Merge stable into develop
@infrahub-github-bot-app
infrahub-github-bot-app Bot requested a review from a team as a code owner December 3, 2026 16:29
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9ea61f8
Status: ✅  Deploy successful!
Preview URL: https://3e55d657.infrahub-sdk-python.pages.dev
Branch Preview URL: https://develop.infrahub-sdk-python.pages.dev

View logs

@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
infrahub_sdk/analyzer.py 94.73% 0 Missing and 1 partial ⚠️
@@                 Coverage Diff                  @@
##           infrahub-develop    #1584      +/-   ##
====================================================
+ Coverage             88.52%   88.65%   +0.13%     
====================================================
  Files                   161      161              
  Lines                 16994    17618     +624     
  Branches               2286     2447     +161     
====================================================
+ Hits                  15044    15620     +576     
- Misses                 1362     1398      +36     
- Partials                588      600      +12     
Flag Coverage Δ
integration-tests 42.47% <0.00%> (-0.21%) ⬇️
python-3.10 65.30% <78.57%> (+0.30%) ⬆️
python-3.11 65.31% <78.57%> (+0.30%) ⬆️
python-3.12 65.31% <78.57%> (+0.30%) ⬆️
python-3.13 65.31% <78.57%> (+0.32%) ⬆️
python-3.14 65.30% <78.57%> (+0.29%) ⬆️
python-3.15 65.32% <78.57%> (+0.30%) ⬆️
python-filler-3.12 22.25% <17.85%> (+0.25%) ⬆️

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

Files with missing lines Coverage Δ
infrahub_sdk/utils.py 91.50% <100.00%> (+3.03%) ⬆️
infrahub_sdk/analyzer.py 89.79% <94.73%> (+5.27%) ⬆️

... and 8 files with indirect coverage changes

🚀 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 7222734 into infrahub-develop Dec 3, 2026
57 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