Add infrahubctl graphql query-report command#976
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## develop #976 +/- ##
===========================================
- Coverage 82.02% 81.76% -0.27%
===========================================
Files 135 135
Lines 11841 11659 -182
Branches 1762 1766 +4
===========================================
- Hits 9713 9533 -180
+ Misses 1576 1575 -1
+ Partials 552 551 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
ed38b6b to
a7f5a72
Compare
Deploying infrahub-sdk-python with
|
| Latest commit: |
ccdf6dc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1ad46071.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://pog-graphql-query-report-ifc.infrahub-sdk-python.pages.dev |
|
|
||
| if online: | ||
| node = await client.get( | ||
| kind=CoreGraphQLQuery, # type: ignore[type-abstract] |
There was a problem hiding this comment.
Temporary ignore until we can resolve the protocol issues within the SDK.
a7f5a72 to
62f0ca0
Compare
62f0ca0 to
a246e81
Compare
There was a problem hiding this comment.
2 issues found across 5 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/docs/infrahubctl/infrahubctl-graphql.mdx">
<violation number="1" location="docs/docs/infrahubctl/infrahubctl-graphql.mdx:25">
P3: Command description references internal class `InfrahubGraphQLQueryReport` that is meaningless to end users. Replace with user-facing description such as 'Analyze a GraphQL query and report its characteristics, such as unique-target suitability for artifact definitions.'</violation>
<violation number="2" location="docs/docs/infrahubctl/infrahubctl-graphql.mdx:39">
P3: `--online` option description references internal type `CoreGraphQLQuery` that is not meaningful to users. Replace with user-facing wording such as '...from the Infrahub server (by query name) instead of...'</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
|
||
| **Options**: | ||
|
|
||
| * `--online`: Fetch the query from the Infrahub server (CoreGraphQLQuery by name) instead of reading it from the local .infrahub.yml file. |
There was a problem hiding this comment.
P3: --online option description references internal type CoreGraphQLQuery that is not meaningful to users. Replace with user-facing wording such as '...from the Infrahub server (by query name) instead of...'
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/docs/infrahubctl/infrahubctl-graphql.mdx, line 39:
<comment>`--online` option description references internal type `CoreGraphQLQuery` that is not meaningful to users. Replace with user-facing wording such as '...from the Infrahub server (by query name) instead of...'</comment>
<file context>
@@ -16,9 +16,31 @@ $ infrahubctl graphql [OPTIONS] COMMAND [ARGS]...
+
+**Options**:
+
+* `--online`: Fetch the query from the Infrahub server (CoreGraphQLQuery by name) instead of reading it from the local .infrahub.yml file.
+* `--branch TEXT`: Branch on which to run the report.
+* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
</file context>
| * `--online`: Fetch the query from the Infrahub server (CoreGraphQLQuery by name) instead of reading it from the local .infrahub.yml file. | |
| * `--online`: Fetch the query from the Infrahub server (by query name) instead of reading it from the local .infrahub.yml file. |
|
|
||
| ## `infrahubctl graphql query-report` | ||
|
|
||
| Run a GraphQL query through InfrahubGraphQLQueryReport and report its analysis. |
There was a problem hiding this comment.
P3: Command description references internal class InfrahubGraphQLQueryReport that is meaningless to end users. Replace with user-facing description such as 'Analyze a GraphQL query and report its characteristics, such as unique-target suitability for artifact definitions.'
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/docs/infrahubctl/infrahubctl-graphql.mdx, line 25:
<comment>Command description references internal class `InfrahubGraphQLQueryReport` that is meaningless to end users. Replace with user-facing description such as 'Analyze a GraphQL query and report its characteristics, such as unique-target suitability for artifact definitions.'</comment>
<file context>
@@ -16,9 +16,31 @@ $ infrahubctl graphql [OPTIONS] COMMAND [ARGS]...
+## `infrahubctl graphql query-report`
+
+Run a GraphQL query through InfrahubGraphQLQueryReport and report its analysis.
+
+**Usage**:
</file context>
| Run a GraphQL query through InfrahubGraphQLQueryReport and report its analysis. | |
| Analyze a GraphQL query and report its characteristics, such as unique-target suitability for artifact definitions. |
Why
Adds a new subcommand to infrahubctl for
infrahubctl graphql query-report, it's to allow users to check a query either from a .infrahub.yml file or by specifying the name of a query that exists in Infrahub and returning a query report. For now the only entry in the report is that users can see if the query can be used for unique targets for artifact definitions.Example output
What changed