Repository navigation
test(workflows): a job with a success() the scan cannot place is still named - #3577
Conversation
…l named scripts/workflow-needs.test.ts asked one question of two kinds of job: whether a condition decides when its job runs. A condition it could not read counted as deciding. That is the safe answer for the job before (the job behind it is then named), and the wrong one for the job itself: (success() && x), (a) && (success()) and success() && a || success() && b were left out although GitHub skips those jobs behind a skipped one. The two questions are now asked apart. The job before may run after a skipped one unless success() is a part its whole condition joins with &&. The job itself says when it runs only if it calls a status function and no success() that is not negated. Both read the condition without what it quotes: a status function named in a string is not called. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Local merge gate: PASS
The Linux suites of the required checks (Fast checks, Integration and browser), run on main 9ce7741 with this PR's head 120f773 merged in (local merge 505a9deb387d, not pushed), as groups side by side in the self-hosted CI runner image on
Reruns:
Total 598s. |
Merge passMerged head
One reviewer: owner's test-only PR: one test file. Test-only (scripts/workflow-needs.test.ts): one reviewer (Codex Terra), CLEAR; one LOW (an OR branch that bypasses success() is reported as a skipped job: a false alarm, never a miss). |
Why
Follow-up to #3554, from the merge pass's review of it.
scripts/workflow-needs.test.tsfinds jobs that GitHub skips behind a job that ran (thebeta.ymlbug). It asked one question, "does this condition decide when its job runs", of two kinds of job, and answered yes for any condition it could not read.(success() && x),(a) && (success())andsuccess() && a || success() && bcounted as deciding, so those jobs were left out, although GitHub skips each of them behind a skipped job.It also read a status function named inside a string (
contains(…, 'always()')) as a call.No workflow has such a condition today; the list of real findings is unchanged (
windows-app.yml: attach, the known exception).What
The two questions are asked apart, each so that a condition it cannot read names a job rather than misses one:
mayRunAfterSkipped(the job before): a status function in the condition, unlesssuccess()is one of the parts the whole condition joins with&&.saysWhenItRuns(the job itself): a status function in the condition, and nosuccess()that is not negated, however it is bracketed or joined.Both read the condition without what it quotes.
Validation
bun test scripts/workflow-needs.test.ts: 3 pass. With one rule used for both roles again, or with quoted text left in, the new cases fail.bun run check fast: pass on this head (14503 unit tests pass, 0 fail).🤖 Generated with Claude Code