Repository navigation
fix(ci): a workflow's empty array must not abort the step on bash 3.2 - #13034
Conversation
|
Intent: Get the nightly build green again by fixing the two causes of the macOS Backend Tests reds — a workflow array expansion that bash 3.2 rejects, and a pdf-extractor test that asserts the memory ceiling only Linux has — and pin the array class so the next workflow cannot reintroduce it. |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 12bca57 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. The nightly failure is linked (run 35825517502), the class fix is complete — I grepped What this change shipsInventory (3 items) — 3 justifiedIntent: FIX — stop workflow steps from dying under bash 3.2 (
[FIRST-PRINCIPLES-REVIEWED] 12bca57 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Security Scope Review -- 🟡 CONCERNSWhich legitimate operations does Verdict basis: the reviewer's own judgement; no confirmed regression. Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. Scope-Verdict: CONCERNS TIGHTENING: a new pytest pin, ADJUDICATED: 9 candidates, 0 confirmed newly-refused. The composite is byte-identical at base and head, so the rows probe only for accidental coupling: the new PLATFORM COVERAGE: posix rows for the bash idiom and the pytest/git/find invocations, because the diff's whole premise is a bash-version split (macOS UNADJUDICATED: the tightening itself. Guard: the pytest sweep in
[SCOPE-REVIEWED] 12bca57 |
Opus 5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
fef0700 to
bc78025
Compare
|
GPT 5.6 Review —
|
bc78025 to
4fa41ec
Compare
|
New head Why: the ~08:24Z GitHub App installation-token exhaustion (HTTP 403 It was still held, by design. Everything else on |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
4fa41ec to
4f0daf8
Compare
|
New head The installation-token rate limit was exhausted twice this morning (08:24Z and again 09:23Z), and every red on the previous two heads traced to that, not to this diff: This push waited for three consecutive 15-minute windows with zero rate-limit failures repo-wide, so it is not another attempt into an exhausted quota. Unchanged and re-verified on this tree: the workflow pin plus the pdf extractor tests (50 passed) and For the record, the only non-infra red seen across those heads was |
|
de35eca to
61f2547
Compare
|
Rebased: main moved in The previous head |
Bash only stopped treating an EMPTY array's expansion as an unset variable in
4.4, and macOS ships 3.2.57 as /bin/bash. Under `set -u` the quoted form
`"${arr[@]}"` therefore aborts the whole step with `arr[@]: unbound variable`
the moment the array is empty. That is not only a runner concern: about two
dozen tests EXTRACT a workflow `run:` block and execute it with the host bash,
so the macOS suite runs this shell under 3.2 -- which is how seven
test_pr_readiness_evaluate tests went red in the 2026-09-23 nightly.
#13125 has since fixed the ONE line that caused those seven. This is the rest
of the class: the other 46 array value-expansions across .github/workflows are
written `${arr[@]+"${arr[@]}"}`, which expands to nothing for an unset or empty
array and to every element otherwise, on every bash. Behaviour on the bash
Actions actually uses is unchanged, and all 523 `run:` blocks were
syntax-checked under both 3.2.57 and 5.2.15.
test_workflow_array_expansion_bash32.py keeps the class from returning. It does
NOT accept a count guard, deliberately: the array that cost the nightly had
one, and was emptied again after it, so the property has to be local to the
expansion rather than a claim about reachability. It carries a positive control
in both directions -- a matcher that silently stops matching is
indistinguishable from a clean tree -- and it ignores whole-line comments,
because these scripts quote both forms as prose to explain which to write.
docs/ci/ci-and-reviews.md records the idiom under the macOS lane, so a new
author's first contact with the odd-looking form is a sentence rather than a
red CI round-trip.
61f2547 to
12bca57
Compare
|
Rebased onto main at
What is left is the rest of the bash-3.2 class, which nobody else has touched: the 46 array value-expansions outside Verified on this head: 87 passed across the pin, the pdf tests and the dashboard startup tests; |
buluoray
left a comment
There was a problem hiding this comment.
Approving at 12bca57.
Verified: ${arr[@]+"${arr[@]}"} keeps element boundaries and expands an empty array to zero words (both pinned by the new test under bash 5.2). The git diff -- ${surface[@]+...} and printf sites behave the same as on bash 5. The rc fail-closed checks are untouched. The scanner has a positive control and a >100-block floor, and restoring one old "${waiting[@]}" reddens the sweep test. I did not run anything under bash 3.2 itself.
…kirodotdev#13034) Bash only stopped treating an EMPTY array's expansion as an unset variable in 4.4, and macOS ships 3.2.57 as /bin/bash. Under `set -u` the quoted form `"${arr[@]}"` therefore aborts the whole step with `arr[@]: unbound variable` the moment the array is empty. That is not only a runner concern: about two dozen tests EXTRACT a workflow `run:` block and execute it with the host bash, so the macOS suite runs this shell under 3.2 -- which is how seven test_pr_readiness_evaluate tests went red in the 2026-09-23 nightly. kirodotdev#13125 has since fixed the ONE line that caused those seven. This is the rest of the class: the other 46 array value-expansions across .github/workflows are written `${arr[@]+"${arr[@]}"}`, which expands to nothing for an unset or empty array and to every element otherwise, on every bash. Behaviour on the bash Actions actually uses is unchanged, and all 523 `run:` blocks were syntax-checked under both 3.2.57 and 5.2.15. test_workflow_array_expansion_bash32.py keeps the class from returning. It does NOT accept a count guard, deliberately: the array that cost the nightly had one, and was emptied again after it, so the property has to be local to the expansion rather than a claim about reachability. It carries a positive control in both directions -- a matcher that silently stops matching is indistinguishable from a clean tree -- and it ignores whole-line comments, because these scripts quote both forms as prose to explain which to write. docs/ci/ci-and-reviews.md records the idiom under the macOS lane, so a new author's first contact with the odd-looking form is a sentence rather than a red CI round-trip. Co-authored-by: w <w@k.local>
Problem / Motivation
In a workflow
run:block,"${arr[@]}"aborts the whole step when the array isempty. Bash only stopped treating an empty array's expansion as an unset variable
in 4.4, and macOS ships 3.2.57 as
/bin/bash, so underset -uthe step dieswith
arr[@]: unbound variable. That reached a real lane: about two dozen testsEXTRACT a
run:block and execute it with the hostbash, so the macOS suiteruns this shell under 3.2, and seven
test_pr_readiness_evaluatetests went redin the 2026-09-23 nightly (run 35825517502).
#13125has since fixed that one line. What is left is the rest of the class:46 more sites across
.github/workflows/, each the same expansion still waitingto bite, and nothing yet stopping the next one from being written.
Why it matters
The readiness line that started this was not merely a failing test. It sits on the
step's non-terminal fallback: on a transport failure readiness is meant to publish
"could not be evaluated" and exit 0, never a red check. On a bash that rejects the
empty array it exited 1 instead — the red it exists to prevent.
The remaining exposure is every other site, plus the absence of anything that
would stop the next one being written the same way.
#13202has meanwhile landedthe pdf half this PR also carried, so that is no longer here.
What changed (motivation → approach → change)
The array class. Every array value-expansion in
.github/workflowsis now${arr[@]+"${arr[@]}"}, which expands to nothing for an unset or empty array andto every element otherwise, on every bash. It is a no-op on bash >= 4.4, so
nothing about how Actions runs these scripts changes; it is only ever the
difference between zero words and a fatal error.
test_workflow_array_expansion_bash32.pykeeps the class from returning. It doesnot accept a count guard, deliberately: the array that cost the nightly had
one, and was emptied again after it, so the asked-for property has to be local to
the expansion rather than a claim about reachability. It carries a positive
control in both directions, because a matcher that silently stops matching is
indistinguishable from a clean tree, and it ignores whole-line comments — these
scripts quote both the safe and the unsafe form as prose to explain which to
write, and the pin flagged that prose the first time main's own comment landed.
Where a new author meets the idiom.
docs/ci/ci-and-reviews.mdgains a shortsubsection under the macOS lane, so the first contact with the odd-looking form is
a sentence rather than a red CI round-trip.
Backwards compatibility
Compatible:
${arr[@]+"${arr[@]}"}expands identically to"${arr[@]}"on bash4.4+ for a non-empty array and for an empty one, so every workflow behaves exactly
as before on the runners Actions uses.
Tests
test/test_workflow_array_expansion_bash32.py— new. Sweeps everyrun:blockin
.github/workflowsand fails on any array value-expansion bash 3.2 rejects,naming the file, step, and the form to write instead. Also asserts its own
matcher flags the unsafe form and spares the safe one (whose inner
${a[@]}carries no tail), that the sweep actually read the workflows so it cannot pass
vacuously, and that the safe form keeps elements containing spaces and expands
an empty array to zero words.
Manual verification
The macOS failures were reproduced and fixed locally, not inferred from the log:
"${a[@]}"on an emptyarray under
set -ufails,${#a[@]}does not, and${a[@]+"${a[@]}"}succeeds while keeping
"one two"as one word.PATH,test_pr_readiness_evaluate.pyreproducedexactly the same seven failures as the macOS shard, at the same line.
run:blocks syntax-check clean under both 3.2.57 and5.2.15, which is what covers the mechanical rewrites.
Screenshots / video
Why no screenshot: CI workflow, test and docs change; no frontend surface is
touched.
Related Issues
no linked issue:
#13072tracked the readiness half and#13125closed it.Pattern harvest
Rule candidate: lint
Pattern: array expanded as
"${a[@]}"underset -uin a script a test executeson a host whose bash predates 4.4
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)