Skip to content

ci(dist): gate PRs and releases on a fresh dist/ bundle - #69

Merged
c-vigo merged 2 commits into
devfrom
feature/59-dist-freshness-gate
Jul 14, 2026
Merged

c-vigo merged 2 commits into
devfrom
feature/59-dist-freshness-gate

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Closes #59.

Two commits:

  1. build(dist): rebuild bundle — dev's committed bundle was stale (built before the undici 6.27.0 bump), which is exactly the drift this issue targets. Rebuilt with the pinned dev-shell toolchain; reviewer-verified reproducible (independent rebuild produces zero diff).
  2. The gate itself:
    • New consumer-owned dist-check.yml (PRs to dev/release/**/main): rebuild with the devkit toolchain, fail if the committed dist/index.js differs. Job name Dist Check is contractual (required check, [TASK] Align branch/tag rulesets with devkit and enable immutable releases #60).
    • release-extension.yml no-op replaced with release-time verification of inputs.finalize_sha — a stale bundle fails the extension job and triggers release.yml's existing rollback. workflow_call inputs contract unchanged.

Deviation from the issue text, deliberate: the gate diffs dist/index.js (the sole runtime artifact, build-location independent) rather than dist/ — the tree also carries 32 accidentally-committed tsc byproducts whose .d.ts.map files embed absolute paths and would make a whole-tree diff permanently red in CI. Cleanup of that cruft is a separate follow-up.

Negative test: injected marker into dist/index.js → gate exits 1; restored → 0. This PR also exercises the positive path via its own Dist Check run.

c-vigo added 2 commits July 14, 2026 11:33
The committed dist/index.js on dev was built against an older undici than
the current lockfile (the 6.23.0 -> 6.27.0 bump). Rebuild with ncc so the
shipped artifact matches src/ and the dependency tree before the freshness
gate lands.

Refs: #59
Consumers run dist/index.js directly, so a forgotten 'just bundle' ships a
stale artifact while tests still pass against src/. Add a consumer-owned
dist-check workflow that rebuilds the bundle on every PR to dev/release/main
and fails when the committed dist/index.js drifts, and replace the
release-extension no-op with the same verification against finalize_sha so a
stale bundle rolls the release back before the tag is cut.

Both verify dist/index.js only: it is the sole runtime artifact and is
build-location independent, unlike the path-dependent tsc declaration
byproducts under dist/src/. Toolchain setup mirrors ci.yml (resolve-toolchain
+ setup-devkit-toolchain) so the rebuild uses the pinned dev-shell Node.

Refs: #59
@c-vigo
c-vigo merged commit 19d688d into dev Jul 14, 2026
11 checks passed
@c-vigo
c-vigo deleted the feature/59-dist-freshness-gate branch July 14, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant