Skip to content

fix(config): validate matrix dimension keys so they cannot red the pipeline at GHA parse#603

Closed
joshua-temple wants to merge 1 commit into
mainfrom
fix/validate-matrix-dimension-keys
Closed

fix(config): validate matrix dimension keys so they cannot red the pipeline at GHA parse#603
joshua-temple wants to merge 1 commit into
mainfrom
fix/validate-matrix-dimension-keys

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Matrix dimensions keys were the only emitted identifier class with no validation, so a manifest with a key like 'go version' (a space) passed cascade validation but redded the generated pipeline at first GitHub Actions parse (the key lands raw as a YAML key and in ${{ matrix. }}).

  • validateMatrix (internal/config/validate_v1.go) rejects any dimension key that is not a valid GHA matrix identifier (^[A-Za-z_][A-Za-z0-9_-]*$ - hyphens kept, since ${{ matrix.node-version }} is the canonical GHA pattern) and rejects empty axes, naming the offending key.
  • The same constraint (propertyNames pattern + minItems) is added to all three byte-identical schema copies.

Verification: build/-race/lint green, 3015 tests; 13-case red-then-green validation test; e2e scenario 63-build-matrix exercises a valid matrix (incl. a hyphenated axis) and actionlints clean; no shipped manifest sets dimensions.

…idation time

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple

Copy link
Copy Markdown
Collaborator Author

Superseded by the rebuilt PR off current main (scenario renumbered to avoid collision).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant