ci: keep the create-sei smoke green on Version Packages branches - #346
Conversation
`changeset status` refuses to report on a branch that changes packages without adding a changeset, which is exactly what a Version Packages branch looks like after Changesets consumes every changeset and writes the bumped manifests. It exits before writing `--output`, so the release smoke failed while computing pending release metadata and never reached the versions it exists to validate. Only require the status report while changesets are still waiting to be released, and otherwise treat the consumed state as an empty release plan so the smoke validates the already-bumped manifests. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #346 +/- ##
=======================================
Coverage 97.17% 97.17%
=======================================
Files 80 80
Lines 5410 5410
=======================================
Hits 5257 5257
Misses 153 153
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
A well-scoped CI-only fix that correctly unblocks the create-sei smoke on Version Packages branches while leaving the pre-release path fatal and unchanged. One non-blocking robustness gap: once changesets are consumed, any changeset status failure — not just the expected lint error — is swallowed and replaced with an empty release plan.
Findings: 0 blocking | 4 non-blocking | 1 posted inline
Blockers
- None at the file/PR level.
Non-blocking
- The Cursor second-opinion pass produced no output (
cursor-review.mdis empty), so this review merges only my findings with Codex's. - No test covers
computePendingReleasePlanitself — only thehasPendingChangesetspredicate. The interesting behaviour (fatal vs. tolerated exit, and the empty-plan fallback) is untested. Not worth spawning a realchangesetprocess for, but injecting therun/readdirdependencies would make the tolerated-failure branch assertable. - Omitting a changeset is correct here per guideline §3 — this touches only the CI harness and nothing in the published
dist. - 1 suggestion(s)/nit(s) flagged inline on specific lines.
| repositoryRoot, | ||
| changesetsPending | ||
| ); | ||
| if (exitCode !== 0) { |
There was a problem hiding this comment.
[suggestion] Once .changeset is consumed, this treats every nonzero exit as the expected Version Packages condition. A malformed config.json, an unknown package reference, a missing changeset binary, or any runtime crash all produce the same message and an invented { releases: [] } — which then routes selectPrecompilesSource to the current-manifest basis and lets the smoke pass. Since this is exactly the branch state the fix exists to make green, a genuine regression here would stay invisible.
Consider narrowing the suppression to the specific failure. capture() is already available above, so you could match the known lint error rather than the exit code:
const { exitCode, stderr } = await capture([...], repositoryRoot);
if (exitCode !== 0) {
if (changesetsPending || !/no changesets were found/i.test(stderr)) {
throw new Error(`Compute pending release metadata failed with exit code ${exitCode}`);
}
console.log('Every changeset has already been consumed, so the error above is expected and no release is pending.');
return { releases: [] };
}That keeps fatal semantics honest while still tolerating the one state you intend to tolerate. (Also raised by Codex as P2.)
Summary
The
Generated apps (auto)check fails on every Version Packages release PR (run on #339). The release smoke callschangeset status --outputto learn which version@sei-js/precompileswill publish as, butchangeset statusdoubles as a lint: when a branch changes packages without adding a changeset it printsand calls
process.exit(1)before writing the--outputfile. A Version Packages branch is precisely that state — Changesets consumes every changeset while it writes the bumped manifests — so the smoke died atCompute pending release metadataand never reached the versions it exists to validate.The script already knows how to handle a versioned branch:
selectPrecompilesSourcehas acurrent-manifestbasis for exactly this case. It just could not get there.changeset statusstill runs unconditionally, and its output stays authoritative whenever it succeeds, so genuine failures (malformed changesets, unknown packages) remain fatal while changesets are pending.dist(same as ci: harden package release preparation #338).Test plan
changeset versionon top ofmainto mirror the release PR (@sei-js/precompiles2.1.3 → 3.0.0,.changesetreduced toREADME.md+config.json), then confirmedchangeset status --outputexits 1 and writes no file.current-manifestbasis, packs@sei-js/precompiles@3.0.0without retagging, and passes both variants through install, audit, Biome, the Next production build, and the runtime/brand-asset probes —create-sei local smoke passed for base and precompiles variants at @sei-js/precompiles@3.0.0.main, wherechangeset statusstill succeeds and reports the pending@sei-js/precompiles@3.0.0bump that the template pins.bun run checkandbun test --isolate srcinpackages/create-sei(17 pass), including two new tests covering the.changesetscan.Made with Cursor