Repository navigation
ci(release): rebuild the ncc bundle in prepare-release-extension.yml - #158
Conversation
Replace the devkit-seeded no-op with the use case its own header names: resolve the devkit toolchain, run `just sync && just bundle` on the freshly cut release/X.Y.Z, and commit dist/ when it differs. The pipeline only verified before. release-extension.yml's verify-dist rebuilds at finalize and fails the release, telling a human to run `just bundle` -- a gate with no actuator -- while dist-check.yml deliberately leaves dev ungated so Renovate runtime-dep bumps do not fail there. Nothing rebundled after lock-file maintenance, so every cut inherited a stale bundle and needed a hand-written rebuild commit first. Building here makes it build-then-verify: this job produces the bundle at cut time and verify-dist becomes a real backstop rather than the only gate. dist-check.yml triggers are unchanged. Drift is read from `git status` rather than a walk of dist/, so the gitignored declaration byproducts under dist/src/ stay untracked, and the commit is made through vig-os/commit-action at its last released tag rather than the possibly-stale local bundle. Refs: #157
…esis devkit 1.12.0 replaced the per-PR Renovate changelog pipeline with release-time `synthesize-bot-changelog` (vig-os/devkit#1423), which enumerates merged bot PRs since the last stable tag and regenerates a `#### Dependencies` block coalesced to the net delta per dependency. The hand-written entry predates that switch, and the synthesizer never touches hand-written entries -- so v0.3.3 would have listed the same bumps twice. Nothing is lost: a dry run of the synthesizer on this branch cites #138 for both its bumps, at their net deltas (eslint 10.8.0 -> 10.10.0, tsx 4.23.7 -> 4.23.13) rather than the intermediate versions that never shipped. Refs: #157
CodeQL alert #32 — dismissed as won't-fix
This is the same construct as #30 / #31 in
One difference from #30/#31, stated rather than papered over: unlike read-only No clean code fix exists. Resolving the toolchain from any ref other than Residual risk accepted. |
Description
Replaces the devkit-seeded no-op in
prepare-release-extension.ymlwith the use case its own header names: resolve the devkit toolchain, runjust sync && just bundleon the freshly cutrelease/X.Y.Z, and commitdist/when it differs.The release pipeline only ever verified the bundle.
release-extension.yml'sverify-distrebuilds at finalize and fails the release, telling a human to go runjust bundle— a gate with no actuator — whiledist-check.ymldeliberately leavesdevungated so Renovate runtime-dep bumps do not fail there (#71). Nothing rebundles after lock-file maintenance, so every cut inherited a stale bundle and needed a hand-written rebuild commit first. That is #130, and it had accrued again by #157.Building here makes the pipeline build-then-verify: this job produces the bundle at cut time, and
verify-distbecomes a genuine backstop rather than the only gate.Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)ci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
.github/workflows/prepare-release-extension.yml(+157/-22)resolve-toolchainjob — self-resolves delivery mode and image from.vig-osatinputs.branch_sha, mirroringrelease-extension.ymlandci.yml, because toolchain inputs are not part of theworkflow_callcontract.bundlejob — mints the COMMIT_APP token scoped topermission-contents: write, checks outbranch_shawithpersist-credentials: false, runsjust syncthenjust bundle.git status --porcelain -- dist/rather than walking thedist/directory, so the gitignored declaration byproducts underdist/src/stay untracked — force-adding a bare directory walk is the release-core finalize commits the whole dist/ (force-includes gitignored tsc emit), re-tracking dist/src + *.tsbuildinfo every release devkit#1159 bug that chore(dist): untrack the gitignored dist/src byproducts left by the v0.3.0 finalize commit #134 had to clean up.dry_runis honored on the only write (the call site already skips the whole workflow on a dry run, but the extension contract requires it).vig-os/[email protected]— the last released tag, not the possibly-stale local bundle this job exists to refresh.chore(dist): ...:.vig-osleavesDEVKIT_REFS_POLICYempty →chore-optional, so every type butchoreneeds aRefs:line and a bot rebuild has none to cite.git_user_name/git_user_emailare kept in the input contract but unused — the commit goes over the API, authored by the release App and signed by GitHub.CHANGELOG.md— adds the entry under## Unreleased→### Changed, and removes thehand-written
**Renovate dependency update** (#138)entry (see below).Not touched:
release-extension.yml(still verifies at finalize) anddist-check.yml(triggers unchanged,devstays ungated).Changelog Entry
Changed
prepare-release-extension.yml— the devkit-seeded, consumer-owned no-op whose header names exactly this use case — now resolves the devkit toolchain, runsjust sync && just bundleon the freshly cutrelease/X.Y.Z, and commitsdist/when it differs. It runs after the branch is fast-forwarded onto the changelog freeze and beforeopen-pr, so the refreshed bundle is in the release PR diff from its first CI run andDist Checkvalidates it;rollbackalready listsextensionin itsneeds, so a failed rebuild deletes the branch and takes the commit with it.release-extension.yml's finalize-timeverify-distis untouched and becomes a genuine backstop rather than the only gate, anddist-check.ymltriggers are unchanged sodevstays ungated (#71). This removes the recurring manual rebuild that #130 fixed once by hand and that had accrued again: six lock-file-maintenance PRs moved@octokit/core,@octokit/request,@octokit/endpoint,@octokit/request-error,@octokit/graphql,content-typeandundici— all runtime transitives thatnccinlines — while the committed bundle stood still.(Full entry as committed in
CHANGELOG.md.)Also removed from
## Unreleased, in a separate commit:It predates devkit 1.12.0's release-time
synthesize-bot-changelog(vig-os/devkit#1423), which never touches hand-written entries — so v0.3.3 would have listed those bumps twice. Nothing is lost: a dry run of the synthesizer on this branch cites #138 for both its bumps, at their net deltas (eslint10.8.0 → 10.10.0,tsx4.23.7 → 4.23.13) rather than the intermediate versions that never shipped.Testing
just test)Manual Testing Details
The workflow itself cannot run until a release is cut, so the evidence is for the premise and the statics:
npm ci && npm run bundlefrom the current lock, in a scratch checkout, producesdist/index.jsat 1 295 957 bytes /faf8100f…against the committed 1 295 769 bytes /625a5ee6…— different SHA-256, one fewer webpack chunk (content-type3.x inlines differently), and the inlined@octokit/core/@octokit/requestVERSIONconstants move.npm auditreports 0 vulnerabilities on both thev0.3.2lock and the current one, with and without dev dependencies.synthesize-bot-changelog --dry-runon this branch renders a#### Dependenciesblock covering all six lock-maintenance PRs, all four devkit adoptions, and every dev-dep bump — including both of the deleted build(npm): update npm dev dependencies #138 entry's bumps.actionlintclean on the new workflow; fullprek run --all-filesgreen (yamllint, pymarkdown, shellcheck, typos, commit-message validation).Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
rollback→needs: extensionwiring and costs nothing but a re-run.release/X.Y.Zafter prepare can restale the bundle;Dist Checktriggers on pull requests intorelease/**, andverify-distremains the final net.release-core.yml's finalize pushes (changelog date stamp,synthesize-bot-changelog, the sync-issues commit) touch no source or lock file, so a bundle built at prepare time is still fresh at finalize.dev'sdist/stays stale between releases, refreshed whensync-main-to-devbrings the release commit back. That is already true today, and consumers run tags rather thandevSHAs.Refs: #157