Skip to content

build(release): relock and stage uv.lock in the release commit - #522

Merged
jwulf merged 3 commits into
mainfrom
fix/521-release-relock
Nov 30, 2026
Merged

jwulf merged 3 commits into
mainfrom
fix/521-release-relock

Conversation

@jwulf

@jwulf jwulf commented Nov 30, 2026

Copy link
Copy Markdown
Member

Closes #521

Problem

The release commit bumps project.version in pyproject.toml but leaves uv.lock at the old version. On stable/* the lock stays stale until the next push. Every backport in between then fails to regenerate: sdk-backport's uv sync relocks, and it rejects uv.lock as a change outside generated-paths. That happened to #519 today. stable/10 is 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_command follows 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.py drives the configured release the way PSR does. In a scratch git repo it bumps every version_toml target and runs build_command (without uv build, offline). It then asserts that uv.lock records 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

  • Red, at the test commit: assert <Version('11.0.0.dev32')> == <Version('12.0.0')>, i.e. build_command must relock.
  • Green, at the fix commit: passes on Python 3.14 and 3.10.

make lint, make typecheck (0 diagnostics) and uv run pytest -q tests/acceptance (1929 passed) are clean. No generated output changes.

Labelled for backport to stable/10 and stable/9, the branches where the stale lock blocks backports.

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
@jwulf
jwulf requested a review from a team as a code owner November 30, 2026 13:00
@jwulf jwulf added backport stable/10 Backport to stable/10 after merge backport stable/9 Backport to stable/9 after merge labels Nov 30, 2026
Copilot AI balanced review requested due to automatic review settings November 30, 2026 13:00
@jwulf

jwulf commented Nov 30, 2026

Copy link
Copy Markdown
Member Author

🤖 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.

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.

🟢 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.lock before 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

@jwulf

jwulf commented Nov 30, 2026

Copy link
Copy Markdown
Member Author

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

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.

🟢 Approval recommended

The release-time lockfile synchronization change has no active review issues.

No open issues 🎉

Review effort: Balanced

@jwulf
jwulf merged commit 032b8b8 into main Nov 30, 2026
31 checks passed
@camunda-sdk-automation

Copy link
Copy Markdown
Contributor

@camunda-sdk-automation

Copy link
Copy Markdown
Contributor

jwulf added a commit that referenced this pull request Nov 30, 2026
…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>
jwulf added a commit that referenced this pull request Nov 30, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport stable/9 Backport to stable/9 after merge backport stable/10 Backport to stable/10 after merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release commits bump pyproject.toml but leave uv.lock stale, breaking backport regeneration

2 participants