fix: hold bitgo back via committed private + --include-private - #9431
Conversation
✅ Alpha canary from this branch — end-to-end passDispatched Workflow (the EUNCOMMIT is gone):
Registry: Clean install (the WCI-1200 path): Observation, not a blocker: pass 2 published Scope note: this exercises |
The runtime manifest flip (set-umbrella-publishable.ts) left modules/bitgo/package.json modified but uncommitted, so `lerna publish from-package` aborted the siblings pass with EUNCOMMIT before publishing anything. Commit bitgo as `private` instead: `from-package` filters it out of pass 1, and pass 2 re-includes it by its on-disk name with `--include-private`, which strips `private` in-memory at pack time. Patch the three checks that skip private packages so they still cover the bitgo directory, and delete the flip script. Ticket: WCI-1271
557a99e to
90afaa0
Compare
Summary
bitgoumbrella out of the siblings pass by editingmodules/bitgo/package.jsonat runtime (set-umbrella-publishable.tstogglingprivate). That edit is never committed, andlerna publish from-packageruns an unconditional clean-tree pre-flight (detectFromPackage→verifyWorkingTreeClean→throwIfUncommitted,lerna/dist/commands/publish/index.js:8238-8248), so pass 1 aborts withEUNCOMMITbefore publishing anything. Master currently cannot cut a release — prod or beta. Beta run 31038353257 confirms it (M modules/bitgo/package.json).bitgoasprivateand hold it back the lerna-native way.from-packagefilters private packages before packing, so pass 1 publishes the siblings with a clean tree; pass 2 re-includes bitgo by name with--include-private, which stripsprivatein-memory after the clean-tree check (preparePrivatePackages, index.js:8343) and packs withBITGO_GENERATE_SHRINKWRAP=true. The published tarball carries noprivatefield.set-umbrella-publishable.tsand both hold-back/restore steps in both workflows.Why
--include-privatenow, when WCI-1270 rejected itWCI-1270 rejected
--include-privatebecause a permanently-private umbrella would silently drop out of three checks that enumerate non-private packages. The EUNCOMMIT failure is the new fact that flips the decision: the runtime flip is the only alternative and it fights lerna's clean-tree requirement. Committingprivateis the sole approach that doesn't, and the three checks are one-line patches (this PR) rather than blockers.npm contract, and the repo tooling that also reads
privatePer npm docs,
private: truedoes exactly one thing to npm — makesnpm publishrefuse (accidental-publication guard); it does not affectpack,install, or workspaces.express,beta-tools, andweb-demoare already private and build/link normally.lerna --include-privateis purpose-built to lift the publish block transiently at pack time. Bonus: a straynpm publishinmodules/bitgooutside the two-phase flow is now refused by npm.But this repo's own tooling also keys on
.private, beyond npm's contract, so making bitgo private has internal consequences that must be handled explicitly (see below).Sites that read
.private, patched to keep covering the umbrellaKeyed on the umbrella's directory/name (
prepare-release.tsrescopes the name, not the dir, so publish-side sites derive the name; internal sites matchbitgo):.github/actions/verify-npm-packages/index.js— package-level existence (HEAD on package root;bitgoexists, so this passes today).scripts/verify-release.ts— beta + recovery verification..github/workflows/npmjs-release.yml— recovery "verify missing versions".scripts/update-dockerfile.ts— functional, not just a check: it walks@bitgo/express's deps and emitsCOPY/yarn linklines only for non-private modules. express depends onbitgo, and the committed Dockerfile copies+linksmodules/bitgo. Left unpatched, marking bitgo private drops it from the express image. Patched to keep walking bitgo; verifiedyarn update-dockerfileproduces no Dockerfile diff.(One cosmetic
.privateread remains atnpmjs-release.ymlrecovery-context output — it only labels packages in a log line, no behavior change.)Sharp edge
--include-privatetakes the on-disk package name, which is channel-specific (bitgoon stable,@bitgo-beta/bitgoafterprepare-release.ts). Both workflows derive it withjq -r '.name' modules/bitgo/package.json; a hardcoded name would fail silently (umbrella never publishes).Test plan
recovery-mode: false): pass 1 publishes the siblings with bitgo excluded (noEUNCOMMIT); pass 2 attempts only the umbrella and generates the shrinkwrap.curl .../@bitgo-beta/bitgo/<v> | jq '._hasShrinkwrap'→true;npm install @bitgo-beta/bitgo@<v>+require()works in a clean dir.rel/latest;modules/bitgo/package.jsonis never left flipped.dry-run: false, recovery-mode: true) publishes the missing 52.4.2 with a correct shrinkwrap;npm install bitgo@52.4.2works in a clean dir.Ticket: WCN-1901