fix(ci): opt the release publish step out of the prepare hook so the shipped dist/ is the validated one - #505
Merged
KnockOutEZ merged 1 commit intoAug 27, 2026
Conversation
`npm publish` packs, and packing runs the root `prepare` hook. The release leg therefore lints, tests, builds an explicit `dist/`, verifies the tag — and then `npm publish` fires `scripts/prepare-build.mjs`, which rebuilds `dist/` from scratch. The artifact that reached the registry was the hook's build, produced after every gate had validated a different one, and a build that flaked at that point failed the release at publish with everything green behind it. Add `WIGOLO_SKIP_PREPARE: '1'` to the root `Publish wigolo (npm)` step and correct the install step's comment, which claimed the explicit build was the published one. The sub-package publishes run from their own `working-directory`, so the root hook never fired for them and they are left alone. Pin it with a new enumeration arm over the pack-shaped register — `npm publish` and `npm pack` at the repo root, across every workflow. This is the register the existing install sweep's `ci|pack|install` alternation could not see. A control arm asserts the two sub-package publishes stay off-root and unguarded.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
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.
Closes KnockOutEZ/wigolo-studio-run#171.
The defect
release.yml's rootPublish wigolo (npm)step rannpm publishwith noWIGOLO_SKIP_PREPARE.npm publishpacks, and packing runsprepare. So therelease leg lints, tests, builds an explicit
dist/, verifies the tag againstpackage.json— and thennpm publishfiresscripts/prepare-build.mjs, whichrebuilds
dist/from scratch.The artifact that actually shipped was the hook's build, produced after every gate
validated a different one. And a build that flakes at that point fails the release at
publish, with all gates already green behind it. The install step's own comment ("The
explicit build below is the one that produces the published dist/") was false as written.
#169 swept the install legs; publish is the one hook-firing leg that sweep's
npm ci|pack|installregister cannot see.The fix
WIGOLO_SKIP_PREPARE: '1'on the rootPublish wigolo (npm)step env. The hook honorsit at
scripts/prepare-build.mjs:43.leg need the opt-out, and what shipping the publish-time build would mean.
Create GitHub Releaseusesgh release create, andthe Smithery step uses
mcpb pack, neither of which invokes npm's lifecycle. Thesub-package publishes at
:145/:159run from their ownworking-directory, so theroot hook never fired for them; per the issue's non-goals they keep their own hooks.
The pin
A new
describeintests/unit/prepare-build.test.tsenumerating the pack-shapedregister —
npm publish/npm packat the repo root, across every workflow — in thesame YAML-parse style as the existing install-leg arms. Four arms: the step set, the
suppression rule, an off-root control, and a pin that the explicit build still precedes
the publish (the opt-out is only safe because it does).
The shared
steps()YAML walker was hoisted to module scope so both registers use it;its behaviour is unchanged.
Red → green
Red on tip — one arm, naming the exact step:
Green with the fix:
Note the 16 already-passing arms: the existing enumeration arms are undisturbed — adding
an
env:key cannot change which steps arun:-text regex matches.Suites
Non-goals held
What
preparedoes is unchanged. Sub-package publish hook behaviour is unchanged. Norelease or publish is performed — main + npm move at PX2.