fix(release): write release artifacts to the repo-root dist#12545
Conversation
The TypeScript stack was relocated under pnpm11/ in #12537, which moved copy-artifacts.ts to pnpm11/__utils__/scripts/src/. Its `import.meta.dirname` + '../../..' now resolves to the pnpm11/ directory instead of the repository root, so `pn copy-artifacts` wrote the release tarballs to pnpm11/dist. The Release workflow attests (`subject-path: 'dist/*'`) and uploads (`files: dist/*`) from the repo-root dist, so a tagged release would have produced a GitHub Release with no binary assets and a failing provenance attestation, even though the npm publishes (filtered by package name) still succeeded. Resolve repoRoot to the actual repository root again and point the artifact source directories at their new pnpm11/pnpm/ locations.
📝 WalkthroughWalkthroughThree directory path constants in ChangesPath Root Correction in copy-artifacts Script
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested labels
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. 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 QodoFix release artifact copying to write into repo-root dist/ Description
Diagram
High-Level Assessment
Files changed (1)
|
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 `@pnpm11/__utils__/scripts/src/copy-artifacts.ts`:
- Around line 10-13: Add a regression test for the artifact path resolution in
the copy-artifacts script. The test should verify that when the copy-artifacts
functionality executes, it correctly resolves the repoRoot variable and places
artifacts in the repo-root dist directory rather than in pnpm11/dist. The test
should fail if the path resolution reverts to the broken behavior (using
relative paths instead of the corrected repoRoot-based paths shown in the diff).
Ensure the test validates both the source paths (artifactsDir and pnpmDistDir)
and destination path (dest) are correctly resolved relative to the repository
root.
🪄 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: 39907651-184b-4d46-a257-d3011302b74a
📒 Files selected for processing (1)
pnpm11/__utils__/scripts/src/copy-artifacts.ts
| const repoRoot = path.join(import.meta.dirname, '../../../..') | ||
| const dest = path.join(repoRoot, 'dist') | ||
| const artifactsDir = path.join(repoRoot, 'pnpm/artifacts') | ||
| const pnpmDistDir = path.join(repoRoot, 'pnpm/dist') | ||
| const artifactsDir = path.join(repoRoot, 'pnpm11/pnpm/artifacts') | ||
| const pnpmDistDir = path.join(repoRoot, 'pnpm11/pnpm/dist') |
There was a problem hiding this comment.
Add a regression test for repo-root dist/* artifact output.
This fixes a previously broken root resolution path, but there’s no regression test in the provided changes to lock the contract. Please add/adjust a test that fails with the old resolution and asserts tarballs are produced under repo-root dist/* (not pnpm11/dist/*).
As per coding guidelines, REVIEW_GUIDE.md (§7) explicitly requires a regression test for this repoRoot/artifactsDir resolution behavior.
🤖 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 `@pnpm11/__utils__/scripts/src/copy-artifacts.ts` around lines 10 - 13, Add a
regression test for the artifact path resolution in the copy-artifacts script.
The test should verify that when the copy-artifacts functionality executes, it
correctly resolves the repoRoot variable and places artifacts in the repo-root
dist directory rather than in pnpm11/dist. The test should fail if the path
resolution reverts to the broken behavior (using relative paths instead of the
corrected repoRoot-based paths shown in the diff). Ensure the test validates
both the source paths (artifactsDir and pnpmDistDir) and destination path (dest)
are correctly resolved relative to the repository root.
Source: Coding guidelines
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require review
Previous review resultsReview updated until commit 8455790 Results up to commit 8455790
Great, no issues found!Qodo reviewed your code and found no material issues that require review
|
|
Code review by qodo was updated up to the latest commit 8455790 |
Summary
While checking the release pipeline after the
pnpm11/relocation (#12537), I found thatpn copy-artifactsno longer writes to the directory the Release workflow reads from.copy-artifacts.tsmoved topnpm11/__utils__/scripts/src/, so itsimport.meta.dirname+'../../..'now resolves to thepnpm11/directory instead of the repository root. As a result:destbecamepnpm11/distinstead of the repo-rootdist.release.ymlattests (subject-path: 'dist/*') and uploads (files: dist/*') from the repo-rootdist. So a tagged release would publish to npm fine (those steps filter by package name) but produce a GitHub Release with no binary assets and a failing build-provenance attestation.This restores
repoRootto the actual repository root and points the artifact source dirs at their newpnpm11/pnpm/locations. The resolvedartifactsDir/pnpmDistDirare unchanged; onlydestis corrected back to the repo root.The other pnpm release-related workflows (
release.yml,create-release-pr.yml,update-latest.yml,docker.yml) were also reviewed and reference packages by name or already-updatedpnpm11/...paths, so they remain correct.Squash Commit Body
Checklist
pacquet/port, or the description notes what still needs porting. (Release tooling only; no pacquet port needed.)pnpm changeset) if this PR changes any published package. (Internal release script in a private package; nothing published changes.)Written by an agent (Claude Code, claude-opus-4-8).
Summary by CodeRabbit