Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: 502 error message for invalid generator parameter #6184

Open
BeArchiTek opened this issue Mar 28, 2025 · 0 comments
Open

bug: 502 error message for invalid generator parameter #6184

BeArchiTek opened this issue Mar 28, 2025 · 0 comments
Labels
state/need-triage This issue needs to be triaged type/bug Something isn't working as expected

Comments

@BeArchiTek
Copy link
Contributor

Component

API Server / GraphQL

Infrahub version

1.2.0

Current Behavior

When there's a mismatch between parameters defined in the generator declaration (for the query) and those declared in the query itself, the declaration is accepted, but running it will result in a 502.

For example: for a given generator :

generator_definitions:
  - name: create_tags
    file_path: "generators/create_tags.py"
    targets: tags_groups
    query: GetTags
    parameters:
      fake_name: "name__value"

With this query

query GetTags($tag_name: String!) { 
  BuiltinTag(name__value: $tag_name) {
    edges {
      node {
        id
        name {
          value
        }
        description {
          value
        }
      }
    }
  }
}

Expected Behavior

  1. The system should validate parameter names at configuration load time
  2. Error message should indicate:
    • The parameter name expected by the query (tag_name)
    • The parameter name provided in the configuration (fake_name)
    • The generator name (create_tags)
    • The query name (GetTags)

Steps to Reproduce

  1. Reuse the generator declaration and query definition from above
  2. Load the configuration
  3. Try to run the generator
  4. Observe 502 error instead of helpful parameter mismatch message

Additional Information

No response

@BeArchiTek BeArchiTek added the type/bug Something isn't working as expected label Mar 28, 2025
@exalate-issue-sync exalate-issue-sync bot added the state/need-triage This issue needs to be triaged label Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state/need-triage This issue needs to be triaged type/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

1 participant