Skip to content

Add the cost attributes to the GraphQL query protocols [INFP-739] - #1414

Draft
fatih-acar wants to merge 1 commit into
stablefrom
fac/graphql-query-cost-protocols-rrake
Draft

fatih-acar wants to merge 1 commit into
stablefrom
fac/graphql-query-cost-protocols-rrake

Conversation

@fatih-acar

@fatih-acar fatih-acar commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Why

In opsmill/infrahub#11004, Infrahub adds two read-only, optional attributes to CoreGraphQLQuery:

  • cost_level: unknown, low or high
  • cost_estimate: JSON with the estimated database rows of one run of the stored query

This file is generated from that schema, so it has to carry the same attributes. Without them, invoke backend.generate in the Infrahub repository leaves this file changed, and the backend-validate-generated job fails on opsmill/infrahub#11004.

Needed by opsmill/infrahub#11004, part of INFP-739.

What changed

  • cost_level and cost_estimate are added to CoreGraphQLQuery and CoreGraphQLQuerySync.

Nothing else. invoke backend.generate in the Infrahub repository renders the file; it is not written by hand.

How to review

One commit on top of stable, four added lines. The Infrahub submodule on opsmill/infrahub#11004 pins de03cbf, which is 12 commits behind stable. infrahub_sdk/protocols.py is the same in both.

How to test

In opsmill/infrahub, on the branch of opsmill/infrahub#11004, with python_sdk at this branch:

uv run invoke backend.generate
git -C python_sdk diff --exit-code infrahub_sdk/protocols.py

Local result: the file on this branch is the output of invoke backend.generate on that branch. ruff check and ruff format --check report no errors.

Impact & rollout

  • Backward compatibility: two attributes are added to the protocols. No existing attribute changes.

Assisted-by: opsmill-dev-pr 0.2.0

🤖 Generated with Claude Code


Summary by cubic

Adds the cost_level and cost_estimate attributes to CoreGraphQLQuery and CoreGraphQLQuerySync in the Python SDK protocols.

infrahub_sdk/protocols.py is generated from the Infrahub schema via invoke backend.generate in the Infrahub repository. Infrahub (opsmill/infrahub#11004) adds these two read-only, optional attributes to CoreGraphQLQuery, so the generated protocols must carry them or the backend-validate-generated job fails. This PR adds only the two missing attributes, with no other changes.

Written for commit b92578a. Summary will update on new commits.

View guided diff Turn on auto-fix

… protocols [INFP-739]

Infrahub adds two read-only, optional attributes to CoreGraphQLQuery:
cost_level (unknown, low or high) and cost_estimate (JSON), in
opsmill/infrahub#11004. This file is generated from that schema by
`invoke backend.generate` in the Infrahub repository, so it carries the
same attributes on CoreGraphQLQuery and CoreGraphQLQuerySync.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@fatih-acar fatih-acar added the type/feature New feature or request label Oct 11, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: b92578a
Status: ✅  Deploy successful!
Preview URL: https://51c95360.infrahub-sdk-python.pages.dev
Branch Preview URL: https://fac-graphql-query-cost-proto.infrahub-sdk-python.pages.dev

View logs

fatih-acar added a commit to opsmill/infrahub that referenced this pull request Oct 11, 2026
INFP-739]

opsmill/infrahub-sdk-python#1414 adds cost_level and cost_estimate to
the CoreGraphQLQuery protocols, so `invoke backend.validate-generated`
finds the SDK protocols up to date. The commit is on top of the SDK
stable branch, which also brings dependency bumps and the fix that makes
generators, transforms and checks use the configured default branch
(opsmill/infrahub-sdk-python#1293).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@           Coverage Diff           @@
##           stable    #1414   +/-   ##
=======================================
  Coverage   85.06%   85.06%           
=======================================
  Files         148      148           
  Lines       13303    13286   -17     
  Branches     1960     1950   -10     
=======================================
- Hits        11316    11302   -14     
+ Misses       1422     1421    -1     
+ Partials      565      563    -2     
Flag Coverage Δ
integration-tests 38.72% <100.00%> (-0.07%) ⬇️
python-3.10 57.97% <100.00%> (+0.07%) ⬆️
python-3.11 57.99% <100.00%> (+0.08%) ⬆️
python-3.12 57.99% <100.00%> (+0.10%) ⬆️
python-3.13 57.97% <100.00%> (+0.07%) ⬆️
python-3.14 57.99% <100.00%> (+0.08%) ⬆️
python-filler-3.12 23.75% <0.00%> (-0.03%) ⬇️

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

Files with missing lines Coverage Δ
infrahub_sdk/protocols.py 100.00% <100.00%> (ø)

... and 1 file 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

type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant