Skip to content

test(workflows): a job with a success() the scan cannot place is still named - #3577

Merged
devswha merged 1 commit into
mainfrom
test/workflow-needs-unreadable
Nov 10, 2026
Merged

devswha merged 1 commit into
mainfrom
test/workflow-needs-unreadable

Conversation

@devswha

@devswha devswha commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Why

Follow-up to #3554, from the merge pass's review of it. scripts/workflow-needs.test.ts finds jobs that GitHub skips behind a job that ran (the beta.yml bug). 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.

  • For the job before, that is the safe answer: the job behind it is named.
  • For the job itself, it is the wrong one: (success() && x), (a) && (success()) and success() && a || success() && b counted 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, unless success() is one of the parts the whole condition joins with &&.
  • saysWhenItRuns (the job itself): a status function in the condition, and no success() 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).
  • Skipped: integration and browser suites (one test file, no workflow or product code).

🤖 Generated with Claude Code

…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]>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Expanded workflow-condition checks to cover bracketed and disjunctive success() expressions, status-function text inside quoted strings, and escaped apostrophes.
    • Added checks for dependency chains involving jobs that may run after a skipped job.

The workflow-needs check now analyzes job conditions with separate status-function checks. It normalizes expressions, treats top-level disjunctions and unbalanced brackets as unreadable, and evaluates dependency chains using the new checks. Tests cover additional expression cases.

Changes: Workflow condition analysis

Layer / File(s) Summary
Normalize and classify job conditions
scripts/workflow-needs.test.ts
Expression analysis strips wrappers and quoted strings. Separate checks determine whether a condition may run after a skipped job and whether it states when it runs.
Apply condition checks to dependency chains
scripts/workflow-needs.test.ts
Dependency-chain evaluation uses the separate checks. Tests cover bracketed and disjunctive success() conditions, status-function text in quoted strings, and escaped apostrophes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related PRs

Suggested labels: github_actions

Merge Risk: Minimal · up to 120f7

No merge-blocking issue is established for the workflow-condition change; it is ready to merge after normal checks.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly identifies the workflow test change: jobs with a success() condition the scan cannot interpret are still named.
Description check Passed The description explains the problem and resulting behavior, and reports validation commands, results, and skipped suites. Its “Why” and “What” sections cover the template’s required change informatio…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the problem and resulting behavior, and reports validation commands, results, and skipped suites. Its “Why” and “What” sections cover the template’s required change information.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 1 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5b3721f and 120f773.

Files selected for processing: 1

  • scripts/workflow-needs.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 0 remain after this review.

@devswha

devswha commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

Local merge gate: PASS

Local merge gate: PASS #3577 merge=505a9deb387d head=120f7737c2ea main=9ce77415aad9 on herdr-ci-runner:local on devswha-ThinkStation-P620 CPUs 64-127 in 598s, reruns=1

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 herdr-ci-runner:local on devswha-ThinkStation-P620 CPUs 64-127 (10% busy before the start, host load 50.88; shards=4 unit_workers=8 browser_main_workers=2 browser_other_workers=16). Scope: full. Native Windows install and the macOS checks are not part of this gate.

Step Command Result Seconds Counts
fast-install bun install --frozen-lockfile pass 0 -
release-guards bun scripts/release-guards.ts --base 9ce77415aad9 pass 0 -
fast bun run check fast pass 215 tests 14645 pass / 0 fail; check steps 6 ok / 0 failed
integration-install bun install --frozen-lockfile pass 0 -
integration bun run check integration pass 228 tests 1386 pass / 0 fail; check steps 3 ok / 0 failed
browser-main-install bun install --frozen-lockfile pass 0 -
browser-main-build bun run build pass 15 -
browser-main BROWSER_SCRIPTS=ui-regression,ui-contexts-regression bun run check run -- bun scripts/ci-browser-parallel.ts pass 386 browser scripts 2/2 passed
browser-other-install bun install --frozen-lockfile pass 0 -
browser-other-build bun run build && bun run build:shell pass 21 -
browser-other BROWSER_EXCLUDE=<those two> bun run check run -- bun scripts/ci-browser-parallel.ts pass 566 browser scripts 200/200 passed

Reruns:

  • browser scripts/relay-e2e-regression.ts failed, then passed on its automatic second run

Total 598s.

@devswha
devswha merged commit 6dd2e3e into main Nov 10, 2026
15 checks passed
@devswha

devswha commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head 120f7737c2ea as 6dd2e3e6a998 on the local merge gate, with no unresolved review threads.

Reviewer Verdict Note
codex CLEAR

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).

@devswha
devswha deleted the test/workflow-needs-unreadable branch November 10, 2026 11:06
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