make changeset publishing more robust#6895
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe release script now collects consecutive release commits to derive current and previous release points, computes commit ranges accordingly, groups conventional commits by type (with an "Other" bucket), resolves author usernames via GitHub API, and adds conditional Changes
Sequence DiagramsequenceDiagram
actor User
participant Script as Release Script
participant Git
participant GHUsers as GitHub API<br/>(Users)
participant GHRelease as GitHub API<br/>(Releases)
User->>Script: run create-github-release
Script->>Git: read release commit logs
Git-->>Script: releaseLogs (ordered)
Script->>Script: derive currentRelease, previousRelease, rangeFrom
Script->>Git: git log ${rangeFrom}..${currentRelease}
Git-->>Script: commits list
Script->>Script: parse commits -> groups (types, Other)
loop per commit with author email
Script->>GHUsers: resolve username (cached)
GHUsers-->>Script: username
end
Script->>Script: render changelog by type order
alt not prerelease
Script->>GHRelease: create release --latest with changelog
else prerelease
Script->>GHRelease: create release (prerelease) with changelog
end
GHRelease-->>Script: release result
alt creation failed or tag exists
Script->>Git: delete tag & push cleanup
Git-->>Script: cleanup result
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
View your CI Pipeline Execution ↗ for commit 6bebdce
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
scripts/create-github-release.mjs (1)
15-17: Nitpick:--onelineis redundant with--format=%H.The
--format=%Hoption overrides the output format, making--onelineunnecessary. Consider removing it for clarity.Suggested fix
const releaseLogs = execSync( - 'git log --oneline --grep="ci: changeset release" --format=%H', + 'git log --grep="ci: changeset release" --format=%H', )🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/create-github-release.mjs` around lines 15 - 17, The git command used to populate releaseLogs redundantly includes --oneline alongside --format=%H; update the execSync call (the string passed to execSync that assigns releaseLogs) to remove --oneline so the command uses only --grep="ci: changeset release" --format=%H, keeping the rest of the invocation unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/create-github-release.mjs`:
- Around line 23-26: The code assumes releaseLogs[0] exists; if releaseLogs is
empty currentRelease becomes undefined and rangeFrom becomes "undefined~1",
breaking git refs—add a guard that checks releaseLogs.length === 0 and handle it
(either exit with a clear error message or set a safe fallback like setting
currentRelease = 'HEAD' and rangeFrom = 'HEAD~1'); update the logic around
releaseLogs, currentRelease, previousRelease and rangeFrom so you never compute
currentRelease + '~1' when currentRelease is undefined and ensure you log or
exit cleanly when no release commits are found.
---
Nitpick comments:
In `@scripts/create-github-release.mjs`:
- Around line 15-17: The git command used to populate releaseLogs redundantly
includes --oneline alongside --format=%H; update the execSync call (the string
passed to execSync that assigns releaseLogs) to remove --oneline so the command
uses only --grep="ci: changeset release" --format=%H, keeping the rest of the
invocation unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4347abd3-c94a-4d53-ba93-416b7256a91f
📒 Files selected for processing (1)
scripts/create-github-release.mjs
Bundle Size Benchmarks
Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better. |
few more changes to amke teh flow robust
Summary by CodeRabbit