ci: sync uv.lock in forward-merge PRs after release version bump#716
Merged
Conversation
release-please bumps the project version in pyproject.toml when cutting releases on production and hotfix/v* branches, but never updates uv.lock, which records the editable ocotilloapi package version. tests.yml runs `uv sync --locked`, so every back-merge and hotfix forward-merge PR failed CI until someone manually ran `uv lock` (see 2775111 for PR #714). - back-merge-to-staging: after the manifest sync, install uv, run `uv lock`, and commit the lockfile to the merge branch if it changed. - forward-merge-to-production: the PR head is the hotfix branch itself, so check out the hotfix branch explicitly, run `uv lock`, and push a sync commit directly to it before opening the PR. Plain push (not force) so an out-of-date checkout fails loudly. Both steps are idempotent: lockfile already in sync -> no commit, no push. Existing-PR checks and --force-with-lease behavior unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the forward-merge automation workflow to keep uv.lock in sync after release-please bumps the project version, preventing CI failures caused by uv sync --locked detecting a stale lockfile.
Changes:
- Add
setup-uv+uv locksteps in the production→staging back-merge job and commituv.lockwhen it changes. - For hotfix→production forward merges, check out the hotfix branch explicitly, re-lock, and push a sync commit directly to the hotfix branch before opening the PR.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
uv.lockre-lock step to both jobs in.github/workflows/forward-merge.yml:astral-sh/setup-uv@v8.2.0, same pin as tests.yml/CD workflows), runuv lock, and commit the lockfile to the merge branch if it changed — before the existing push/PR step.ref: inputs.source_branch(withFORWARD_MERGE_TOKEN), runsuv lock, and pushes a sync commit directly to the hotfix branch before opening the PR.Why
release-please bumps the project version in
pyproject.tomlwhen cutting releases onproductionandhotfix/v*, but never updatesuv.lock, which records the editable ocotilloapi package version.tests.ymlrunsuv sync --locked, which asserts the lockfile is unchanged — so every back-merge and hotfix forward-merge PR failed CI until someone manually ranuv lockand committed. This was done by hand for #714 (2775111); this PR automates it.Reviewer notes
--force-with-leaseon the merge branch behave as before.uv lockin CI needs network access for resolution — standard on these runners.🤖 Generated with Claude Code