Skip to content

fix(releasing): release each product only from its own version tag - #13128

Merged
zkochan merged 4 commits into
mainfrom
fix-release
Jul 18, 2026
Merged

zkochan merged 4 commits into
mainfrom
fix-release

Conversation

@zkochan

@zkochan zkochan commented Jul 18, 2026 •

Copy link
Copy Markdown
Member

Summary

In release run 29644133887, the TypeScript 11.15.0 artifacts and release notes were published on the v12.0.0-alpha.15 release page, and no v11.15.0 GitHub release was created at all (since fixed up by hand). Two things combined to cause it: the three tags of the release PR shared the single release concurrency group — GitHub keeps at most one pending run per group, so the v11.15.0 run was cancelled from the queue — and the surviving v12.0.0-alpha.15 run resumed the unpublished TypeScript release, whose GitHub-release step passed no tag_name and fell back to github.ref, the v12 tag.

This PR replaces the "release whatever npm is missing" model with dispatch by tag:

  • The tag names the product. The plan job releases exactly the product whose committed version the tag matches (v<ts_version> → TypeScript CLI, v<rust_version> → Rust CLI, pnpr@<version> → pnpr). A tag matching no product's committed version fails the plan loudly instead of falling back. The npm-registry check remains as an idempotency guard: rerunning a tag resumes a partial release, and rerunning a completed tag skips every job.
  • Per-ref concurrency. Since each run now publishes a disjoint set of packages, simultaneous tag pushes run in parallel instead of sharing a queue that silently evicts pending runs. Reruns of the same tag still serialize, and nothing is cancelled mid-publish.
  • Pinned release identity. The TypeScript GitHub-release step gets an explicit tag_name/name derived from the plan, mirroring github-release-rust, so no release step depends on the github.ref fallback.
  • Tag↔commit guards. All GitHub-release jobs assert that the version tag points at the run's commit before creating the release — the dispatch matches version strings, which cannot prove the tag points at this commit (a retagged release, or a second commit carrying the same committed version, would still dispatch). The Rust job's target_commitish cannot enforce this because GitHub ignores it whenever the tag already exists.
  • pnpr gets a GitHub release page. A new github-release-pnpr job mirrors github-release-rust: it drafts a release on the pnpr@<version> tag with the platform archives and their build-time checksums, prerelease-flagged for alpha versions and kept off the repository's "Latest" badge. This supersedes the still-relevant part of feat(release): give pnpr its own tag namespace for independent releases #12963 (its other two parts — a pnpr tag namespace and the TypeScript tag_name pinning — landed as pnpr@<version> on main and in this PR, respectively).
  • Every product's release stays a draft until a maintainer publishes it. The TypeScript job used to verify its draft's body and immediately publish it. The repository uses immutable releases, so publishing is irreversible — a wrong published release can only be deleted, and deletion burns its tag for releases forever (the alpha.15 incident had to be republished as v12.0.0-alpha.15-1 for exactly this reason). All three products now get the same deliberate human publish gate.
  • Rust and pnpr drafts carry their changelogs. Only the TypeScript release had generated notes; the Rust and pnpr drafts were empty. Each draft's body is now filled from the product's pending changelog written by pnpm version -r (.changeset/changelogs/pacquet@<version>.md / .changeset/changelogs/@pnpm!pnpr@<version>.md), with a warning fallback to an empty description if the file is missing.

The dispatch logic was exercised locally against the live registry for all six cases: the three current tags route to their own product (and skip, as all are published), v9.9.9 / [email protected] fail with a clear error, and a branch ref (the verify_ts_release dispatch path) releases nothing. Validated with actionlint (only pre-existing runner-label complaints) and zizmor (no findings).

Squash Commit Body

