Skip to content

build: migrate uv.lock to revision 2 - #555

Merged
mocha06 merged 1 commit into
devfrom
rc-dev/build/uv-lock-revision-2
Jul 31, 2026
Merged

build: migrate uv.lock to revision 2#555
mocha06 merged 1 commit into
devfrom
rc-dev/build/uv-lock-revision-2

Conversation

@mocha06

@mocha06 mocha06 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Motivation

uv.lock is committed at revision = 1. Any current uv upgrades it to revision = 2 — adding an upload-time field per artifact — the moment it has to write the file. That never surfaces during normal work because uv lock is a no-op while nothing has changed, but a release bump always forces a write: bump_version.py runs uv lock right after rewriting the version. So the next release commit, whoever cut it, would have carried an unrelated ~1900-line format migration alongside the version bump.

This came up while reviewing #554, where exactly that happened by accident.

Outcome

The migration lands on its own, decoupled from any version bump, so the next release commit is only a version bump.

The change is purely the format: stripping the added upload-time fields and the revision line makes the new lockfile byte-identical to the old one, so no dependency resolution moved and no package version changed. uv sync --locked exits 0, bump_version.py verify passes, and the suite is green.

It was produced by bumping the workspace version away and straight back, which forces uv to rewrite the lockfile while leaving every other version-bearing file untouched — hence the single-file diff.

Notes

Worth considering as a follow-up: the repo pins no uv version (setup-uv@v7 with no version, no [tool.uv] required-version), which is why the committed lockfile could drift behind contributors' local uv in the first place. A required-version pin would keep this from recurring, but it needs agreement on a version and would block anyone on an older uv, so it is not folded in here.

The committed lockfile is at `revision = 1`, a format any current uv upgrades to
`revision = 2` (adding `upload-time` metadata per artifact) the moment it has to
write the file. `uv lock` is a no-op while nothing changed, so the migration
stays invisible until something forces a write — and a release bump always does,
since `bump_version.py` runs `uv lock` after rewriting the version. That put an
unrelated ~1900-line format change inside the next release commit, whoever cut
it.

Doing it deliberately here instead, decoupled from any version bump. The diff is
purely the format: stripping the added `upload-time` fields and the revision line
makes the new lockfile byte-identical to the old one, so no dependency
resolution moved. `uv sync --locked` passes, as does `bump_version.py verify`.

Produced by bumping the version away and straight back, which forces uv to
rewrite the lockfile while leaving every other version-bearing file untouched.
@adriannoes
adriannoes self-requested a review July 31, 2026 19:06

@adriannoes adriannoes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@mocha06
mocha06 merged commit 5a5bad4 into dev Jul 31, 2026
2 checks passed
@mocha06
mocha06 deleted the rc-dev/build/uv-lock-revision-2 branch July 31, 2026 19:13
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