Skip to content

Fail the release when uv.lock is behind the latest releases - #68

Merged
marcleblanc2 merged 1 commit into
mainfrom
marc/release-lock-freshness
Nov 12, 2026
Merged

marcleblanc2 merged 1 commit into
mainfrom
marc/release-lock-freshness

Conversation

@marcleblanc2

Copy link
Copy Markdown
Collaborator

The release workflow now stops before building when uv.lock is behind the latest releases that pyproject.toml allows.

What changes

  • New Validate lockfile freshness step in release.yml, right after Validate release inputs. It runs uv lock --upgrade --refresh --dry-run and fails unless uv prints No lockfile changes detected.
  • The same check is added to the pre-tag commands in AGENTS.md, so a stale lock is caught before a tag is pushed.

The workflow only reads the lock; it never edits uv.lock.

Things to know

  • The next release fails until the lock is refreshed. The check lists 9 packages behind on main today. Merge a lock file maintenance PR first (see the Renovate coverage PR).
  • The check covers the whole lock, including dev tools such as ruff, not only what ships.
  • A new upstream release between the last lock refresh and the tag fails the release. The tag is already pushed at that point: refresh the lock on main, then use the next patch number, or move the tag with approval.
  • It fails closed: if uv cannot reach PyPI, or a future uv changes the message, the release stops.
  • It only checks inside the ranges in pyproject.toml. A new major release outside a range still needs a Renovate PR.
  • It is not in validate.yml, so PR CI does not break when an upstream package releases.

Testing

The release workflow only runs on tags, so CI on this PR does not exercise the step. I ran the step's script locally with uv 0.11.7 (the pinned version) under bash -eo pipefail:

  • Current lock: lists the 9 updates and exits 1.
  • Lock after uv lock --upgrade: prints No lockfile changes detected and exits 0.
  • A uv that errors out: exits 1.
  • actionlint and markdownlint are clean.

A release could ship or test against whatever uv.lock held, even when
newer releases allowed by pyproject.toml existed.

- Add a release workflow step that runs `uv lock --upgrade --dry-run` and
  fails unless uv reports no lockfile changes
- Document the same check in the pre-tag steps in AGENTS.md

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ca38-20a5-7436-a7ae-1f2bce712489
Co-authored-by: Amp <amp@ampcode.com>
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

@marcleblanc2
marcleblanc2 merged commit 4298e83 into main Nov 12, 2026
7 checks passed
@marcleblanc2
marcleblanc2 deleted the marc/release-lock-freshness branch November 12, 2026 21:41
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