Skip to content

fix(ci): a workflow's empty array must not abort the step on bash 3.2 - #13034

Merged
bolichen97 merged 1 commit into
mainfrom
fix/nightly-macos-reds
Sep 24, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/nightly-macos-reds

Conversation

@bolichen97

@bolichen97 bolichen97 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

In a workflow run: block, "${arr[@]}" aborts the whole step when the array is
empty. 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 under set -u the step dies
with arr[@]: unbound variable. That reached a real lane: about two dozen tests
EXTRACT a run: block and execute it with the host bash, so the macOS suite
runs this shell under 3.2, and seven test_pr_readiness_evaluate tests went red
in the 2026-09-23 nightly (run 35825517502).

#13125 has 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 waiting
to 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. #13202 has meanwhile landed
the 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/workflows is now
${arr[@]+"${arr[@]}"}, which expands to nothing for an unset or empty array and
to 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.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 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.md gains a short
subsection 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 bash
4.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 every run: block
    in .github/workflows and 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:

  • Built bash 3.2.57 and confirmed the behaviour directly — "${a[@]}" on an empty
    array under set -u fails, ${#a[@]} does not, and ${a[@]+"${a[@]}"}
    succeeds while keeping "one two" as one word.
  • With that bash first on PATH, test_pr_readiness_evaluate.py reproduced
    exactly the same seven failures as the macOS shard, at the same line.
  • All 28 test files that execute workflow shell: 3479 passed under bash 3.2.
  • All 523 workflow run: blocks syntax-check clean under both 3.2.57 and
    5.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: #13072 tracked the readiness half and #13125 closed it.

Pattern harvest

Rule candidate: lint
Pattern: array expanded as "${a[@]}" under set -u in a script a test executes
on a host whose bash predates 4.4

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and iamwhatever September 23, 2026 07:55
@bolichen97

Copy link
Copy Markdown
Contributor Author

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.
Not a goal: Changing how readiness evaluates, how the PDF extractor bounds memory, or giving macOS a kernel address-space ceiling it does not have. The workflow rewrite is mechanical and a no-op on the bash Actions runs.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 23, 2026
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 12bca57c6c6d742e63a47feb2b5e010da4e72b11 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] 12bca57

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

Premise-level review of 12bca57c6c6d742e63a47feb2b5e010da4e72b11 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Nothing to check. The nightly failure is linked (run 35825517502), the class fix is complete — I grepped \$\{\w+\[[@*]\]\} across .github/workflows/ and every remaining value-expansion carries the safe + form, zero unfixed siblings — and the pin sits at cause level (the description shows the guarded array regressed once already, so a form-local pin, not a reachability argument, is the right depth). The extraction lane is real: test/test_pr_readiness_evaluate.py exists among 7 test files matching the run-block-extraction pattern, and per-class workflow sweep tests are this repo's established mechanism (I counted 20 files globbing .github/workflows/*.yml in test/, e.g. test_workflow_secret_and_cache_scope.py, test_node_version_pins.py), so the new sweep file duplicates nothing. The docs edit rides in the same commit as the convention it documents, which AGENTS.md mandates.

What this change ships

Inventory (3 items) — 3 justified

Intent: FIX — stop workflow steps from dying under bash 3.2 (set -u, empty array) when tests execute their run: blocks on macOS's /bin/bash.

  1. All 46 remaining workflow array expansions rewritten to the empty-safe + form; identical behavior on Actions runners — justified
  2. New sweep test fails CI on any future unsafe array expansion in a workflow, with positive controls both directions — justified
  3. docs/ci/ci-and-reviews.md gains a subsection telling authors which form to write — justified

[FIRST-PRINCIPLES-REVIEWED] 12bca57

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 12bca57c6c6d742e63a47feb2b5e010da4e72b11 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 12bca57

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 12bca57c6c6d742e63a47feb2b5e010da4e72b11: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- 🟡 CONCERNS

Which legitimate operations does 12bca57c6c6d742e63a47feb2b5e010da4e72b11 newly refuse? Updated in place on each push. A script-confirmed regression blocks; the model proposes candidates and never decides a refusal.

