chore(ci): per-PR runner reductions — merge test+checks, job-level gating, draft skips, one-runner previews#8017
Merged
Conversation
…ui at job level, draft skips, one-runner same-repo previews This repo's Validate fan-out (5 jobs/PR, two of them 30-minute-class with duplicate npm ci + full builds) plus ~100 preview builds/week was the largest consumer of the account's shared 20-concurrent-job pool (observed: a 40+-deep starved queue that froze the sibling repo's release automation for hours). Mirrors JSONbored/loopover's same-day reductions: - test + checks merge into ONE job: one npm ci + one build now serves the suite AND the ~20 validators. Step order is load-bearing and documented: contract drift before the build, derived-artifact freshness after the build and before the suite (whose writers mutate staging trees), suite + coverage last. Docs fast lane + narrow validator skips preserved as per-step guards. - python is path-gated at the JOB level on new changes.run_python_validation (its hermetic suite reads only python/**) -- job-level skips are safe: main has ZERO required status contexts and fetchLiveCiAggregate buckets skipped as success. - ui's per-step guard pattern becomes a job-level if for the same reason -- a backend PR no longer boots a runner to evaluate ~18 false guards. - Draft PRs now skip every heavy job (types list gains ready_for_review so marking ready triggers a real run). - Same-repo UI PRs build AND deploy their preview in one runner via the new shared .github/actions/deploy-ui-preview composite; ui-preview-deploy.yml is fork-only (head_repository comparison skips it runner-free otherwise). The fork trust boundary is untouched. Per-PR floor drops 5 -> 2 jobs for a typical backend PR (changes + the merged test), UI PRs 7 -> 4, python-only PRs keep their fast lane. validate:workflows (22 files), pipeline-validator-parity, actionlint, and prettier all green.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8017 +/- ##
=======================================
Coverage 97.61% 97.61%
=======================================
Files 215 215
Lines 26898 26898
Branches 10649 10649
=======================================
Hits 26257 26257
Misses 150 150
Partials 491 491 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This repo's Validate fan-out (5 jobs per PR, two of them 30-minute-class each running their own
npm ci+ full build) plus ~100 preview builds/week made it the largest consumer of the account's shared 20-concurrent-job pool (observed today: a 40+-deep starved queue that froze the sibling repo's release automation for hours). Same-day mirror of JSONbored/loopover#8523.1.
test+checksmerge into one job. One npm ci + one build serves the suite and the ~20 validators. The old split bought wall-clock (max instead of sum) at the cost of a second heavy runner on every PR — at current volume the pool, not wall-clock, is the binding constraint. Step order is load-bearing and documented in place: contract-drift validators before the build (they compare committed files the build overwrites), derived-artifact freshness after the build and before the suite (whose artifact writers mutate staging trees), suite + Codecov last. The docs fast lane and the narrow workflows/migrations skips survive unchanged as per-step guards (the suite half must run even on docs-only diffs — coverage is repo-wide).2.
pythonis path-gated at the job level on a newchanges.run_python_validationflag (^python/— its hermetic suite reads nothing else). Job-level skips are safe here and this is now documented where the old hedge was: main has zero required status contexts (verified viabranches/main/protection) andfetchLiveCiAggregatebuckets skipped identically to success.3.
ui's per-step guard pattern becomes a job-leveliffor the same reason — a backend PR no longer boots a full runner just to check out and evaluate ~18 false guards.4. Draft PRs skip every heavy job (and the
typeslist gainsready_for_review, so marking ready triggers a real run — mirrors ui-preview.yml's existing list).5. Same-repo UI PRs deploy their preview in ONE runner via the new shared
.github/actions/deploy-ui-previewcomposite;ui-preview-deploy.ymlbecomes fork-only, skipping runner-free for same-repo builds via thehead_repositorycomparison. The fork trust boundary (secretless build → trusted workflow_run deploy, artifact validation, trusted-config-only wrangler) is preserved byte-for-byte inside the composite.Net: a typical backend PR drops 5 → 2 jobs (changes + merged test), UI PRs 7 → 4, python-only PRs keep a fast lane.
Validation
npm run validate:workflows(22 files) green;tests/pipeline-validator-parity.test.tsgreen (the merged job invokes the identicalnpm run validate:*set);actionlintclean on all touched files; Prettier clean. The merged job's first live run on this PR is the end-to-end proof of the step ordering.