Skip to content

cicd: add override for changeset version command#2000

Merged
sevenzing merged 2 commits intomainfrom
fix/changeset-version-cicd-bug
Apr 27, 2026
Merged

cicd: add override for changeset version command#2000
sevenzing merged 2 commits intomainfrom
fix/changeset-version-cicd-bug

Conversation

@sevenzing
Copy link
Copy Markdown
Member

Summary

  • Configure changesets/action in .github/workflows/release.yml to use version: pnpm changeset:version.

Why

  • Fix release CI error where OpenAPI Spec Sync Check fails after merging “Release New Version” because ensapi-openapi.json was not regenerated after package version bumps.

Testing

  • Not run locally in this change (workflow/script wiring only).

Pre-Review Checklist (Blocking)

  • This PR does not introduce significant changes and is low-risk to review quickly.
  • Relevant changesets are included (or are not required)

@sevenzing sevenzing requested a review from a team as a code owner April 27, 2026 08:23
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 27, 2026

⚠️ No Changeset found

Latest commit: 446ae17

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

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
admin.ensnode.io Ready Ready Preview, Comment Apr 27, 2026 9:43am
ensnode.io Ready Ready Preview, Comment Apr 27, 2026 9:43am
ensrainbow.io Ready Ready Preview, Comment Apr 27, 2026 9:43am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b695f0e0-eed0-4ae0-b47c-6e265c7c952b

📥 Commits

Reviewing files that changed from the base of the PR and between 001d5ae and 446ae17.

📒 Files selected for processing (1)
  • package.json

📝 Walkthrough

Walkthrough

Adds a new changeset:version npm script and updates the release workflow to invoke that script, so the Changesets action sources the version via pnpm changeset:version and OpenAPI generation runs as part of the version step.

Changes

Cohort / File(s) Summary
Release workflow
​.github/workflows/release.yml
Configures the Changesets GitHub Action to use an explicit version command input set to pnpm changeset:version.
Root package scripts
package.json
Adds changeset:versionchangeset version && pnpm generate:openapi; updates changeset:next to run changeset version --snapshot next && pnpm generate:openapi.

Sequence Diagram(s)

sequenceDiagram
  participant GH as "GitHub Actions"
  participant CS as "changesets/action"
  participant PN as "pnpm scripts"
  participant GEN as "OpenAPI generator"

  GH->>CS: trigger release workflow
  CS->>PN: run `pnpm changeset:version`
  PN->>CS: run `changeset version`
  PN->>GEN: run `pnpm generate:openapi`
  GEN-->>PN: OpenAPI artifacts
  CS-->>GH: commit/versioned changes
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰
Hopping through scripts with a twitch of my nose,
Bump the version, then watch the docs grow,
Changesets wobble, then neatly align,
OpenAPI blooms — oh what a fine sign! 🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a version command override for the changeset action in CI/CD configuration.
Description check ✅ Passed The description follows the template with all required sections completed: Summary, Why, Testing, and Pre-Review Checklist are all present and adequately filled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/changeset-version-cicd-bug

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.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 27, 2026

Greptile Summary

This PR fixes a CI failure where the OpenAPI Spec Sync Check would fail after the "Release New Version" PR was merged, because ensapi-openapi.json was not regenerated to reflect the bumped package versions. It introduces a new changeset:version root script (changeset version && pnpm generate:openapi) that the changesets/action now calls as its version override, and also updates changeset:next (used by the snapshot workflow) to regenerate the spec after each snapshot version bump.

Confidence Score: 5/5

Safe to merge — minimal two-line change in a CI workflow and one new npm script, with a clear, verifiable fix for the reported CI failure.

No P0 or P1 findings. The changesets/action version override is the documented way to customise the versioning step, and the script ordering (changeset version before generate:openapi) is correct. The snapshot workflow's hasChanges guard remains reliable because generate:openapi is deterministic: when no changeset files exist, package versions do not change, so the regenerated spec is byte-for-byte identical and git status stays clean.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/release.yml Adds version: pnpm changeset:version override to the changesets/action step so the new root script (which includes OpenAPI regeneration) is used when creating/updating the Release PR.
package.json Adds changeset:version script (changeset version && pnpm generate:openapi) and appends && pnpm generate:openapi to the existing changeset:next script, ensuring the OpenAPI spec is regenerated after every version bump in both full-release and snapshot-release flows.

Sequence Diagram

sequenceDiagram
    participant GH as GitHub Push (main)
    participant CsAction as changesets/action
    participant Script as pnpm changeset:version
    participant CS as changeset version
    participant OA as pnpm generate:openapi
    participant ReleasePR as "Release New Version" PR

    GH->>CsAction: trigger (push to main)
    CsAction->>Script: run version override
    Script->>CS: changeset version (bump package.json versions)
    CS-->>Script: versions bumped
    Script->>OA: pnpm generate:openapi
    OA-->>Script: ensapi-openapi.json regenerated with new versions
    Script-->>CsAction: version step complete
    CsAction->>ReleasePR: commit bumped versions + updated spec
    Note over ReleasePR: OpenAPI Spec Sync Check passes on merge
Loading

Reviews (2): Last reviewed commit: "fix PR comments" | Re-trigger Greptile

Copy link
Copy Markdown
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Around line 15-16: The changeset:next npm script runs "changeset version
--snapshot next" but doesn't regenerate the OpenAPI spec, leaving
ensapi-openapi.json with an outdated packageJson.version; update the
"changeset:next" script to mirror "changeset:version" by appending the OpenAPI
generation step so it runs "changeset version --snapshot next && pnpm -F
`@docs/ensnode` generate:openapi" (i.e., ensure the changeset:next script triggers
pnpm generate:openapi after the version bump).
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4cab62da-5afd-4bfe-8f94-4fd3c1c52fda

📥 Commits

Reviewing files that changed from the base of the PR and between c186ad8 and 001d5ae.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • package.json

Comment thread package.json Outdated
Copy link
Copy Markdown
Member

@tk-o tk-o left a comment

Choose a reason for hiding this comment

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

Nice use of changesets/action 🚀 Left minor comment, otherwise, LGTM!

Comment thread package.json Outdated
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.

2 participants