The plan job released every product whose committed version was missing
from npm, regardless of which tag triggered the run. Combined with the
shared release concurrency group - GitHub keeps at most one pending run
per group and cancels the rest - a multi-product release PR could get a
product's run evicted from the queue and its release performed under a
sibling product's tag. This published the v11.15.0 artifacts and notes
on the v12.0.0-alpha.15 release page
(https://github.com/pnpm/pnpm/actions/runs/29644133887).

Now the tag is the dispatch key: a run releases exactly the product
whose committed version the tag names, and a tag matching no product
fails the plan. The npm check remains as an idempotency guard, so
rerunning a tag resumes a partial release and a completed tag skips
every job. The concurrency group is scoped per ref so simultaneous tags
run in parallel instead of sharing a queue that evicts pending runs;
per-product runs publish disjoint packages, making parallelism safe.

The TypeScript GitHub-release step additionally pins tag_name and name
to the planned version, and both GitHub-release jobs assert that the
version tag points at the commit the run built, since the dispatch
matches version strings and cannot prove tag-commit identity. The Rust
job's target_commitish cannot enforce this - GitHub ignores it whenever
the tag already exists.

Checklist

  • The change covers the release paths of both the TypeScript CLI and the Rust pnpm/ port (workflow-only change; no product code affected).
  • No changeset: no published package is affected.
  • No tests: release workflow YAML; the dispatch script was exercised locally for all six ref cases, and the file passes actionlint and zizmor.

Written by an agent (Claude Code, claude-fable-5).

Summary by CodeRabbit

  • Release Process Improvements
    • Release workflows now run independently for each release tag.
    • Releases are created as drafts with explicit tags, names, release notes, and artifacts.
    • Added support for drafting pnpr releases.
    • Added safeguards to prevent releases when tags do not match the intended commit or product version.
    • Improved handling of unpublished package versions during release planning.

The TypeScript release job created its GitHub release without a tag_name,
so softprops/action-gh-release fell back to the tag that triggered the
run. When a multi-product release PR pushes several tags at once, the
release concurrency queue keeps only one pending run and cancels the
rest, so the surviving run resumes every unpublished product - and the
TypeScript release can run under another product's tag. This published
the v11.15.0 artifacts and notes on the v12.0.0-alpha.15 release page
(https://github.com/pnpm/pnpm/actions/runs/29644133887).

Pin tag_name (and name) to the planned TypeScript version, and add a
guard to both GitHub-release jobs asserting that the version tag points
at the commit the run built, so a release resumed from a different
release commit fails loudly instead of publishing artifacts on the
wrong tag or commit. The Rust job's target_commitish cannot enforce
this: GitHub ignores it whenever the tag already exists.
Copilot AI review requested due to automatic review settings July 18, 2026 13:31

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cb5126b3-d376-490b-a82e-00cb6164a2b3

📥 Commits

Reviewing files that changed from the base of the PR and between e470b0c and fc210c6.

📒 Files selected for processing (1)
  • .github/workflows/release.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

The release workflow now scopes concurrency per tag ref, selects only the product matching the pushed version tag, verifies release tags against the current workflow commit, makes TypeScript and Rust draft metadata explicit, and adds pnpr draft release creation.

Changes

Release workflow

Layer / File(s) Summary
Release selection and concurrency
.github/workflows/release.yml
Per-ref concurrency is used, and planning enables only the product whose committed version matches the pushed tag; unmatched tags fail planning.
Tag validation and release metadata
.github/workflows/release.yml
TypeScript and Rust jobs verify tag commits against GITHUB_SHA; release descriptions and TypeScript/Rust draft metadata are configured explicitly, and TypeScript publishing is removed.
pnpr release drafting
.github/workflows/release.yml
A pnpr job verifies the tag commit, prepares RELEASE.md, and creates a draft release with pnpr metadata and artifacts.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant PlanJob
  participant ReleaseJob
  participant GitHubAPI
  GitHubActions->>PlanJob: Provide pushed product tag
  PlanJob->>PlanJob: Match tag to committed product version
  PlanJob-->>ReleaseJob: Enable matching release job
  ReleaseJob->>GitHubAPI: Resolve version-tag commit SHA
  GitHubAPI-->>ReleaseJob: Return tag commit SHA
  ReleaseJob->>ReleaseJob: Compare tag SHA with GITHUB_SHA
  ReleaseJob->>GitHubAPI: Create draft release with explicit metadata
Loading

Possibly related PRs

  • pnpm/pnpm#13064: Updates the same release workflow’s GitHub release drafting, RELEASE.md, and tag/body verification behavior.

Suggested reviewers: copilot, qodo-code-review

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-release

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Pin GitHub release creation to each product’s planned version tag

🐞 Bug fix ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Pin TypeScript GitHub release creation to the planned ts_version tag.
• Add tag→commit guards so resumed runs fail instead of publishing mismatched artifacts.
• Apply the same invariant check to the Rust GitHub release job.
Diagram

graph TD
  W["Release workflow run"] --> P["Plan job"]
  P --> TS["TS release job"] --> TG["Tag→commit guard (TS)"] --> ACT["softprops/action-gh-release"] --> R{{"GitHub Releases"}}
  P --> RUST["Rust GH-release job"] --> RG["Tag→commit guard (Rust)"] --> ACT
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Split release workflow per product (separate workflows/concurrency groups)
  • ➕ Eliminates cross-product ‘resume’ behavior entirely; each tag/run only handles one product.
  • ➕ Simplifies reasoning about what github.ref means in each workflow.
  • ➖ More workflows to maintain; duplicated logic across pipelines.
  • ➖ Harder to coordinate multi-product release PRs and shared steps (provenance, notes, etc.).
2. Change concurrency strategy to avoid canceling pending runs
  • ➕ Avoids the ‘surviving run resumes other products’ scenario that triggered the incident.
  • ➕ Reduces need for defensive checks inside jobs.
3. Replace softprops/action-gh-release with explicit gh CLI release creation
  • ➕ Full control over tag selection and additional validation in one place.
  • ➕ Potentially simpler debugging (single CLI surface).
  • ➖ Higher risk change to a sensitive pipeline; softprops is already battle-tested here.
  • ➖ Requires re-validating behavior parity (drafts, asset uploads, output ids, etc.).

Recommendation: Keep the PR’s approach: explicitly pin tag_name/name for the TS release and add a tag→commit invariant guard for both TS and Rust release jobs. This is the smallest, most targeted mitigation for the concurrency/resume behavior, and it fails loudly before publishing when a run’s commit doesn’t match the intended version tag.

Files changed (1) +37 / -0

Bug fix (1) +37 / -0
release.ymlPin TS GitHub release tag and add tag→commit guards for TS/Rust releases +37/-0

Pin TS GitHub release tag and add tag→commit guards for TS/Rust releases

• Adds a preflight step in the TypeScript release job and the Rust GitHub-release job that asserts v<VERSION> resolves to the current run commit via the GitHub API. Also pins the TypeScript softprops/action-gh-release invocation with an explicit tag_name and release name derived from the plan job outputs to prevent falling back to github.ref.

.github/workflows/release.yml

@qodo-code-review

qodo-code-review Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (4) 📘 Rule violations (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 18 rules

Grey Divider


Remediation recommended

1. Draft state unverified 🐞 Bug ≡ Correctness ⭐ New
Description
The new “Verify draft release” step fetches the release JSON but only compares the body to
RELEASE.md; it never asserts the release is still a draft, despite the workflow’s stated invariant
that releases must remain drafts until a maintainer publishes them. This can let an unexpected
non-draft state go undetected (e.g., if the action targets an existing non-draft release for the
tag), undermining the intended manual publish gate.
Code

.github/workflows/release.yml[R437-440]

+      - name: Verify draft release
        env:
          GH_TOKEN: ${{ github.token }}
          RELEASE_ID: ${{ steps.github-release.outputs.id }}
Evidence
The workflow explicitly intends to keep the TypeScript GitHub release as a draft (draft: true) but
the new verification step only reads and compares .body, never checking .draft even though it
has the full JSON response available.

.github/workflows/release.yml[426-451]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The workflow step named **"Verify draft release"** does not verify the release is a draft; it only compares `body`.

### Issue Context
The preceding release step explicitly sets `draft: true` to enforce a deliberate maintainer publish gate. The verification step already fetches the full release JSON, so it can also assert `draft === true` (and optionally `tag_name` matches the expected tag).

### Fix Focus Areas
- .github/workflows/release.yml[437-451]

### Suggested change
In the inline Node script, parse and assert:
- `release.draft === true`
- (optional but consistent with the intent) `release.tag_name === "v${{ needs.plan.outputs.ts_version }}"`
Fail the step with a clear error message if the invariant is violated.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Windows pnpr lacks checksum 🐞 Bug ⛨ Security
Description
The new pnpr GitHub release uploads pnpr-*.zip assets, but the build only generates pnpr-*.sha256
files on non-Windows runners, so Windows release artifacts ship without a repository-provided
checksum and verification metadata is inconsistent across platforms.
Code

.github/workflows/release.yml[R1319-1322]

+          files: |
+            pnpr-*.tar.gz
+            pnpr-*.zip
+            pnpr-*.sha256
Evidence
The new pnpr release job publishes zips and sha256 files, but only non-Windows builds create sha256
outputs; Windows builds only create a zip, so the release will necessarily include Windows zip
assets without a corresponding checksum file.

.github/workflows/release.yml[1278-1322]
.github/workflows/release.yml[983-1001]
.github/workflows/release.yml[992-1001]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`github-release-pnpr` uploads `pnpr-*.zip` and `pnpr-*.sha256`, but Windows builds currently only create a `.zip` and never produce a matching `.sha256`. This makes the GitHub release’s integrity metadata inconsistent across platforms.

### Issue Context
- Non-Windows builds create `pnpr-<target>.sha256` via `shasum -a 256 $BIN_NAME > $BIN_NAME.sha256`.
- Windows builds create `pnpr-<target>.zip` but no checksum file.
- The new release job publishes both zips and sha256 files.

### Fix Focus Areas
- .github/workflows/release.yml[983-1017]
- .github/workflows/release.yml[1278-1322]

### Implementation notes
- In the Windows `Archive Binary` step, add a checksum generation step (either for the zipped archive `pnpr-<target>.zip` or for the contained `pnpr-<target>.exe`, but keep naming/documentation consistent with what you publish).
- Ensure the checksum file is included in the uploaded artifact so `github-release-pnpr` can publish it.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Redundant Never cancel comment 📘 Rule violation ⚙ Maintainability
Description
The comment Never cancel a run mid-publish. restates intent without adding rationale or
constraints, making it redundant alongside the surrounding workflow configuration. This violates the
guideline to avoid comments that only repeat what the code already conveys.
Code

.github/workflows/release.yml[38]

+# Never cancel a run mid-publish.
Evidence
The compliance checklist prohibits redundant comments that merely restate what the code implies; the
added/modified line Never cancel a run mid-publish. provides no additional rationale beyond the
surrounding workflow logic.

Rule 713467: Avoid redundant comments that restate the code
.github/workflows/release.yml[31-38]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A new/modified comment restates behavior (“Never cancel a run mid-publish.”) without adding any new intent/rationale, which is discouraged.

## Issue Context
This is in the workflow-level concurrency comment block.

## Fix Focus Areas
- .github/workflows/release.yml[31-38]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (1)
4. No retry on gh api 🐞 Bug ☼ Reliability
Description
Both new “Assert the version tag points at this commit” guards rely on a single gh api call;
transient GitHub API/network failures (or occasional rate limits) will fail the release job and
force a manual rerun even though nothing is actually wrong with the tag↔commit invariant. Adding a
small retry/backoff loop (and an explicit empty-result diagnostic) would reduce release flakiness in
this critical publish workflow.
Code

.github/workflows/release.yml[R321-323]

+          tag_commit=$(gh api "repos/${GITHUB_REPOSITORY}/commits/v${VERSION}" --jq .sha)
+          if [ "$tag_commit" != "$GITHUB_SHA" ]; then
+            echo "::error::Tag v${VERSION} points at ${tag_commit}, but this run would release commit ${GITHUB_SHA}. Rerun the release workflow from the v${VERSION} tag."
Evidence
The release workflow adds two new guards that each do a single gh api request to fetch the tag’s
commit SHA; there is no retry/backoff around this network call. Other workflows in this repo that
depend on GitHub API calls use retry loops to avoid transient failures, demonstrating an established
resiliency pattern.

.github/workflows/release.yml[309-325]
.github/workflows/release.yml[798-812]
.github/workflows/pr-review-automation-privileged.yml[95-108]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The new tag↔commit invariant checks call `gh api` once to resolve `v${VERSION}` → commit SHA. If the GitHub API request fails transiently, the job fails and requires a rerun, adding avoidable operational burden during releases.

### Issue Context
This is a fail-closed safety check (good), but it should be resilient to transient API failures. The repo already uses retry patterns around GitHub API usage in other workflows.

### Fix Focus Areas
- .github/workflows/release.yml[309-325]
- .github/workflows/release.yml[798-812]
- .github/workflows/pr-review-automation-privileged.yml[95-108]

### Suggested change
Wrap the `gh api ... --jq .sha` call in a small retry loop (e.g., 5 attempts with incremental sleep), and after the loop emit a targeted `::error::` indicating whether the tag could not be resolved vs. a true mismatch.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

5. Empty release body unflagged 🐞 Bug ◔ Observability ⭐ New
Description
The new Rust and pnpr “Generate release description” steps write RELEASE.md from a changelog file
when it exists, but they do not warn when the generated RELEASE.md is empty (e.g., the changelog
contains only its heading). Because the subsequent GitHub release steps always use `body_path:
RELEASE.md`, this can draft releases with a blank description without the explicit warning path
intended for missing changelogs.
Code

.github/workflows/release.yml[R856-871]

+      - name: Generate release description
+        # The pending changelog written by `pnpm version -r` holds exactly this
+        # version's entry; its first line is a `## <version>` heading, redundant
+        # under the release title. A missing changelog only warns: the draft is
+        # still worth having for its artifacts, and a maintainer can fill in
+        # the description before publishing.
+        env:
+          VERSION: ${{ needs.plan.outputs.rust_version }}
+        run: |
+          changelog=".changeset/changelogs/pacquet@${VERSION}.md"
+          if [ -f "$changelog" ]; then
+            tail -n +2 "$changelog" | sed '/./,$!d' > RELEASE.md
+          else
+            echo "::warning::No pending changelog at ${changelog}; drafting the release with an empty description"
+            : > RELEASE.md
+          fi
Evidence
Both jobs generate RELEASE.md via tail -n +2 ... > RELEASE.md when the changelog exists, and both
later use body_path: RELEASE.md for the GitHub release, but only the missing-changelog branch
emits a warning—there is no warning for the empty-output case.

.github/workflows/release.yml[856-890]
.github/workflows/release.yml[1337-1364]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The Rust and pnpr GitHub-release jobs can generate an empty `RELEASE.md` without emitting any warning when the changelog file exists but has no content beyond the version heading.

### Issue Context
Both jobs then pass `body_path: RELEASE.md` to `softprops/action-gh-release`, so the release draft ends up with an empty body.

### Fix Focus Areas
- .github/workflows/release.yml[856-872]
- .github/workflows/release.yml[1337-1350]

### Suggested change
After generating `RELEASE.md` in the `-f "$changelog"` branch, add a size/content check:
- If `! test -s RELEASE.md`, emit a `::warning::` explaining the changelog had no content after stripping the heading (or choose to `exit 1` if empty bodies are not acceptable).
Apply the same pattern to both Rust and pnpr jobs.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit fc210c6

Results up to commit 7829686


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. No retry on gh api 🐞 Bug ☼ Reliability
Description
Both new “Assert the version tag points at this commit” guards rely on a single gh api call;
transient GitHub API/network failures (or occasional rate limits) will fail the release job and
force a manual rerun even though nothing is actually wrong with the tag↔commit invariant. Adding a
small retry/backoff loop (and an explicit empty-result diagnostic) would reduce release flakiness in
this critical publish workflow.
Code

.github/workflows/release.yml[R321-323]

+          tag_commit=$(gh api "repos/${GITHUB_REPOSITORY}/commits/v${VERSION}" --jq .sha)
+          if [ "$tag_commit" != "$GITHUB_SHA" ]; then
+            echo "::error::Tag v${VERSION} points at ${tag_commit}, but this run would release commit ${GITHUB_SHA}. Rerun the release workflow from the v${VERSION} tag."
Evidence
The release workflow adds two new guards that each do a single gh api request to fetch the tag’s
commit SHA; there is no retry/backoff around this network call. Other workflows in this repo that
depend on GitHub API calls use retry loops to avoid transient failures, demonstrating an established
resiliency pattern.

.github/workflows/release.yml[309-325]
.github/workflows/release.yml[798-812]
.github/workflows/pr-review-automation-privileged.yml[95-108]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The new tag↔commit invariant checks call `gh api` once to resolve `v${VERSION}` → commit SHA. If the GitHub API request fails transiently, the job fails and requires a rerun, adding avoidable operational burden during releases.

### Issue Context
This is a fail-closed safety check (good), but it should be resilient to transient API failures. The repo already uses retry patterns around GitHub API usage in other workflows.

### Fix Focus Areas
- .github/workflows/release.yml[309-325]
- .github/workflows/release.yml[798-812]
- .github/workflows/pr-review-automation-privileged.yml[95-108]

### Suggested change
Wrap the `gh api ... --jq .sha` call in a small retry loop (e.g., 5 attempts with incremental sleep), and after the loop emit a targeted `::error::` indicating whether the tag could not be resolved vs. a true mismatch.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit 82a2bae


🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Redundant Never cancel comment 📘 Rule violation ⚙ Maintainability
Description
The comment Never cancel a run mid-publish. restates intent without adding rationale or
constraints, making it redundant alongside the surrounding workflow configuration. This violates the
guideline to avoid comments that only repeat what the code already conveys.
Code

.github/workflows/release.yml[38]

+# Never cancel a run mid-publish.
Evidence
The compliance checklist prohibits redundant comments that merely restate what the code implies; the
added/modified line Never cancel a run mid-publish. provides no additional rationale beyond the
surrounding workflow logic.

Rule 713467: Avoid redundant comments that restate the code
.github/workflows/release.yml[31-38]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A new/modified comment restates behavior (“Never cancel a run mid-publish.”) without adding any new intent/rationale, which is discouraged.

## Issue Context
This is in the workflow-level concurrency comment block.

## Fix Focus Areas
- .github/workflows/release.yml[31-38]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit e470b0c


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Windows pnpr lacks checksum 🐞 Bug ⛨ Security
Description
The new pnpr GitHub release uploads pnpr-*.zip assets, but the build only generates pnpr-*.sha256
files on non-Windows runners, so Windows release artifacts ship without a repository-provided
checksum and verification metadata is inconsistent across platforms.
Code

.github/workflows/release.yml[R1319-1322]

+          files: |
+            pnpr-*.tar.gz
+            pnpr-*.zip
+            pnpr-*.sha256
Evidence
The new pnpr release job publishes zips and sha256 files, but only non-Windows builds create sha256
outputs; Windows builds only create a zip, so the release will necessarily include Windows zip
assets without a corresponding checksum file.

.github/workflows/release.yml[1278-1322]
.github/workflows/release.yml[983-1001]
.github/workflows/release.yml[992-1001]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`github-release-pnpr` uploads `pnpr-*.zip` and `pnpr-*.sha256`, but Windows builds currently only create a `.zip` and never produce a matching `.sha256`. This makes the GitHub release’s integrity metadata inconsistent across platforms.

### Issue Context
- Non-Windows builds create `pnpr-<target>.sha256` via `shasum -a 256 $BIN_NAME > $BIN_NAME.sha256`.
- Windows builds create `pnpr-<target>.zip` but no checksum file.
- The new release job publishes both zips and sha256 files.

### Fix Focus Areas
- .github/workflows/release.yml[983-1017]
- .github/workflows/release.yml[1278-1322]

### Implementation notes
- In the Windows `Archive Binary` step, add a checksum generation step (either for the zipped archive `pnpr-<target>.zip` or for the contained `pnpr-<target>.exe`, but keep naming/documentation consistent with what you publish).
- Ensure the checksum file is included in the uploaded artifact so `github-release-pnpr` can publish it.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

@greptile-apps

greptile-apps Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5

The core dispatch and concurrency fixes are correct and well-structured; the TypeScript release path is fully guarded before any npm publish. The Rust and pnpr paths publish to npm before the tag↔commit assertion fires, leaving a narrow window where wrong-commit binaries could reach the registry undetected if the tag is force-pushed during the multi-hour build matrix.

The tag-dispatch logic, per-ref concurrency group, and explicit TypeScript release identity are all correct. The remaining gap — that the commit guard for Rust and pnpr runs in github-release-* after publish-rust/publish-pnpr have already made npm packages immutable — was flagged in the previous review round and is not yet addressed.

.github/workflows/release.yml — specifically the publish-rust and publish-pnpr jobs, which lack an early-exit commit guard analogous to the one at the top of the TypeScript release job.

Reviews (3): Last reviewed commit: "fix(releasing): draft every product's Gi..." | Re-trigger Greptile

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 18, 2026
@qodo-code-review

qodo-code-review Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

PR Code Suggestions ✨

Latest suggestions up to fc210c6

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

CategorySuggestion                                                                                                                                    Impact
Possible issue
Preserve partial-release rerun recovery

Decouple the GitHub release job's execution condition from the npm publication
check. Add a separate check for the GitHub release existence to allow
automatically rerunning the draft creation if it fails.

.github/workflows/release.yml [1304-1312]

+# In the plan job, expose independent publication and GitHub-release gates:
+PNPR_NPM_NEEDS=false
+PNPR_GITHUB_NEEDS=false
+...
+PNPR_NPM_NEEDS=$(needs_release "@pnpm/pnpr@$PNPR_VERSION")
+if gh release view "pnpr@${PNPR_VERSION}" > /dev/null 2>&1; then
+  PNPR_GITHUB_NEEDS=false
+else
+  PNPR_GITHUB_NEEDS=true
+fi
+...
+echo "pnpr_npm=$PNPR_NPM_NEEDS"
+echo "pnpr_github=$PNPR_GITHUB_NEEDS"
+
+# Run artifact creation when either operation remains pending, publish npm
+# only for `pnpr_npm`, and run this job only for `pnpr_github`.
 github-release-pnpr:
-  name: Draft GitHub release for pnpr
-  runs-on: blacksmith-4vcpu-ubuntu-2404
-  permissions:
-    contents: write # create the draft release on the pnpr tag
+  if: needs.plan.outputs.pnpr_github == 'true'
   needs:
     - plan
     - build-pnpr
-    - publish-pnpr

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 5

__

Why: The suggestion correctly identifies an edge case where a failed draft release cannot be automatically retried if the npm publication succeeds, though the proposed fix adds some complexity for a non-critical draft step.

Low
  • More

Previous suggestions

Suggestions up to commit e470b0c
CategorySuggestion                                                                                                                                    Impact
Possible issue
Preserve partial-release recovery

Remove publish-pnpr from the needs list of the GitHub release job, and instead
make publish-pnpr depend on this job to ensure the npm publication remains the
final release operation.

.github/workflows/release.yml [1283-1286]

 needs:
   - plan
   - build-pnpr
-  - publish-pnpr
Suggestion importance[1-10]: 9

__

Why: The suggestion accurately identifies that depending on publish-pnpr breaks the retry mechanism, preventing recovery if the GitHub release job fails after publication succeeds.

High
Suggestions
CategorySuggestion                                                                                                                                    Impact
Possible issue
Preserve branch artifact verification

Add an if condition to the version tag assertion step to skip it when the
workflow is not triggered by a tag. This prevents branch-triggered verification
runs from failing.

.github/workflows/release.yml [341-355]

 - name: Assert the version tag points at this commit
-  # The plan job dispatches on the tag's version string, which cannot
-  # prove the tag points at this commit — a retagged release, or another
-  # commit carrying the same committed version, would still dispatch.
-  # The artifacts built below and the GitHub release that lands on
-  # v<ts_version> must both come from the commit that tag names.
+  if: ${{ github.ref_type == 'tag' }}
   env:
     GH_TOKEN: ${{ github.token }}
     VERSION: ${{ needs.plan.outputs.ts_version }}
   run: |
     tag_commit=$(gh api "repos/${GITHUB_REPOSITORY}/commits/v${VERSION}" --jq .sha)
     if [ "$tag_commit" != "$GITHUB_SHA" ]; then
       echo "::error::Tag v${VERSION} points at ${tag_commit}, but this run would release commit ${GITHUB_SHA}. Rerun the release workflow from the v${VERSION} tag."
       exit 1
     fi
Suggestion importance[1-10]: 9

__

Why: The suggestion identifies a critical bug where the new assertion step would incorrectly fail branch-triggered workflow dispatch runs for verifying release artifacts.

High

The plan job released every product whose committed version was missing
from npm, regardless of which tag triggered the run. Combined with the
shared release concurrency group - GitHub keeps at most one pending run
per group and cancels the rest - a multi-product release PR could get a
product's run evicted from the queue and its release performed under a
sibling product's tag.

Now the tag is the dispatch key: a run releases exactly the product
whose committed version the tag names, and a tag matching no product
fails the plan. The npm check remains as an idempotency guard, so
rerunning a tag resumes a partial release and a completed tag skips
every job. The concurrency group is scoped per ref so simultaneous tags
run in parallel instead of sharing a queue that evicts pending runs;
per-product runs publish disjoint packages, making parallelism safe.
@zkochan zkochan changed the title fix(releasing): pin GitHub releases to their product's version tag fix(releasing): release each product only from its own version tag Jul 18, 2026
Copilot AI review requested due to automatic review settings July 18, 2026 13:45

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 82a2bae

pnpr published to npm, GHCR, and Docker but never got a GitHub release
page, unlike both pnpm CLIs. Add a github-release-pnpr job mirroring
github-release-rust: it asserts the pnpr@<version> tag points at the
built commit, then drafts a release on that tag with the platform
archives and their build-time checksums, prerelease-flagged for alpha
versions and kept off the repository Latest badge.

Supersedes the GitHub-release part of
#12963, adapted to the pnpr@<version>
tag namespace that landed instead of pnpr-v<version>.
@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

CategorySuggestion                                                                                                                                    Impact
Possible issue
Preserve branch artifact verification

Add an if condition to the version tag assertion step to skip it when the
workflow is not triggered by a tag. This prevents branch-triggered verification
runs from failing.

.github/workflows/release.yml [341-355]

 - name: Assert the version tag points at this commit
-  # The plan job dispatches on the tag's version string, which cannot
-  # prove the tag points at this commit — a retagged release, or another
-  # commit carrying the same committed version, would still dispatch.
-  # The artifacts built below and the GitHub release that lands on
-  # v<ts_version> must both come from the commit that tag names.
+  if: ${{ github.ref_type == 'tag' }}
   env:
     GH_TOKEN: ${{ github.token }}
     VERSION: ${{ needs.plan.outputs.ts_version }}
   run: |
     tag_commit=$(gh api "repos/${GITHUB_REPOSITORY}/commits/v${VERSION}" --jq .sha)
     if [ "$tag_commit" != "$GITHUB_SHA" ]; then
       echo "::error::Tag v${VERSION} points at ${tag_commit}, but this run would release commit ${GITHUB_SHA}. Rerun the release workflow from the v${VERSION} tag."
       exit 1
     fi
  • Apply / Chat
Suggestion importance[1-10]: 9

__

Why: The suggestion identifies a critical bug where the new assertion step would incorrectly fail branch-triggered workflow dispatch runs for verifying release artifacts.

High
  • More

Copilot AI review requested due to automatic review settings July 18, 2026 13:48

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit e470b0c

The TypeScript job verified its draft's body and then flipped it to
published in the same run, while the Rust and pnpr jobs leave drafts
for a maintainer. The repository uses immutable releases, so publishing
is the point of no return: a wrong published release cannot be
corrected, only deleted, and deletion burns its tag for releases
forever. Keep the TypeScript release a draft too, so every product
gets the same deliberate human publish.

The Rust and pnpr drafts also had empty descriptions: only the
TypeScript job generated release notes. Fill each draft's body from
the product's pending changelog written by pnpm version -r
(.changeset/changelogs/pacquet@<version>.md and
.changeset/changelogs/[at]pnpm!pnpr@<version>.md), stripping the
version heading that the release title already carries. A missing
changelog warns instead of failing: the draft is still worth having
for its artifacts.
Copilot AI review requested due to automatic review settings July 18, 2026 14:18

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit fc210c6

@zkochan
zkochan merged commit b55e0d8 into main Jul 18, 2026
25 checks passed
@zkochan
zkochan deleted the fix-release branch July 18, 2026 16:49
@coderabbitai coderabbitai Bot mentioned this pull request Aug 3, 2026
2 tasks done
@coderabbitai coderabbitai Bot mentioned this pull request Aug 4, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants