Skip to content

ci: sync uv.lock in forward-merge PRs after release version bump#716

Merged
jirhiker merged 2 commits into
stagingfrom
ci/forward-merge-uv-lock-sync
Jun 11, 2026
Merged

ci: sync uv.lock in forward-merge PRs after release version bump#716
jirhiker merged 2 commits into
stagingfrom
ci/forward-merge-uv-lock-sync

Conversation

@jirhiker

Copy link
Copy Markdown
Member

What

Adds a uv.lock re-lock step to both jobs in .github/workflows/forward-merge.yml:

  • back-merge-to-staging: after the release-please manifest sync, install uv (astral-sh/setup-uv@v8.2.0, same pin as tests.yml/CD workflows), run uv lock, and commit the lockfile to the merge branch if it changed — before the existing push/PR step.
  • forward-merge-to-production: the PR head is the hotfix branch itself, so the checkout now pins ref: inputs.source_branch (with FORWARD_MERGE_TOKEN), runs uv lock, and pushes a sync commit directly to the hotfix branch before opening the PR.

Why

release-please bumps the project version in pyproject.toml when cutting releases on production and hotfix/v*, but never updates uv.lock, which records the editable ocotilloapi package version. tests.yml runs uv sync --locked, which asserts the lockfile is unchanged — so every back-merge and hotfix forward-merge PR failed CI until someone manually ran uv lock and committed. This was done by hand for #714 (2775111); this PR automates it.

Reviewer notes

  • Both sync steps are idempotent: lockfile already in sync → no commit, no push. Safe on retry.
  • Existing retry-safety untouched: existing-PR checks and --force-with-lease on the merge branch behave as before.
  • Hotfix path uses a plain push (not force) to the hotfix branch on purpose — an out-of-date checkout fails loudly instead of clobbering newer hotfix commits.
  • The release tag stays on the original release commit; the lockfile sync commit rides on top and is included in the PR. No new release is triggered.
  • uv lock in CI needs network access for resolution — standard on these runners.
  • Not exercised live yet; first real validation is the back-merge PR after the next production release.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings June 10, 2026 22:23

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.

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 lock steps in the production→staging back-merge job and commit uv.lock when 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.

Comment thread .github/workflows/forward-merge.yml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 11, 2026 15:25

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@jirhiker jirhiker merged commit 45ba53f into staging Jun 11, 2026
10 checks passed
@jirhiker jirhiker deleted the ci/forward-merge-uv-lock-sync branch June 11, 2026 15:31
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