Skip to content

build: freeze the lockfile for every bun install - #234

Merged
jgpruitt merged 1 commit into
mainfrom
frozen-lockfile
Oct 23, 2026
Merged

jgpruitt merged 1 commit into
mainfrom
frozen-lockfile

Conversation

@jgpruitt

Copy link
Copy Markdown
Collaborator

Audit finding M7.

Bun does not auto-freeze the lockfile under CI=true (npm and pnpm do). ci.yml, release.yml, and validate-packs.yml all run plain ./bun install, so a drifted package.json is silently re-resolved against the live npm registry and the release binaries / npm packages are built from versions the tagged commit never pinned, while provenance attests the commit SHA.

Fix: frozenLockfile = true in bunfig.toml, so every install (CI, release, and local) fails on drift rather than rewriting bun.lock. This covers future workflows too; the explicit flags in docs.yml and the Dockerfile stay as harmless no-ops.

Verified: with the setting in place, editing a dep range and running ./bun install exits 1 with error: lockfile had changes, but lockfile is frozen. A clean tree installs normally.

Also: commits the lockfile drift that was already present on main (workspace package versions 0.8.0 → 0.9.0 in bun.lock), which is what kept rewriting bun.lock locally on ./bun x runs.

To change deps intentionally: bun add / bun remove, or ./bun install --no-frozen-lockfile, then commit bun.lock.

Bun does not switch to --frozen-lockfile under CI the way npm and pnpm do,
so the plain `./bun install` in ci.yml, release.yml, and validate-packs.yml
would silently re-resolve a drifted package.json against the live registry
and build from versions the commit never pinned. Set frozenLockfile in
bunfig.toml so every install (CI, release, local) fails loudly on drift
instead. Intentional dep changes go through `bun add`/`bun remove` or
`./bun install --no-frozen-lockfile`.

Also commit the lockfile drift that was already present (workspace package
versions 0.8.0 -> 0.9.0).
Copilot AI balanced review requested due to automatic review settings October 23, 2026 14:09
@jgpruitt jgpruitt self-assigned this Oct 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Both release helpers must synchronize and commit the lockfile after version bumps to avoid blocking subsequent frozen installs.

1 open issue
What changed in this PR

This PR makes frozen lockfile installs the repository default, helping CI and release builds use committed dependency resolutions.

Changes:

  • Enable install.frozenLockfile and document how to intentionally update dependencies.
  • Refresh workspace versions in bun.lock to 0.9.0 or 0.9.1 without changing external dependency resolutions.
File Description
bunfig.toml Enable frozen installs and document the override.
bun.lock Synchronize workspace versions and remove extra blank lines.

Review effort: Balanced

Comment thread bunfig.toml
@jgpruitt
jgpruitt merged commit 9c9bdc1 into main Oct 23, 2026
6 checks passed
@jgpruitt
jgpruitt deleted the frozen-lockfile branch October 23, 2026 14:28
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.

2 participants