Skip to content

build(dist): rebuild the committed bundle and correct the lock-file changelog entry - #132

Merged
c-vigo merged 2 commits into
devfrom
chore/130-rebundle-dist
Aug 5, 2026
Merged

c-vigo merged 2 commits into
devfrom
chore/130-rebundle-dist

Conversation

@c-vigo

@c-vigo c-vigo commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

Rebuilds the committed action bundle, which had drifted from src/ plus the
current package-lock.json, and corrects the changelog entry that
mis-described the drift's cause as harmless.

Found while preparing the v0.3.2 release: the release PR would have failed its
required Dist Check gate.

Type of Change

  • build -- Build system or dependency changes
  • docs -- Documentation only

Modifiers

  • Breaking change (!)

Changes Made

dist/index.js rebuilt (just sync && just bundle), +146 / -15. The diff is
entirely inlined dependency code — src/ is untouched, and has been since
v0.3.1. Two movements reach the bundle:

Dependency Movement Reaches the bundle via From
undici 6.27.0 → 6.28.0 @actions/core → @actions/http-client, and @actions/github #109, #116, #120
@octokit/request 10.0.11 → 10.0.13 @actions/github #129
@octokit/core 7.0.6 → 7.0.7 @actions/github #129

The undici delta is request-path hardening: header-value validation before
coercion (rejecting values produced by a crafted toString /
Symbol.toPrimitive, and an invalid content-type derived from a blob body),
plus Content-Length-mismatch detection on partial/ranged responses.

