Skip to content

make changeset publishing more robust#6895

Merged
birkskyum merged 2 commits intomainfrom
more-tweaks-to-changeset-flow
Mar 11, 2026
Merged

make changeset publishing more robust#6895
birkskyum merged 2 commits intomainfrom
more-tweaks-to-changeset-flow

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Mar 11, 2026

few more changes to amke teh flow robust

  1. --latest only for non-prereleases: prereleases won't be marked as "Latest" on GitHub
  2. Robust git log range: explicitly finds both the current and previous release commits by grepping for ci: changeset release, no more fragile HEAD~1 assumptions
  3. Cleaner non-conventional commit parsing: uses split(' ') instead of brittle double-indexOf, with a comment explaining what goes to "Other"

Summary by CodeRabbit

  • Chores
    • More consistent, organized release note generation with clearer grouping of commit types and an explicit "Other" category for unrecognized entries.
    • Changelogs now include scope where available and show author usernames when resolved.
    • Release creation updated to support prerelease handling and a "latest" option for normal releases.
    • Safer cleanup for partial or failed releases to avoid leftover tags and ensure predictable state.

@changeset-bot
Copy link

changeset-bot bot commented Mar 11, 2026

⚠️ No Changeset found

Latest commit: 6bebdce

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 80e7276b-af09-4634-8312-0b86aa63c432

📥 Commits

Reviewing files that changed from the base of the PR and between 91d87c9 and 6bebdce.

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

📝 Walkthrough

Walkthrough

The 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 --latest release creation logic for non-prereleases.

Changes

Cohort / File(s) Summary
Release Script
scripts/create-github-release.mjs
Collects release commit logs to derive currentRelease and previousRelease; computes git log range as ${rangeFrom}..${currentRelease}; filters out release commits; parses commits into typed groups or Other (handles optional scope); resolves author usernames via GitHub API with caching; generates sorted changelog; adds prerelease-aware --latest flag and improved tag cleanup on failures.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hop through logs to find the two most new,
I sort the types and fetch each author too.
If not a prerelease, I mark it latest bright,
Else I tuck it gently for a future night.
A tiny rabbit spins release notes true.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'make changeset publishing more robust' is directly related to the main objective of the PR, which improves the robustness of the release publishing workflow by fixing git log range detection and simplifying commit parsing.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch more-tweaks-to-changeset-flow

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 and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Mar 11, 2026

View your CI Pipeline Execution ↗ for commit 6bebdce

Command Status Duration Result
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-11 19:36:08 UTC

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/create-github-release.mjs (1)

15-17: Nitpick: --oneline is redundant with --format=%H.

The --format=%H option overrides the output format, making --oneline unnecessary. 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

📥 Commits

Reviewing files that changed from the base of the PR and between ab46b5e and 91d87c9.

📒 Files selected for processing (1)
  • scripts/create-github-release.mjs

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 11, 2026

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@6895

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@6895

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@6895

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@6895

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@6895

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@6895

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@6895

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@6895

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@6895

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@6895

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@6895

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@6895

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@6895

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@6895

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@6895

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@6895

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@6895

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@6895

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@6895

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@6895

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@6895

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@6895

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@6895

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@6895

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@6895

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@6895

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@6895

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@6895

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@6895

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@6895

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@6895

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@6895

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@6895

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@6895

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@6895

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@6895

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@6895

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@6895

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@6895

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@6895

commit: 9655905

@birkskyum birkskyum changed the title make chagneset publishing more robust make changeset publishing more robust Mar 11, 2026
@birkskyum birkskyum merged commit 986776c into main Mar 11, 2026
12 of 13 checks passed
@birkskyum birkskyum deleted the more-tweaks-to-changeset-flow branch March 11, 2026 19:27
@github-actions
Copy link
Contributor

Bundle Size Benchmarks

  • Commit: ab46b5ec4229
  • Measured at: 2026-03-11T19:28:48.134Z
  • Baseline source: history:ab46b5ec4229
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Raw Brotli Trend
react-router.minimal 87.09 KiB 0 B (0.00%) 274.11 KiB 75.68 KiB ▁▁▆▆▇▇█████
react-router.full 90.08 KiB 0 B (0.00%) 284.36 KiB 78.32 KiB ▁▁▅▅▆▆█████
solid-router.minimal 36.42 KiB 0 B (0.00%) 109.29 KiB 32.74 KiB ▁▁▅▆▇▇█████
solid-router.full 40.75 KiB 0 B (0.00%) 122.27 KiB 36.58 KiB ▁▁▄▅▇▇█████
vue-router.minimal 52.29 KiB 0 B (0.00%) 149.34 KiB 47.01 KiB ▁▁▅▅▇▇█████
vue-router.full 57.08 KiB 0 B (0.00%) 164.85 KiB 51.27 KiB ▁▁▅▅▇▇█████
react-start.minimal 99.66 KiB 0 B (0.00%) 313.26 KiB 86.22 KiB ▁▁▅▅▇▇█████
react-start.full 102.97 KiB 0 B (0.00%) 322.99 KiB 89.07 KiB ▁▁▅▅▆▆█████
solid-start.minimal 48.75 KiB 0 B (0.00%) 146.89 KiB 43.14 KiB ▁▁▅▅▇▇█████
solid-start.full 54.21 KiB 0 B (0.00%) 162.75 KiB 47.88 KiB ▁▁▅▅▇▇█████

Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better.

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 11, 2026

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing more-tweaks-to-changeset-flow (6bebdce) with main (ab46b5e)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant