Repository navigation
build(release): relock and stage uv.lock in the release commit - #522
Conversation
Fails on main: build_command is plain 'uv build', so uv.lock keeps the old project version after a release. Refs #521
The release commit bumped pyproject.toml but not uv.lock. On stable branches the lock then stayed stale until the next push, and every backport in between failed to regenerate because its uv sync relocked a file outside the generated paths. Use python-semantic-release's documented uv recipe. Closes #521
|
🤖 The changes in this PR were produced by nano-agent, an autonomous agent. Commits are authored under the operator's own git identity when one is resolvable (the human running the fleet), so they can satisfy CLA/DCO requirements; this note records that the work was generated by the agent. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the release-command change that refreshes and stages uv.lock.
No open issues 🎉
What changed in this PR
Keeps uv.lock synchronized with the released package version in the release commit, preventing stale-lock changes from blocking backport regeneration on stable/* branches.
Changes:
- Update the release build command to relock the project and stage
uv.lockbefore building. - Add an offline regression test that simulates a release version bump and verifies the lockfile’s version and staging.
| File | Description |
|---|---|
tests/acceptance/test_release_relocks.py |
Tests that the configured release command updates and stages uv.lock. |
pyproject.toml |
Adds lockfile refresh and staging to the semantic-release build command. |
Review effort: Balanced
|
nano-ack: issuecomment-7279252693 — this is an attribution notice, not a change request, so no code change is needed. Noted that the commits come from nano-agent. |
uv lock under UV_OFFLINE fails on CI runners whose uv cache lacks packages for every resolution split (attrs for python>=3.12), so the test failed deterministically. Refs #521
|
Successfully created backport PR for |
|
Successfully created backport PR for |
…ort #522 to stable/9) (#524) * build(release): relock and stage uv.lock in the release commit (#522) * test: check that the release commit carries uv.lock's version bump Fails on main: build_command is plain 'uv build', so uv.lock keeps the old project version after a release. Refs #521 * build(release): relock and stage uv.lock in the release commit The release commit bumped pyproject.toml but not uv.lock. On stable branches the lock then stayed stale until the next push, and every backport in between failed to regenerate because its uv sync relocked a file outside the generated paths. Use python-semantic-release's documented uv recipe. Closes #521 * test: let the relock test resolve with the network uv lock under UV_OFFLINE fails on CI runners whose uv cache lacks packages for every resolution split (attrs for python>=3.12), so the test failed deterministically. Refs #521 (cherry picked from commit 032b8b8) * build(release): abort the release if relocking or staging uv.lock fails Signed-off-by: Josh Wulf <josh.wulf@camunda.com> * test: fix pyright unknown type in test_release_relocks --------- Signed-off-by: Josh Wulf <josh.wulf@camunda.com> Co-authored-by: Josh Wulf <josh.wulf@camunda.com>
…ort #522 to stable/10) (#523) * build(release): relock and stage uv.lock in the release commit (#522) * test: check that the release commit carries uv.lock's version bump Fails on main: build_command is plain 'uv build', so uv.lock keeps the old project version after a release. Refs #521 * build(release): relock and stage uv.lock in the release commit The release commit bumped pyproject.toml but not uv.lock. On stable branches the lock then stayed stale until the next push, and every backport in between failed to regenerate because its uv sync relocked a file outside the generated paths. Use python-semantic-release's documented uv recipe. Closes #521 * test: let the relock test resolve with the network uv lock under UV_OFFLINE fails on CI runners whose uv cache lacks packages for every resolution split (attrs for python>=3.12), so the test failed deterministically. Refs #521 (cherry picked from commit 032b8b8) * chore: fail the release build when relocking or staging fails Signed-off-by: Josh Wulf <josh.wulf@camunda.com> * chore: stub non-target steps in release build failure test Signed-off-by: Josh Wulf <josh.wulf@camunda.com> --------- Signed-off-by: Josh Wulf <josh.wulf@camunda.com> Co-authored-by: Josh Wulf <josh.wulf@camunda.com>
Closes #521
Problem
The release commit bumps
project.versioninpyproject.tomlbut leavesuv.lockat the old version. Onstable/*the lock stays stale until the next push. Every backport in between then fails to regenerate: sdk-backport'suv syncrelocks, and it rejectsuv.lockas a change outsidegenerated-paths. That happened to #519 today.stable/10is stale again after 10.4.1, so the remaining secret-redaction backports would hit it too.Defect class: Test, build, or CI infrastructure.
Change
build_commandfollows python-semantic-release's uv recipe:uv lock --upgrade-package "$PACKAGE_NAME",git add uv.lock,uv build. That puts the lock bump in the release commit.tests/acceptance/test_release_relocks.pydrives the configured release the way PSR does. In a scratch git repo it bumps everyversion_tomltarget and runsbuild_command(withoutuv build, offline). It then asserts thatuv.lockrecords the new version and is staged. It reads the config, so a future file that records the version and gets missed fails it too.Red/green
assert <Version('11.0.0.dev32')> == <Version('12.0.0')>, i.e. build_command must relock.make lint,make typecheck(0 diagnostics) anduv run pytest -q tests/acceptance(1929 passed) are clean. No generated output changes.Labelled for backport to
stable/10andstable/9, the branches where the stale lock blocks backports.