Only dist/index.js is committed. The dist/src/** declaration byproducts
are gitignored, yet still tracked from the v0.3.0 finalize commit (the
vig-os/devkit#1159 force-add bug, since fixed upstream), and they embed an
absolute sourceRoot of /home/runner/work/commit-action/commit-action. A
locally built copy rewrites that to the developer's home path and would make
CI's Dist Check rebuild diff and fail. They were explicitly restored before
staging.

Changelog: corrected the lock-file-maintenance bullet, which asserted
"Transitive dev-dependency movement only" — false, as the table above shows;
folded in #129, which had no entry at all; and added the Fixed entry.

Changelog Entry

Fixed

  • The committed action bundle is rebuilt and back in sync with its lock file (#130). dist/index.js — the artifact action.yml actually runs, and therefore the only thing consumers of a released tag execute — still inlined dependency versions the lock file had moved past. Nothing rebundled after the lock-file maintenance PRs, and dist-check.yml triggers only on pull requests to release/** and main while every dependency PR targets dev, so the drift accumulated unseen. The refreshed bundle carries undici 6.28.0 (header-value validation before coercion, rejecting values produced by a crafted toString/Symbol.toPrimitive and an invalid content-type derived from a blob body, plus Content-Length-mismatch detection on partial responses) and @octokit/request 10.0.13 / @octokit/core 7.0.7.

Plus the correction to the existing Changed bullet (see diff).

Testing

  • Tests pass locally (just test) — 84 passed, 3 suites
  • Manual testing performed

Manual Testing Details

  • just lint and just format-check clean
  • Full prek run --all-files suite green
  • git status --porcelain -- dist/ clean after a post-commit rebuild, i.e. the
    same assertion Dist Check makes
  • Verified the staged set was dist/index.js alone, no dist/src/ path

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • I have updated CHANGELOG.md in the [Unreleased] section
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective — n/a, no source change;
    Dist Check on this PR's base is the standing gate
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Two follow-ups this uncovered, both deliberately out of scope:

  1. dist-check.yml never runs on dev, which is exactly why this went unseen.
    Its trigger is devkit-managed, so widening it needs an upstream change.
  2. dist/src/** should not be tracked at all (it is already gitignored) —
    git rm --cached dist/src would end the absolute-path hazard permanently.

Refs: #130

c-vigo added 2 commits August 5, 2026 10:05
Several dependency PRs moved transitive runtime dependencies without anything
rebundling afterwards, so the committed dist/index.js drifted from what src/
plus the current package-lock.json produce.

Two movements reach the bundle:

- undici 6.27.0 -> 6.28.0 (#109, #116, #120), inlined through both direct
  dependencies: @actions/core -> @actions/http-client, and @actions/github.
  Adds header-value validation before coercion (rejecting values from a crafted
  toString/Symbol.toPrimitive and an invalid content-type on a blob body) and
  Content-Length-mismatch detection on partial responses.
- @octokit/request 10.0.11 -> 10.0.13 and @octokit/core 7.0.6 -> 7.0.7 (#129),
  inlined through @actions/github.

Dist Check never caught the drift because it triggers only on pull requests to
release/** and main, and every dependency PR targets dev.

Rebuilt with `just sync && just bundle`. Only dist/index.js is committed: the
dist/src/** declaration byproducts are gitignored (though still tracked from the
v0.3.0 finalize commit) and embed an absolute sourceRoot, so a locally built
copy would break Dist Check in CI.

Refs: #130
…entry

The lock-file maintenance bullet claimed "transitive dev-dependency movement
only". That is wrong: undici and @octokit/request / @octokit/core are transitive
runtime dependencies of @actions/core and @actions/github, so they ship inside
the committed dist/index.js and reach every consumer of a released tag.

Correct that bullet, fold in the fourth maintenance PR (#129, previously
unrecorded), and add a Fixed entry for the rebuild itself.

Refs: #130
@c-vigo
c-vigo merged commit 17098c7 into dev Aug 5, 2026
15 checks passed
@c-vigo
c-vigo deleted the chore/130-rebundle-dist branch August 5, 2026 09:10
c-vigo added a commit that referenced this pull request Aug 5, 2026
…dvance (#133)

## Description

Corrects the unreleased **Adopt vigOS devkit 1.6.0** entry, which
describes a
condition the repository no longer has, and records the change that
fixed it.

Timing matters: `prepare-release.yml` freezes `## Unreleased` verbatim
into the
released section, and released entries are never edited afterwards.
Anything
wrong here becomes permanently wrong at the next release.

## Type of Change

- [x] `docs` -- Documentation only

### Modifiers

- [ ] Breaking change (`!`)

## Changes Made

The 1.6.0 bullet ended with:

> …the dev shell reports the gap as a vig-os/devkit#1263 skew warning on
load.

True when written — the adoption (#124) was a pin-only edit that left
the
floating `vigos` input locked at `26e291d`, the 1.5.1 release, so the
dev shell
ran the 1.5.1 toolchain under the 1.6.0 scaffold. #126 then advanced
`flake.lock` to `ffa7a5f`, the 1.6.0 release commit, and the warning
stopped
firing. That PR carried no changelog entry of its own, so the lock
movement was
unrecorded while the stale claim survived.

This drops the skew sentence and adds a sub-bullet recording the pin
advance,
ending on the state the release actually ships: pin and scaffold in
lockstep.

## Changelog Entry

This PR *is* the changelog change. The amended sub-bullet:

- **The flake pin was advanced to match**
([#126](#126)). The adoption
above was a pin-only edit, which left the floating `vigos` input locked
at `26e291d` (the 1.5.1 release): the dev shell ran the 1.5.1 toolchain
under the 1.6.0 scaffold, and the shell-entry version-skew warning
(vig-os/devkit#1263) fired on every entry. `nix flake update vigos`
advanced the lock to `ffa7a5f`, the 1.6.0 release commit. The 1.6.0
shell builds, the full hook suite is green, and the warning is gone — so
this release ships with pin and scaffold in lockstep.

## Testing

- [x] Tests pass locally (`just test`) — unchanged by this PR, docs only
- [x] Manual testing performed

### Manual Testing Details

- Full `prek run --all-files` suite green, `pymarkdown` included
- `flake.lock` verified to hold `ffa7a5f` for the `vigos` input,
matching the
  claim the entry now makes
- No released section touched — the diff is 2 insertions / 1 deletion,
all
  inside `## Unreleased`

## Checklist

- [x] My code follows the project's style guidelines
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have updated the documentation accordingly
- [x] I have updated `CHANGELOG.md` in the `[Unreleased]` section
- [x] My changes generate no new warnings or errors
- [ ] I have added tests that prove my fix is effective — n/a,
documentation
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published

## Additional Notes

Branched from `dev`, independent of #132 — the two touch different parts
of
`## Unreleased` and can merge in either order.

Refs: #131
c-vigo added a commit that referenced this pull request Aug 5, 2026
Closes #134.

## What

`git rm -r --cached dist/src` — 12 declaration byproducts stop being
tracked. They stay on disk, stay gitignored (`.gitignore` line 51), and
are regenerated by `just bundle`, as
[#70](#70) intended.

## Why

`dist-check.yml` and `release-extension.yml` both document, in their
headers, that `dist/src/` is gitignored and `dist/index.js` is the only
tracked path under `dist/` — which is what makes their tree-wide `git
status -- dist/` check "deterministic across checkout locations".

That invariant was false. The v0.3.0 finalize commit (`1260b1d`)
re-added the byproducts via vig-os/devkit#1159, in which the release
step walked a bare `dist` directory path and force-added every file it
found without consulting `.gitignore`. devkit fixed that upstream —
`release-core.yml` now derives its paths from `git ls-files -co
--exclude-standard` — but the residue here was never cleaned up.

Each `.d.ts.map` embeds an absolute `sourceRoot`:

```json
"sources":["file:///home/runner/work/commit-action/commit-action/src/retry.ts"]
```

So the check passed only because CI happens to rebuild at the same
absolute path that was committed. Any other checkout location reported
six modified files. That is what forced the hand-staging of
`dist/index.js` in #132 — committing a locally built tree would have
written developer-machine paths into the repo.

## Verified

| Assertion | Result |
| --- | --- |
| `git ls-files dist/` | `dist/index.js`, `dist/package.json` only |
| `just sync && just bundle` then `git status --porcelain -- dist/` |
**empty** on a developer machine — first time this has been true |
| `release-core.yml` `DIST_PATHS` (`git ls-files -co --exclude-standard
-- dist`) | `dist/index.js,dist/package.json` — non-empty, no-files
guard still holds |
| `prek run --all-files` | green |

Both release gates get stronger, not weaker: `dist-check.yml`'s `git
status --porcelain` does not report untracked-and-ignored files, so it
stays clean in CI and becomes honest everywhere else, and the finalize
commit stops writing runner paths into every release tag.

## Consumer impact

None. `action.yml` runs `dist/index.js`, which stays tracked. The
`.d.ts` declarations are build byproducts with no runtime role.

Sequenced deliberately before the v0.3.2 release: deferring means the
finalize commit re-commits the `/home/runner` paths into the v0.3.2 tag.
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