Skip to content

test(ci): pin the workflow spec's quoted-key, env-block and step-key rules - #604

Merged
ThomasK33 merged 2 commits into
mainfrom
test/workflow-spec-key-pattern-tests
Nov 13, 2026
Merged

ThomasK33 merged 2 commits into
mainfrom
test/workflow-spec-key-pattern-tests

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Why

The verifier of #596 found three one-line changes of the key patterns in field() that keep all 16 tests of the workflow spec green:

  1. X1: the closing quote of the single-quoted pattern is optional.
  2. X2: the bare pattern takes a leading '.
  3. X11: the two quoted patterns merge into one that takes any quote on each side (["']key["']:).

Under each of them a workflow that CI accepts saves the mise cache on a pull request and still passes the spec, for example a key 'cache: "false" #': x or "cache': false #": x. actionlint, zizmor and prettier --check pass both.

The verifier of #596 found a fourth change, X6, that also kept every test green. It compares the block with current ~= nil instead of current == block, so an entry of the env block counts as an input of with:.

The verifier of #596 had run a fifth change, X9, and found no input that tells it apart. The verifier of this PR found one. Before the new test below, X9 kept every test green. It replaces the %S check of the block line with %w, so a step-key line with no letter or digit does not end the with: block. An explicit YAML key is such a line: ? and : alone on their lines at the step-key indent. With X9, cache: false after them stays an input of with:, and YAML puts it under env. GitHub's workflow parser accepts that text.

#596 merged under the maintainer's waiver for this open test gap. This PR closes it.

What changed

Only tests/unit/workflow_cache_spec.lua (+18, -17). The workflows are unchanged. The spec still has no YAML parser, and no new form is read.

  1. The test of one-sided quotes also feeds a key with a left quote only ('cache: c) and two mismatched pairs ("cache_save': d and 'cache_key": e). It is renamed to say so.
  2. A new test checks that an entry of the env block is not read as an input of with:. It reads cache: false under env: and expects no cache under with and false under env.
  3. A new test feeds the explicit key text (? and : at the step-key indent, env and cache: false at the entry indent under them) and expects no cache under with. It kills X9.
  4. split_lines is gone. The call (text .. "\n"):gmatch("(.-)\n") is already an iterator, and every result stays the same.

Evidence

Each change of the reader is one edit of the spec, and the spec runs on the workflow of main. Before is the spec of main (16 tests), after is this branch (18 tests).

Change of the reader Before After (failing test)
X1: closing ' of the single-quoted pattern optional green red (the one-sided and mismatched pair test)
X2: the bare pattern takes a leading ' green red (the one-sided and mismatched pair test)
X11: the two quoted patterns merged green red (the one-sided and mismatched pair test)
X6: current ~= nil instead of current == block green red (the new env block test)
S1 to S10, X3, X4, X5, X7, X10 red red
X9: %w for %S in the block line green red (the new step-key test)
X8: block indent <= 8 green green

Counts over the 21 changes. Before, 15 are red and 6 are green. After, 20 are red and 1 is green. 15 stay red, 5 turn red (X1, X2, X6, X9, X11) and 1 stays green (X8). The failing tests of the 15 that stay red are the same, apart from the renamed test and the two new tests: S6 and S10 also fail the env block test, and S1, S10 and X7 also fail the step-key test. X9 is red because an explicit YAML key (? and : alone on their lines) tells it apart, GitHub's workflow parser accepts that text, and the new test catches it. X8 stays green on every spec. No input that GitHub's parser accepts was found to tell it apart.

I ran 170 workflows (the 169 of the verifier of #596 and the workflow of main) with the spec of main, with the spec after the first commit of this PR and with the final spec. 114 are red and 56 are green, and the result and the failing test names are the same for all of them. The 169 give the same rows as before this change.

Claim Evidence
The spec passes on main with this change 18 successes, 0 failures
The workflows are valid The workflows are identical to main. actionlint 1.7.12 on all 5: exit 0. zizmor 1.25.2 --offline on all 5: no findings (25 suppressed). mise run format-check: exit 0 (458 files, 0 changed)
Gate mise run clean && mise run all exits 0 in 654 s: 1910 successes, 0 failures, 0 errors, 36 pending (seed 1794569343). luacheck: 0 warnings, 0 errors in 200 files. The stub claude and GNU timeout first on PATH

Generated with xum • Model: anthropic:claude-sonnet-5-5 • Thinking: xhigh

…w spec

Three one-line changes of the key patterns kept all tests green: the closing quote of
the single-quoted pattern optional, the bare pattern taking a leading quote, and the
two quoted patterns merged into one that takes any quote on each side. Under them
a key such as 'cache: "false" #': x was read as cache (the head rejected inputs
that main accepted), and a mismatched pair "cache': false was read too.

The one-sided test now also feeds a key with a left quote only, and the two
mismatched pairs, so each of these changes turns it red. A new test checks that an
entry of the env block is not read as an input of with:, which kills a change of the
block comparison. split_lines is gone: the gmatch call is already an iterator.

_Generated with xum • Model: anthropic:claude-sonnet-5-5 • Thinking:
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T11:43:59.544717Z 6bc2d41 Manual request
🔒 Security Review ✅ Completed 2026-11-13T11:44:08.984754Z 6bc2d41 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: cc430cca80

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: cc430cca80

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

…ot a word

The block-end line used line:match("%S"), and a change to line:match("%w") kept every
test green. An explicit YAML key puts "?" and ":" alone on their lines at the step-key
indent, so with "%w" the with: block stayed open and cache: false, which YAML puts under
env, counted as an input of with:. GitHub's workflow parser accepts that text. The new
test feeds it and expects no cache input under with:.

_Generated with xum • Model: anthropic:claude-sonnet-5-5 • Thinking:
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 6bc2d41a16

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 6bc2d41a16

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33 ThomasK33 changed the title test(ci): pin the workflow spec's quoted-key and env-block rules test(ci): pin the workflow spec's quoted-key, env-block and step-key rules Nov 13, 2026
@ThomasK33
ThomasK33 added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 367ece8 Nov 13, 2026
10 checks passed
@ThomasK33
ThomasK33 deleted the test/workflow-spec-key-pattern-tests branch November 13, 2026 12:23
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