ci: local npm run gate == CI gate + stale-green guard#101
Conversation
The local gate must run EXACTLY what CI runs. Fix agents previously ran `vite build` alone, which skips `scripts/prerender.mjs` — a crashing prerender step shipped a broken main even though the local build passed. - package.json: new `gate` script = `tsc --noEmit && npm run build && vitest run`. `npm run build` already chains `tsc && vite build && node scripts/prerender.mjs` — the exact CI build-and-test sequence. One command an agent/dev runs locally that cannot pass while CI fails. - ci.yml: new `up-to-date-with-base` job fails the PR if its branch does not contain `origin/<base>` as an ancestor (git merge-base --is-ancestor). A stale-but-green PR now goes red, forcing an update-branch before merge instead of shipping a broken base. Verified: `npm run gate` runs clean locally (tsc + build + 662 tests). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7277018 to
764cbdb
Compare
|
Rebase attempt 2026-05-20 hit conflicts. Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com |
Status check 2026-05-20 — still adds valueAudit against current main (
Not replaced by INTEGRATION-TESTS-2026-05-20.md — that work targets api/worker/provisioner Go integration tests (backup/restore, Brevo webhook, propagation runner, deep /readyz). It does not touch instanode-web. Verified live: ran Mergeability: Recommendation: merge. PR holds up against current main; the value (local gate == CI gate + stale-green guard) is not duplicated by any other 2026-05-20 work. |
What
Hardens the instanode-web CI gate so the failure modes hit this session cannot recur.
1.
npm run gate— local gate == CI gateNew
gatescript inpackage.json:npm run buildalready chainstsc && vite build && node scripts/prerender.mjs— the exact sequence CI'sbuild-and-testjob runs. Fix agents previously ranvite buildalone, which skipsscripts/prerender.mjs; a crashing prerender step shipped a brokenmaineven though the local build passed.npm run gateis one command that cannot pass while CI fails.2. Stale-green guard
New
up-to-date-with-basejob inci.yml. A PR can show a green run executed before a breaking commit landed onmain— merging it would ship a broken base. This job runsgit merge-base --is-ancestor origin/<base> HEADand fails the PR if the branch is behind, forcing an "Update branch" before merge.Verification
npm run gateruns clean locally:tsc+ fullbuild(incl. prerender) + 662 vitest tests pass.Scope
Touches only
package.jsonand.github/workflows/ci.yml— disjoint from any source changes.🤖 Generated with Claude Code