Repository navigation
Share PR preflight setup to reduce runner demand - #25150
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 25 seconds. View limit detailsLimit details: You’ve used all 10 included reviews currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (13)
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. Comment |
There was a problem hiding this comment.
ℹ️ Minor suggestions only — no blocking issues found. The combined gate wiring traces correctly; the notes below are a test-coverage gap and stale references.
Reviewed changes
- Combined
preflightjob — the formerstatic_analysisandtypecheckjobs are oneubuntu-24.04-armjob sharing a single checkout and Node 24 install. - Serialized phases — static checks and every static background join run before
pnpm run typecheck; unit planning still overlaps compilation, andpreflight.outputs.shardsnow feedstest. - No-op phase guards — background steps use
if: '!cancelled()'plusPREFLIGHT_PHASE_SELECTED/PREFLIGHT_PRIOR_SUCCESSso an unselected or already-failed phase still registers a successfulwaitjoin. - Rewired consumers —
test/package/package_windows/verifygate onpreflight;verify'sPREFLIGHT_SHOULD_RUNmirrorspreflight.if. - Tests and docs — job-name renames across the workflow contract tests, new
pr-preflight-gatesassertions, and a newci-runner-efficiency.mdsection.
ℹ️ Nitpicks
config/scripts/pr-preflight-gates.test.mjs:88asserts only thatPREFLIGHT_PHASE_SELECTEDcontainsneeds.code_paths.outputs., not which classifier each guard uses; see the inline note.config/scripts/pr-preflight-gates.test.mjs:30relaxedplan.runfromtoBetotoContain. An appended|| trueon line 2 would let a failing planner report success intopreflight.outputs.shardsand still pass this suite..github/workflows/pr.yml:164says the ARM choice is "same as the typecheck job" — that job no longer exists.config/scripts/check-readme-local-links.test.mjs:159likewise still namesstatic_analysis.docs/reference/ci-runner-efficiency.md:604still reads "Combining static analysis too was rejected," which the new section at:1898now contradicts. A one-line cross-reference noting the serialized (non-contended) arrangement supersedes the earlier rejection would save the next reader the search.- The
PREFLIGHT_PRIOR_SUCCESSguard is captured at step launch, so for the overlappinglocalization-extraction/localization-catalogspair the second step can still run if the first fails before it launches. The sharedwaitstill fails the job, so this is only a small amount of redundant work — not a correctness hole.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
| it('registers successful no-op background work when a phase is unselected or already failed', () => { | ||
| for (const step of steps.filter((step) => step.background)) { | ||
| expect(step.if).toBe('!cancelled()') | ||
| expect(step.env.PREFLIGHT_PHASE_SELECTED).toContain('needs.code_paths.outputs.') |
There was a problem hiding this comment.
This assertion pins only the needs.code_paths.outputs. prefix, so it cannot tell which classifier each background step consumes. Swapping static_analysis↔typecheck on any guard (e.g. Lint) would silently no-op that check on a mobile-only PR while this suite stays green, and the non-background gated steps (pr.yml:213,230,254,260,…) have no phase assertion at all.
Technical details
# Pin each guard's phase expression
## Affected sites
- config/scripts/pr-preflight-gates.test.mjs:88 — substring-only assertion over `PREFLIGHT_PHASE_SELECTED`
- .github/workflows/pr.yml:206,223,247,316,365 — these must evaluate `needs.code_paths.outputs.static_analysis == 'true'`
- .github/workflows/pr.yml:422 — `unit-plan` must evaluate `needs.code_paths.outputs.typecheck == 'true'`
- .github/workflows/pr.yml:213,230,254,260,264,268,272 — non-background gated steps, currently unasserted
## Required outcome
- Every phase-guarded step asserts its exact classifier expression (e.g. an `id`→phase map), so a swapped phase fails the suite.
## Open questions for the human
- Is the non-background phase coverage intentionally omitted, or worth pinning too?
ELI5
PR static analysis and typecheck share one runner. Three hosted pairs saved 19 active runner seconds at the median and reduced two heavy runner admissions to one.
What Changed
Keep the existing path flags, checks, compiler command, cache keys and unit plan. Run static checks and their joins before compilation, with planning still in the background. Register no-op background bodies for unselected or blocked phases. Gate unit tests and packaging on the complete preflight job result, including action cleanup.
Why
Concurrency is the constraint. Sharing checkout and dependency setup saves capacity. In these quiet-queue samples the dependency barrier was about 16 seconds later, so this does not claim a whole-PR speedup. It avoids another runner admission while keeping each check's log and failure gate.
Linked Issue
N/A — internal CI optimization.
Visual Proof
N/A — workflow wiring only.
Testing
Review
README/cloud/mobile phase routing remains explicit. The same Node 24 setup serves both phases. A static failure stops compilation, and a failed/cancelled physical job cannot admit downstream work even if it already published shard outputs.
Agent skill upstream boundary
Checklist