ci: fail when committed dist is stale - #1
Merged
Merged
Conversation
Consumers install this package from a commit tarball, which runs no build step — they execute the dist/ committed here. npm run check rebuilds dist but never asserts the result matches what is checked in, so a change that edits source without rebuilding stays green and silently ships a stale artifact to every pinned consumer. The check runs after npm run check so the rebuild has already happened; one matrix leg is enough because the build output does not vary by Node major.
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.
Why
Both consumers install this package straight from a commit tarball:
A tarball dependency runs no build step, and there is no
preparescript — so ClawRouter and Franklin execute thedist/that is committed to this repo.npm run check(typecheck && test && build) rebuildsdist/, but nothing asserts the rebuild matches what is checked in. A PR that edits a.tswithout rebuilding passes CI green and silently ships a stale artifact to every pinned consumer. Source and shipped behavior can diverge with no signal.dist/is in sync as of6a790eb— this adds the guard before that stops being true by accident.What
One step after
npm run check, so the rebuild has already run:Gated to a single matrix leg — the build output does not vary by Node major, so running it twice only doubles the noise on failure.
Verification
npm run checkthen the guard → passes.tool-intent.ts, leftdist/untouched): afternpm run checkrebuilds,git diff --exit-code -- distexits non-zero → CI fails, as intended.npm run checkis load-bearing, hence the comment in the workflow.