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

Draft
FA
6d ago
+4-0

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.