Verdict basis: the reviewer's own judgement; no confirmed regression.

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 8 classified, 0 newly refused, 8 still allowed.
  • ubuntu-latest (platform posix): 8 classified, 0 newly refused, 8 still allowed.
  • windows-latest (platform windows): 2 classified, 0 newly refused, 2 still allowed.

No candidate flipped from allowed to refused.

Scope-Verdict: CONCERNS

TIGHTENING: a new pytest pin, test/test_workflow_array_expansion_bash32.py::test_no_workflow_expands_an_array_in_a_form_bash_32_rejects, which regex-sweeps every run: block in .github/workflows/*.yml and fails CI on any remaining quoted array value expansion — the refused shape is _UNSAFE = re.compile(r"(?<!\$\{#)\$\{([A-Za-z_]\w*)\[([@*])\]\}"), i.e. "${a[@]}" / "${a[*]}", the form that aborts with a[@]: unbound variable under bash 3.2 + set -u when the array is empty (the threat named in the hunk: "turning the deliberately non-terminal 'could not be evaluated' verdict into the red check it exists to prevent"). The accompanying workflow edits ("${arr[@]}" → ${arr[@]+"${arr[@]}"}) are, from this lane's direction, a loosening — scripts that used to abort on an empty array now expand to zero words. No tier of the tool-call deny composite (path fence, sensitive-command tier, exfiltration shapes, rule catalog) and no file under src/kiro_crew/ is touched by this diff, and golden-paths.json is unmodified.

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 ${a[@]+"${a[@]}"} brace idiom as a literal argv (the two bash -c rows the new test executes via subprocess — the spelling most likely to pattern-match an obfuscation or exfil-shape rule if one existed), and the touched area's daily operations (the local and leaf-CI pytest invocations of the new pin, the review-surface git diff, the scope_candidates.py verdict fold, the vitest shard, the release installer find). No confirmed rows were handed back, and no unhanded verdict is claimed as a finding.

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 /bin/bash 3.2 vs Linux bash ≥ 4.4) and those commands are what the extraction tests and maintainers run on the POSIX hosts where the split bites; one windows row for the sweep's pytest spelling (.venv\Scripts\python.exe -m pytest test\...), because the text-scanning half of the new file runs on Windows while its bash-executing checks self-skip via os.name == "nt"; any for the pathless npx vitest shard. One assumed platform behavior I could not express as a candidate: the diff's handling of Windows' System32\bash.exe WSL launcher is a skip predicate inside the test, not a command line, so no row can probe it. Per-leg verdicts are the deterministic fold's to report, after this review is captured.

UNADJUDICATED: the tightening itself. Guard: the pytest sweep in test/test_workflow_array_expansion_bash32.py. Call path: CI (and any local pytest run) collects the module → _run_blocks parses every .github/workflows/*.yml with yaml.safe_load and yields each run: string → unsafe_sites strips ${{ }} expressions, whole-line comments, and the _SAFE_FULL/_SAFE_TAIL forms, then any _UNSAFE match fails a required test — refusing the pull request that introduces (or retains) the form. The classifier settles shell command lines through the deny composite and settles nothing about a lint over workflow text, so no verdict on this guard is available. Candidate legitimate inputs I would have submitted:

  • a run: block with shell: pwsh or shell: cmd whose text happens to contain a ${arr[@]}-shaped string — _run_blocks yields every run: regardless of the step's shell: key, so a non-bash script is judged by a bash-3.2 rule;
  • a bash run: block that begins set +u (or never enables -u), where the quoted expansion is harmless — the pin refuses it anyway, deliberately per its docstring ("local to the expansion and needs no reasoning about reachability"), but that is a policy choice a future author hits with no adjudicated record;
  • a run: block written for a step that pins a modern bash (e.g. a container job), where the 3.2 concern cannot arise — same refusal, same rationale.
    These are refusals of repository edits, not of runtime operations, so their cost is a red check with a self-explaining message rather than a silently lost agent operation — which is why this is CONCERNS and not BLOCK.

[SCOPE-REVIEWED] 12bca57

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

Reviewed 12bca57c6c6d742e63a47feb2b5e010da4e72b11 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 12bca57

Verdict parsed from the review's SHA-scoped output markers for commit 12bca57c6c6d742e63a47feb2b5e010da4e72b11.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 12bca57c6c6d742e63a47feb2b5e010da4e72b11: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 23, 2026
@bolichen97
bolichen97 force-pushed the fix/nightly-macos-reds branch from fef0700 to bc78025 Compare September 23, 2026 08:23
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=48c8a830f4e5 — bash subprocess tests unguarded on Windows: fixed in bc78025.
    self-added: yes
    mechanism: needs_bash skipif on the three bash-executing checks; the static sweep stays unguarded

Fixed, and the class is real: conftest's _find_posix_test_shell exists precisely because a bare bash on Windows resolves to System32\bash.exe, and this file is not in test/windows-collect-ignore.txt, so it is collected there.
Correcting the record on the stated consequence: all 8 Backend Tests (Windows) shards on fef0700 completed/success, so the tests did not "fail red on every Windows shard". What is real is that they depended on PATH ordering on the runner, which a test asserting shell semantics should not.
Not taken: passing posix_test_shell as argv[0]. It resolves shutil.which("sh") on POSIX and is documented for "POSIX command-plumbing tests", while these assert a behaviour that differs BETWEEN BASH VERSIONS -- argv[0] has to be a bash, which that fixture cannot guarantee.
Guard scoped to the three bash-executing checks rather than a module pytestmark: the sweep is the pin, reads the workflow text and runs no shell, so it must keep running on Windows too. Verified with bash removed from PATH -- the three skip, the three sweep checks still pass.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in the restyle-ratchet baseline (18f9984 -> 21182a5, #13008), which clears the inherited Frontend Lint & Type Check red this PR was carrying and never caused; CI re-running.

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for bc78025e03ca50fbc7b6b113945ca8a571eda394; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt bc78025e03ca50fbc7b6b113945ca8a571eda394: <one-sentence reason>

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 23, 2026
@bolichen97
bolichen97 force-pushed the fix/nightly-macos-reds branch from bc78025 to 4fa41ec Compare September 23, 2026 09:13
@bolichen97

Copy link
Copy Markdown
Contributor Author

New head 4fa41ec29e with an identical tree (zero-diff amend of bc78025e03), and no code change is intended by it.

Why: the ~08:24Z GitHub App installation-token exhaustion (HTTP 403 API rate limit exceeded for installation, account-wide — #12832 and #12962 lost the same lane set in the same minute) made Security Scope Review publish failure for bc78025e03. The 08:49Z rerun then re-measured the head CLEAN: the fold step downloaded all three leg reports and its own verdict was success, with every upstream lane green (candidates 08:54Z, validation 08:56Z, the three adjudication legs 08:57–09:02Z).

It was still held, by design. Enforce the per-head monotonic floor reads every prior check-run for this lane on this head with filter=all and refuses to let a later success overwrite a harder prior — there is deliberately no infra-failure exemption, because that exemption is exactly how a resampled clean re-run would clear a confirmed regression. So no number of reruns can clear this head, and the step names the two remedies itself: re-measure and push, or a human override. This is the first of those.

Everything else on bc78025e03 was already settled: 0 failing checks besides that lane and the readiness rollup over it, Design PASS, First Principles PASS, GPT and Opus both stamped fresh with zero findings, 0 unresolved threads.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 4fa41ec29efd9e6d6a97ca6add87945f0fd77ade and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 4fa41ec

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 4fa41ec29efd9e6d6a97ca6add87945f0fd77ade: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 23, 2026
@bolichen97
bolichen97 force-pushed the fix/nightly-macos-reds branch from 4fa41ec to 4f0daf8 Compare September 23, 2026 10:18
@bolichen97

Copy link
Copy Markdown
Contributor Author

New head 4f0daf865b — same tree, rebased onto current main (2fdadc71ac). No code change is intended by it.

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: Security Scope Review at its per-head monotonic floor, Opus 5 Review at step 11 (Failed to check permissions for bolichen97: API rate limit exceeded for installation), and PR Readiness rolling those up. The floor is the one lane a rerun can never clear — it reads that head every prior verdict with filter=all and fails closed on a harder prior or an unreadable one — so the head had to be replaced, which also re-runs the other lanes for free.

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 test_pr_readiness_evaluate.py under a real bash 3.2.57 (88 passed), which is the reproduction this PR exists to fix.

For the record, the only non-infra red seen across those heads was Backend Tests (Windows) (7) at test/test_runtime_cleanup_windows.py::test_repeated_windows_provider_shutdown_reclaims_entire_tree ("owned processes still alive") — a process-cleanup timing flake in a file this PR does not touch.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 23, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=8a44380e2823 — a new author's first contact with the idiom should not be a red CI round-trip: fixed in de35eca.
    self-added: no
    mechanism: one subsection in docs/ci/ci-and-reviews.md under the macOS lane

Taken as written. docs/ci/ci-and-reviews.md now carries "Expand a bash array the + way, not the quoted way" under the macOS section, which is where the reason lives: macOS ships bash 3.2.57 as /bin/bash and about two dozen tests extract a run: block and execute it with the host bash, so that is the lane the form exists for.
It states the rule, why bash < 4.4 makes the quoted form fatal under set -u, that the + form is a no-op on the bash Actions actually uses, and why the pin does not accept a count guard -- the array that cost the nightly had one and was emptied after it.
Placed beside the macOS lane rather than in code-style.md on purpose: the convention is not a style preference, it is a consequence of which bash runs this shell.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 23, 2026
@bolichen97
bolichen97 force-pushed the fix/nightly-macos-reds branch from de35eca to 61f2547 Compare September 23, 2026 23:49
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in .github/workflows/ship-report.yml and test/test_workflows_startup.py since this head went green (a118ae7 -> f1f891b); CI re-running.

The previous head de35eca1db had reached readiness: passed with 97/97 and zero failures, GPT and Opus both stamped fresh, so this re-sync is about the base rather than about a red. The test_workflows_startup.py overlap was the one worth checking, since that test reads the workflow files this PR rewrites: main's version and the 43 rewritten expansions pass together locally (104 passed), so the overlap is green_age's conservative same-dir / test-stem flag, not a real interaction.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Sep 23, 2026
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 24, 2026
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.
@bolichen97
bolichen97 force-pushed the fix/nightly-macos-reds branch from 61f2547 to 12bca57 Compare September 24, 2026 06:37
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto main at 6af4ede4c4, and the scope is smaller for it.

#13202 landed the pdf half this PR carried -- the same detail = "rss" if sys.platform == "darwin" else "PdfminerException" split, with a fuller comment -- so test/test_pdf_extract.py conflicted and main's version is kept; that file is out of this diff entirely now. #13230 fixed the _bind_once("::1", 0) red that was blocking every CI wave here, by probing a plain AF_INET6 socket instead of trusting socket.has_ipv6.

What is left is the rest of the bash-3.2 class, which nobody else has touched: the 46 array value-expansions outside pr-readiness.yml (whose one line #13125 fixed), the pin that stops the next one being written the same way, and the docs/ci/ci-and-reviews.md subsection the Design lane asked for. Description rewritten to two items.

Verified on this head: 87 passed across the pin, the pdf tests and the dashboard startup tests; test_pr_readiness_evaluate.py 88 passed under a real bash 3.2.57, which is the reproduction this PR exists for.

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Sep 24, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Sep 24, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) September 24, 2026 07:33

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bolichen97
bolichen97 merged commit 02347d6 into main Sep 24, 2026
99 checks passed
@bolichen97
bolichen97 deleted the fix/nightly-macos-reds branch September 24, 2026 10:26
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 24, 2026
wknight1 pushed a commit to wknight1/KiroCrew that referenced this pull request Oct 5, 2026
…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>
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.

2 participants