ci(release-please): sync uv.lock after version bump#1515
ci(release-please): sync uv.lock after version bump#1515
Conversation
|
🐕 Review complete — View session on Shuni Portal 🐾 |
There was a problem hiding this comment.
🐕 Shuni's Review
Adds a sync-uv-lock job after release-please that re-locks uv.lock whenever the release PR bumps the project version, then commits via the App token so PR CI re-triggers.
No issues found — good bones! The conditional plumbing (if: steps.release.outputs.pr → pr_branch output → downstream != '' gate), App-token-scoped checkout/push, and idempotent git diff --quiet guard are all sound. Failure modes (e.g. release-please force-push racing with this push) fail safely rather than corrupting state. Woof!
There was a problem hiding this comment.
Pull request overview
Adds a post-processing step to the release automation so release-please PRs don’t fail CI when pyproject.toml version bumps invalidate uv.lock.
Changes:
- Expose the release-please PR head branch as a job output (
pr_branch) by extracting it from therelease-please-actionprJSON output. - Add a
sync-uv-lockjob that checks out the release PR branch, runsuv lock, and commits/pushesuv.lockback to the PR branch only when it changed. - Use the GitHub App token + bot identity for the commit/push so the PR CI re-triggers.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage reportThe coverage rate went from None of the new lines are part of the tested code. Therefore, there is no coverage data about them. |
release-please bumps `version` in `pyproject.toml` but doesn't touch `uv.lock`. Since `uv.lock` records the project version, `uv sync --locked` then fails on every CI job for the release PR with: The lockfile at uv.lock needs to be updated, but --locked was provided. To update the lockfile, run uv lock. Reproduced locally: bumping pyproject from 1.13.0 to 2.0.0 makes uv sync --locked fail; uv lock alone re-sync's the descope entry and CI passes again. Add a sync-uv-lock job that runs after release-please-action when a release PR was opened/updated. It checks out the PR branch using the same GitHub App token, runs uv lock, and pushes the resulting uv.lock change back to the PR branch (only if changed). The push uses the App token so PR CI is re-triggered with the fixed lock. If release-please regenerates the PR later (new commits on main), the workflow re-runs and re-applies the lock fix on top.
62d38ac to
c88b223
Compare
|
Superseded by #1518 — much simpler fix using release-please's native |
Why
The release-please PR (#1446) is failing every CI job with:
Root cause: release-please bumps
versioninpyproject.toml(1.13.0→2.0.0) but doesn't touchuv.lock. Sinceuv.lockrecords the project's own version (the[[package]] name = "descope"entry),uv sync --lockedfails the integrity check on the next CI run.Reproduced locally:
What
Add a
sync-uv-lockjob afterrelease-please-actionthat:release-please-action'sproutput and extractsheadBranchName.pr_branch != '').uv lockto re-sync the project version inuv.lock.uv.lockactually changed.The push uses the App token (not
GITHUB_TOKEN), so PR CI re-triggers automatically with the fixed lockfile.If release-please regenerates the PR later (e.g. new commits land on
main), the workflow re-runs on the next push tomainand re-applies the sync — the lock stays in sync without manual intervention.Out of scope
publishjob is unchanged — it runs at tag time, after the PR is merged, whereuv.lockis already fixed.uv.lockto release-please'sextra-filesbecause release-please's TOML updater can't address[[package]] name = "descope"array entries cleanly.Verification
actionlint).uv lockis the exact remediation needed.