Repository navigation
ci: auto-tag released versions when the release PR merges - #13004
Conversation
The release tag was pushed by hand after merging a release PR, which let the tag name drift from the version committed on the merge commit. When they disagree, release.yml's plan job publishes the committed version but github-release-rust drafts a GitHub release for `v<committed-version>` — a tag that doesn't exist as a git ref — and the create-release call returns 403 "Resource not accessible by integration" even with contents: write. Add tag-release.yml: on a merged `release-pr/*` PR it derives each product's tag from the committed manifest (the same manifests plan reads), skips versions already tagged on the remote, and pushes the new tags with UPDATE_LOCKFILE_TOKEN so the push triggers release.yml (a tag pushed with the default GITHUB_TOKEN would not). Deriving the tag from the committed version makes the off-by-one impossible, and the tag exists as a real ref before release.yml runs, so the draft-release step no longer 403s. A release PR can bump several products at once, landing several tags and starting a release run apiece; add a `release` concurrency group so they serialize and plan's already-published gate makes the later runs no-ops. Drop the now-obsolete "push the version tag after merging" line from the release PR body.
📝 WalkthroughWalkthroughThe release pipeline now creates product version tags after merged release PRs, skips existing tags, serializes release workflows, accepts both supported tag formats, and documents the automated tagging behavior. ChangesRelease pipeline
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ReleasePR as Release PR
participant TagRelease as tag-release.yml
participant Git as Git tags
participant ReleaseWorkflow as release.yml
ReleasePR->>TagRelease: merged release PR closure event
TagRelease->>Git: create and push new product version tags
Git->>ReleaseWorkflow: trigger workflow for v*.*.* or pnpr@*.*.* tags
ReleaseWorkflow->>ReleaseWorkflow: serialize runs in release concurrency group
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoCI: auto-tag committed release versions on merged release PRs
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules 1.
|
Confidence Score: 5/5Safe to merge — this is a pure CI workflow addition with well-scoped guards and no changes to published packages. The new tag-release.yml workflow correctly restricts itself to merged same-repo release-pr/* PRs, reads versions from the exact manifests that release.yml already trusts, handles idempotency via the seen set pre-populated from the remote, and uses set -euo pipefail to abort on any pipeline failure. The release.yml concurrency group prevents concurrent runs from racing through the plan job's already-published gate. No logic errors, unsafe shell constructs, or missing guards were found. No files require special attention. Reviews (4): Last reviewed commit: "ci: adopt the Changesets-style pnpr tag ..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/tag-release.yml:
- Around line 20-29: Configure queued concurrency for both release workflows:
add a dedicated concurrency group with queue set to max in
.github/workflows/tag-release.yml for the tag-release job, and update the
existing concurrency configuration in .github/workflows/release.yml to use queue
max while retaining cancel-in-progress: false. Apply the changes at both
specified sites so simultaneous and successive release runs are preserved.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 3116eeb6-23a0-4c34-906c-de4313f46fcd
📒 Files selected for processing (3)
.github/workflows/create-release-pr.yml.github/workflows/release.yml.github/workflows/tag-release.yml
PR Code Suggestions ✨Latest suggestions up to b6d9afb Warning
Previous suggestionsSuggestions up to commit 70e5d74
|
|||||||||||||||||||||||
- Gate on create-release-pr.yml's exact contract (same-repo head branch
named `release-pr/<base>`) instead of a `release-pr/` prefix, so a fork
PR or an unrelated same-prefixed branch can't reach the PAT tag push.
- `set -euo pipefail` so a failed `git ls-remote` aborts instead of
yielding an empty tag set that makes every version look new.
- `git ls-remote --refs` to drop annotated tags' peeled `^{}` entries.
- Reword the header comment to state the current contract rather than
what it replaces.
|
Thanks for the reviews. Dispositions for the findings that were summary-only (not on an inline thread): Applied in 2995888
Declined, with reasons
The Written by an agent (Claude Code, claude-opus-4-8). |
|
Code review by qodo was updated up to the latest commit 2995888 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR.
|
pnpr's version starts at 0.x, and pnpm's tag history already holds 166 v0.x tags (v0.1.0, v0.2.0, …) plus the v1.x line. Tagging pnpr as `v<version>` shares that namespace: once pnpr cuts a stable 0.x that matches an old pnpm tag, the existence check would treat the ancient pnpm tag as pnpr's and silently skip it, so pnpr would never get its trigger tag or release. Give pnpr its own `pnpr-v<version>` tag (it has no GitHub release and no external consumer of the tag — it ships via npm and GHCR — so it's free to move) and trigger/validate release.yml on `pnpr-v*.*.*` alongside `v*.*.*`. plan reads committed manifests regardless of the triggering tag, so a pnpr-only release still publishes correctly.
|
Code review by qodo was updated up to the latest commit b6d9afb |
Use the widely-recognized `pnpr@<version>` form (the Changesets/Lerna convention) for pnpr's release tag instead of the ad hoc `pnpr-v<version>` from the previous commit. release.yml triggers and validates `pnpr@*.*.*` alongside `v*.*.*`; pnpm (v11.x) and pacquet (v12.x) keep `v<version>`, which get.pnpm.io's install scripts depend on.
|
Code review by qodo was updated up to the latest commit 32fc16c |
PR Code Suggestions ✨Warning
No code suggestions found for the PR.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/release.yml (1)
31-33: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftPending runs in GitHub Actions concurrency groups do not form a true queue.
When multiple workflows are triggered simultaneously (e.g., several version tags pushed in quick succession by
tag-release.yml), GitHub Actions keeps a maximum of one pending run per concurrency group. Any previously pending run in that group is silently canceled.If three tags are pushed, Run 1 will start, Run 3 will queue, and Run 2 will be canceled while pending. Run 2 will never execute. If the workflow relies on executing a run for every tag (e.g., to generate a tag-specific GitHub Release), the intermediate tags will be skipped entirely.
This confirms the necessity of the open
queue: maxsuggestion (likely referencing a custom queueing mechanism or third-party action). To prevent skipped releases, consider processing all new tags in a single run or using a dedicated job-queueing action instead of native concurrency.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release.yml around lines 31 - 33, Replace the native concurrency-only release scheduling with a mechanism that preserves every tag-triggered release, such as processing all newly pushed tags in one run or adopting a dedicated queueing action with sufficient capacity. Update the release workflow’s concurrency configuration and associated execution flow while retaining the existing release behavior for each tag.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/release.yml:
- Around line 31-33: Replace the native concurrency-only release scheduling with
a mechanism that preserves every tag-triggered release, such as processing all
newly pushed tags in one run or adopting a dedicated queueing action with
sufficient capacity. Update the release workflow’s concurrency configuration and
associated execution flow while retaining the existing release behavior for each
tag.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5b16fc09-4369-4dc1-a78d-23b4e2580f09
📒 Files selected for processing (2)
.github/workflows/release.yml.github/workflows/tag-release.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/tag-release.yml
Summary
Auto-tags released versions when a release PR is merged, so a release tag can never drift from the version it's supposed to release.
Today the version tag is pushed by hand after merging the release PR. If the tag name doesn't match the version committed on the merge commit,
release.yml'splanjob (which reads the committed version, not the tag) publishes the committed version to npm butgithub-release-rustthen drafts a GitHub release forv<committed-version>— a tag that doesn't exist as a git ref — and the create-release call fails with403 Resource not accessible by integration, even though the job hascontents: write. That is exactly what happened on the v12.0.0-alpha.11 release: the tagv12.0.0-alpha.12was pushed onto the commit that bumped the committed version to12.0.0-alpha.11.This PR adds
.github/workflows/tag-release.yml, which on a mergedrelease-pr/*PR derives each product's tag from its committed manifest (the same manifestsplanreads), skips versions already tagged on the remote, and pushes the new tags. Because the tag is derived from the committed version rather than typed, the off-by-one is impossible; because the tag exists as a real ref beforerelease.ymlruns, the draft-release step no longer 403s.Squash Commit Body
Checklist
pnpm/port, and pnpr — the workflow tags all three from their committed manifests.Written by an agent (Claude Code, claude-opus-4-8).
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
v*.*.*andpnpr@*.*.*formats.