Repository navigation
chore(release): key changeset-released ledger by target branch - #12201
Conversation
Releases now land via a PR from an ad-hoc branch rather than a commit pushed straight to the target, so `bump.ts` keyed the ledger off the ephemeral PR branch and scattered each release into its own file instead of accumulating in `main.txt`. Recover the target from a `release-pr/<target>` branch name, add a manually-dispatched workflow that creates such a PR, and drop the accumulated per-PR ledger files (verified inert: no overlap with pending changesets, no live branch reintroduces a released changeset on merge).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (13)
💤 Files with no reviewable changes (9)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (10)📓 Common learnings📚 Learning: 2026-05-25T12:36:42.202ZApplied to files:
📚 Learning: 2026-05-29T18:03:15.372ZApplied to files:
📚 Learning: 2026-05-25T12:36:42.202ZApplied to files:
📚 Learning: 2026-05-20T21:18:56.391ZApplied to files:
📚 Learning: 2026-05-29T18:03:15.372ZApplied to files:
📚 Learning: 2026-05-29T18:03:15.372ZApplied to files:
📚 Learning: 2026-05-14T09:04:00.133ZApplied to files:
📚 Learning: 2026-05-25T12:36:42.202ZApplied to files:
📚 Learning: 2026-05-25T12:36:42.202ZApplied to files:
🔇 Additional comments (17)
📝 WalkthroughWalkthroughThis PR implements automated release PR creation for pnpm. It introduces a new GitHub Actions workflow that manually triggers release PR preparation, a branch normalization helper to map ephemeral ChangesRelease PR Automation with Branch Normalization
Sequence DiagramsequenceDiagram
participant User
participant Workflow as create-release-pr.yml
participant BumpScript as pnpm bump
participant Git
participant GitAPI as GitHub API
User->>Workflow: Trigger with target=main
Workflow->>Git: Fetch target, create release-pr/main
Workflow->>BumpScript: Run pnpm bump
BumpScript->>BumpScript: detectReleaseBranch() → normalize to main
BumpScript->>BumpScript: Update .changeset-released/main.txt
Workflow->>Git: Commit and force-push release-pr/main
Workflow->>GitAPI: Check for existing PR
alt No PR exists
Workflow->>GitAPI: Create PR: release-pr/main → main
else PR exists
Workflow->>Workflow: Skip PR creation
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Review Summary by QodoKey changeset-released ledger by target branch via release-pr workflow
WalkthroughsDescription• Recover release target from release-pr/ branch naming convention • Add releaseBranchToTarget() function to extract target from PR branch names • Create manually-dispatched workflow to generate release PRs with correct branch naming • Clean up 9 accumulated per-PR ledger files that fragmented release history • Update documentation explaining the release-PR branch naming convention Diagramflowchart LR
A["Release PR Branch<br/>release-pr/target"] -->|"releaseBranchToTarget()"| B["Extract Target<br/>main, release/11.1"]
B -->|"branchToFilename()"| C["Ledger File<br/>main.txt, release-11.1.txt"]
D["create-release-pr.yml<br/>Workflow"] -->|"Creates branch"| A
D -->|"Runs pnpm bump"| E["Consolidate<br/>Changesets"]
E -->|"Writes to"| C
File Changes1. __utils__/scripts/src/bump.ts
|
Problem
Releases now land via a PR from an ad-hoc branch (
new-release,release2,bump-versions, …) rather than a commit pushed straight to the target branch.__utils__/scripts/src/bump.tskeyed the.changeset-releasedledger offgit rev-parse --abbrev-ref HEAD— the current branch — so every release scattered into a new per-PR file instead of accumulating inmain.txt. No correctness bug (the wrapper reads the union of all*.txt), but the ledger fragmented into 9 stray files.Changes
bump.ts: new exportedreleaseBranchToTarget()recovers the target from arelease-pr/<target>branch name (slashes preserved, e.g.release-pr/release/11.1→release-11.1.txt); a bare name is its own target. Applied to both the detected branch andRELEASE_BRANCH. RenameddetectCurrentBranch→detectReleaseBranch. Added 4 tests (all 20 pass)..github/workflows/create-release-pr.yml(new): manually-dispatched workflow with atargetinput (defaultmain). Checks outrelease-pr/<target>, runspnpm bump, commitschore(release): <version>, force-pushes, and opens/reuses a PR against the target. The branch convention makes the ledger key itself automatically..txtfiles. Verified safe — zero overlap with the 11 pending changesets, and no live branch (release-fix,release/11.1) reintroduces an already-released changeset on a normal merge (confirmed via merge-base). The mechanism is kept and self-heals: the next release writes a freshmain.txt.release-pr/<target>convention.Notes
secrets.UPDATE_LOCKFILE_TOKEN(the existing write+PR PAT, so the release PR triggers CI). Swap for a dedicated release secret if preferred.@pnpm/scriptsis private and.githubisn't published.Written by an agent (Claude Code, claude-opus-4-8).
Summary by CodeRabbit
New Features
Documentation
Chores