Skip to content

fix(config): validate matrix dimension keys so an invalid key cannot red the pipeline#605

Merged
joshua-temple merged 1 commit into
mainfrom
fix/validate-matrix-keys
Jul 16, 2026
Merged

fix(config): validate matrix dimension keys so an invalid key cannot red the pipeline#605
joshua-temple merged 1 commit into
mainfrom
fix/validate-matrix-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 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 propertyNames pattern + minItems constraint 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 67-build-matrix exercises a valid matrix (incl. a hyphenated axis) and actionlints clean; no shipped manifest sets dimensions. (Rebased onto main after the injection PR; scenario renumbered to 67.)

…idation time

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
(cherry picked from commit 0172992)
@joshua-temple joshua-temple merged commit 39d5b7f into main Jul 16, 2026
21 checks passed
@joshua-temple joshua-temple deleted the fix/validate-matrix-keys branch July 16, 2026 07:03
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