[go: up one dir, main page]

Skip to content

Add semantic validation

What does this MR do and why?

Adds semantic validation for dynamic input rules, catching configuration errors at parse time:

  • references to undefined inputs in rule conditions
  • circular dependencies

Invalid - undefined input:

  spec:
    inputs:
      region:
        rules:
          - if: '$[[ inputs.environment ]] == "prod"'  #'environment' not defined
            options: ['us', 'eu']

Invalid - undefined input:

  spec:
    inputs:
      a:
        rules:
          - if: '$[[ inputs.b ]] == "x"'
            options: ['y']
      b:
        rules:
          - if: '$[[ inputs.a ]] == "y"'  # cicular deps
            options: ['x']

Valid

  spec:
    inputs:
      environment:
        options: ['dev', 'prod']
      region:
        rules:
          - if: '$[[ inputs.environment ]] == "prod"'
            options: ['us', 'eu']

References

References

#563376

MR Status Description
Input lexeme !206891 (merged) Parse $[[ inputs.X ]] syntax in expressions
Rules converter In review: !209135 Convert expression AST to JSON
Semantic validation 👈 You are here Validate input references and circular dependencies, error handlin
GraphQL API In review next, needs: rules converter Expose rules with condition trees

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Laura Montemayor

Merge request reports

Loading