ci: build the Docker image on pull requests, and assert what it ships (#384) - #391
ci: build the Docker image on pull requests, and assert what it ships (#384)#391dcccrypto wants to merge 1 commit into
Conversation
…#384) The docker job was gated behind `if: github.ref == 'refs/heads/main'`, so the image was only built AFTER merge. Image-build breakage passed PR review invisibly and landed on a red main. Not theoretical: the job failed on every push to main from 2026-06-22 to 2026-07-18 (~4 weeks) with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH, and the PR that introduced it could not have caught it — build-and-test passes in that scenario because actions/checkout supplies the whole repo while the docker build context is narrower. The two jobs disagree on exactly the thing that broke, and only the invisible one ran. The job only builds, never pushes to a registry, so running it on PRs needs no push-gating (the issue suggested `push: ${{ github.ref == ... }}`; there is no push step to gate). Also adds assertions on the built image. The Dockerfile's K-NEW-1 comment claims the runtime image excludes vitest, tsx, @types/* and their CVEs — nothing verified that, and a regression to a full install would still build green: - vitest / tsx / typescript / fast-check ABSENT - @solana/web3.js / @upstash/redis / p-queue / lru-cache PRESENT The second is the mirror check; an install that dropped real dependencies would satisfy the first on its own. Same fix and assertion pattern as percolator-indexer#185, where it is verified green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 4 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Closes #384.
The gap
The image was only built after merge, so image-build breakage passed PR review invisibly and landed on a red main.
Not theoretical — as the issue documents, the job failed on every push to main from 2026-06-22 to 2026-07-18 (~4 weeks) with
ERR_PNPM_LOCKFILE_CONFIG_MISMATCH. The PR that introduced it could not have caught it:build-and-testpasses in that scenario becauseactions/checkoutsupplies the whole repo while the docker build context is narrower. The two jobs disagree on exactly the thing that broke, and only the invisible one ran.On the suggested fix
The issue proposes
push: ${{ github.ref == 'refs/heads/main' }}to keep the registry push main-only. There is no push step — the job only runsdocker build. So ungating it is sufficient and nothing needs push-gating.Also: assert what the image actually ships
The Dockerfile's
K-NEW-1comment claims the runtime image excludes vitest, tsx,@types/*and their CVEs:Nothing verified that. A regression to a full install would still build green — the same "green job proves nothing" trap that let the 4-week breakage hide. So the job now asserts the outcome:
vitest/tsx/typescript/fast-checkabsent from/app/node_modules@solana/web3.js/@upstash/redis/p-queue/lru-cachepresentThe second is the mirror check: an install that dropped real dependencies would satisfy the first on its own.
Verification
Same fix and assertion pattern as percolator-indexer#185, where it is already green and I confirmed from the job log that the assertion steps actually executed rather than being skipped.
This PR is self-verifying the same way: for a same-repo
pull_requestGitHub uses the workflow from the PR branch, so if adockercheck appears below and passes, the change works — and the assertions tell you the image contents are right, not merely that it built.Note for reviewers: this touches only
.github/workflows/ci.yml, so it doesn't collide with any of the open PRs onliquidation.ts/oracle.ts/crank.ts.🤖 Generated with Claude Code