Skip to content

Conversation

@Maidang1
Copy link
Contributor

@Maidang1 Maidang1 commented Sep 11, 2025

Summary by CodeRabbit

  • Chores
    • Consolidated JS and Rust publishing into a single Changesets-based release workflow with selective domain triggers and concurrency control.
    • Enabled beta releases from main and stable releases from v1-main.
    • Added npm scripts to run Changesets for creating, versioning, and publishing releases.
    • Updated release configuration to public access and aligned base branch for v1.
    • Removed legacy JS and Rust release workflows in favor of the unified pipeline.

@coderabbitai
Copy link

coderabbitai bot commented Sep 11, 2025

Walkthrough

Introduces a consolidated Changesets-based release workflow, updates Changesets configuration (including a v1-specific config), removes legacy JS/Rust release workflows, and adds npm scripts to run Changesets commands.

Changes

Cohort / File(s) Change Summary
Changesets config
.changeset/config.json, .changeset/config.v1.json
Set access to "public" in existing config; add v1 config with v3 schema, baseBranch v1-main, and standard Changesets options.
CI: Unified release workflow
.github/workflows/release-changeset.yml
Added a single workflow orchestrating JS and Rust plugin releases via Changesets, gated by commit message keywords and branch (main vs v1-main) for tagging.
CI: Remove legacy workflows
.github/workflows/release-js-plugins.yml, .github/workflows/release-rust-plugins.yml
Deleted previous JS and Rust release workflows.
NPM scripts
package.json
Added scripts: changeset, version-packages, release-packages.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub Actions
  participant JS as release-js Job
  participant RB as call-rust-build Job
  participant RS as release-rust Job
  participant NPM as npm Registry

  Dev->>GH: Push to main / v1-main
  GH->>GH: Check commit message for js-plugins / rust-plugins / all

  rect rgba(230,245,255,0.6)
    note over GH,JS: JS release path (if js-plugins or all)
    GH->>JS: run checkout, setup Node, pnpm install, build JS subset
    JS->>NPM: changeset publish (tag=beta on main, stable on v1-main)
  end

  rect rgba(240,255,230,0.6)
    note over GH,RS: Rust release path (if rust-plugins or all)
    GH->>RB: Reusable build workflow
    RB-->>GH: Build artifacts
    GH->>RS: Download and place artifacts
    RS->>NPM: changeset publish (tag=beta on main, stable on v1-main)
  end

  note over GH: Concurrency prevents overlapping runs
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • CCherry07
  • ErKeLost
  • wre232114

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly summarizes the primary intent of the changeset—updating publish configuration and CI/workflow changes—so it accurately reflects the main change in this PR. It does include an emoji and the ambiguous scope "none," which are minor stylistic issues but do not make the title misleading.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

A hop, a skip, a tag in flight—
I bundle builds by moonlit night.
One flow to rule the publish streams,
JS and Rust in carrot dreams.
With Changesets packed and buns aligned,
I press “release”—then burrow, satisfied. 🥕✨

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/changeset-publish

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.

Copy link

@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: 2

🧹 Nitpick comments (3)
package.json (1)

6-13: Normalize scripts to pnpm and consider adding a publish alias

Minor consistency cleanups and a convenience script.

   "scripts": {
-    "release": "npx changeset && npx changeset version",
-    "changeset": "changeset",
-    "version-packages": "changeset version",
-    "release-packages": "changeset publish",
+    "release": "pnpm changeset && pnpm version-packages",
+    "changeset": "pnpm exec changeset",
+    "version-packages": "pnpm exec changeset version",
+    "release-packages": "pnpm exec changeset publish",
+    "release-all": "pnpm version-packages && pnpm release-packages",
.github/workflows/release-changeset.yml (2)

34-36: Build filter looks fragile; may skip needed packages

The selector {js-plugins}[HEAD1] is non-standard and HEAD1 only covers the last commit. This can miss packages that need building when multiple commits land. Prefer an explicit workspace filter or a full recursive build.

-      - name: Build Packages
-        run: pnpm --filter "{js-plugins}[HEAD~1]" build
+      - name: Build Packages
+        run: pnpm -r build

If you need to scope to a group, switch to pnpm’s documented selectors (e.g., --filter './plugins/js-*').


142-142: Add a trailing newline

YAMLlint flagged missing EOF newline.

-    uses: ./.github/workflows/build.yaml
+    uses: ./.github/workflows/build.yaml
+
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b7961a and 560cb13.

📒 Files selected for processing (6)
  • .changeset/config.json (1 hunks)
  • .changeset/config.v1.json (1 hunks)
  • .github/workflows/release-changeset.yml (1 hunks)
  • .github/workflows/release-js-plugins.yml (0 hunks)
  • .github/workflows/release-rust-plugins.yml (0 hunks)
  • package.json (1 hunks)
💤 Files with no reviewable changes (2)
  • .github/workflows/release-rust-plugins.yml
  • .github/workflows/release-js-plugins.yml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/release-changeset.yml

[error] 142-142: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (5)
.changeset/config.json (1)

7-7: Access set to public — looks good

Aligns with npm’s requirement for publishing scoped packages publicly. No issues from my side.

.github/workflows/release-changeset.yml (4)

15-15: Commit-message gating can be brittle

Using only github.event.head_commit.message may skip runs for multi-commit pushes or merges where the top commit lacks the marker. If that’s acceptable, fine; otherwise consider checking all commit messages in the push or using labels/paths.


42-65: Grant write permissions for PR creation/pushes

changesets/action needs write permissions to create/update release PRs. If your repo defaults are read-only, these steps will fail.

 name: Release with Changeset
 
 on:
   push:
@@
 concurrency: ${{ github.workflow }}-${{ github.ref }}
 
+permissions:
+  contents: write
+  pull-requests: write
+
 jobs:

Alternatively, add the permissions block under each job.


116-139: Same permissions consideration for rust publish

Ensure write permissions are available here too, otherwise release PRs or tags may fail.


140-142: Reusable workflow and artifacts: confirm wiring

Verify .github/workflows/build.yaml has on: workflow_call and uploads artifacts named with the ${{ github.sha }}-${abi}-${package} scheme; otherwise download-artifact won’t find them.

Comment on lines +1 to +11
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "v1-main",
"updateInternalDependencies": "patch",
"ignore": []
} No newline at end of file
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

This config will be ignored unless explicitly selected; wire it into the workflow

Changesets only reads .changeset/config.json by default. In this repo, the workflows never point the CLI/action to config.v1.json, so v1 branch runs will still use the main config. Ensure the v1 workflow overwrites/uses this file when running on refs/heads/v1-main.

Apply one of these:

  • Simple: copy v1 config over the default before publish/version on v1-main.
--- a/.github/workflows/release-changeset.yml
+++ b/.github/workflows/release-changeset.yml
@@ -52,6 +52,12 @@ jobs:
           NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
 
       - name: Create Release Pull Request or Publish to npm (v1-main branch - stable)
         if: github.ref == 'refs/heads/v1-main'
+      - name: Use v1 Changesets config
+        if: github.ref == 'refs/heads/v1-main'
+        run: |
+          cp .changeset/config.v1.json .changeset/config.json
+          echo "Using v1 Changesets config"
+
         id: changesets-v1
         uses: changesets/action@v1
         with:
           publish: pnpm exec changeset publish
@@ -122,6 +128,12 @@ jobs:
           NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
 
       - name: Create Release Pull Request or Publish to npm (v1-main branch - stable)
         if: github.ref == 'refs/heads/v1-main'
+      - name: Use v1 Changesets config
+        if: github.ref == 'refs/heads/v1-main'
+        run: |
+          cp .changeset/config.v1.json .changeset/config.json
+          echo "Using v1 Changesets config"
+
         id: changesets-rust-v1
         uses: changesets/action@v1
  • Alternative: keep only a single config.json per maintenance branch (recommended), and remove config.v1.json from main.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In .changeset/config.v1.json (lines 1-11) the v1-specific Changesets config will
be ignored because workflows use .changeset/config.json by default; update the
v1-main CI workflow to ensure this file is used by either copying
.changeset/config.v1.json to .changeset/config.json before any
changesets/publish/version steps when refs/heads/v1-main are running, or else
remove config.v1.json and maintain a single .changeset/config.json for the v1
branch (i.e., add a conditional step that on v1-main copies the file prior to
running the Changesets CLI).

Comment on lines +90 to +107
- name: Move Artifacts
run: |
for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
do
for package in dsv react-components virtual yaml strip image url icons auto-import mdx wasm worker svgr modular-import compress
do
folder_path="/tmp/artifacts/${{github.sha}}-${abi}-${package}"
if [ -d "${folder_path}" ] && [ -n "$(ls -A $folder_path)" ]; then
mv /tmp/artifacts/${{ github.sha }}-${abi}-${package}/* ./rust-plugins/${package}/npm/${abi}
ls -R $folder_path
ls -R ./rust-plugins/${package}/npm/${abi}
test -f ./rust-plugins/${package}/npm/${abi}/index.farm
else
echo "${folder_path} is empty"
fi
done
done

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Artifact move can fail if target dirs don’t exist

mv will error when ./rust-plugins/${package}/npm/${abi} is missing. Add mkdir -p and safer bash options; list destination after move.

-      - name: Move Artifacts
-        run: |
-          for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
+      - name: Move Artifacts
+        run: |
+          set -euo pipefail
+          for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
           do
             for package in dsv react-components virtual yaml strip image url icons auto-import mdx wasm worker svgr modular-import compress
               do
                 folder_path="/tmp/artifacts/${{github.sha}}-${abi}-${package}"
                 if [ -d "${folder_path}" ] && [ -n "$(ls -A $folder_path)" ]; then
-                  mv /tmp/artifacts/${{ github.sha }}-${abi}-${package}/* ./rust-plugins/${package}/npm/${abi}
-                  ls -R $folder_path
-                  ls -R ./rust-plugins/${package}/npm/${abi}
+                  dest="./rust-plugins/${package}/npm/${abi}"
+                  mkdir -p "$dest"
+                  ls -R "$folder_path"
+                  mv "$folder_path"/* "$dest"/
+                  ls -R "$dest"
                   test -f ./rust-plugins/${package}/npm/${abi}/index.farm
                 else
                   echo "${folder_path} is empty"
                 fi
               done
           done
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Move Artifacts
run: |
for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
do
for package in dsv react-components virtual yaml strip image url icons auto-import mdx wasm worker svgr modular-import compress
do
folder_path="/tmp/artifacts/${{github.sha}}-${abi}-${package}"
if [ -d "${folder_path}" ] && [ -n "$(ls -A $folder_path)" ]; then
mv /tmp/artifacts/${{ github.sha }}-${abi}-${package}/* ./rust-plugins/${package}/npm/${abi}
ls -R $folder_path
ls -R ./rust-plugins/${package}/npm/${abi}
test -f ./rust-plugins/${package}/npm/${abi}/index.farm
else
echo "${folder_path} is empty"
fi
done
done
- name: Move Artifacts
run: |
set -euo pipefail
for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
do
for package in dsv react-components virtual yaml strip image url icons auto-import mdx wasm worker svgr modular-import compress
do
folder_path="/tmp/artifacts/${{github.sha}}-${abi}-${package}"
if [ -d "${folder_path}" ] && [ -n "$(ls -A $folder_path)" ]; then
dest="./rust-plugins/${package}/npm/${abi}"
mkdir -p "$dest"
ls -R "$folder_path"
mv "$folder_path"/* "$dest"/
ls -R "$dest"
test -f ./rust-plugins/${package}/npm/${abi}/index.farm
else
echo "${folder_path} is empty"
fi
done
done
🤖 Prompt for AI Agents
.github/workflows/release-changeset.yml around lines 90 to 107: the loop moves
artifacts into ./rust-plugins/${package}/npm/${abi} but mv will fail if the
destination directory doesn't exist and the script lacks safer bash flags;
before calling mv, create the destination with mkdir -p (use the fully expanded
destination path), ensure variables are quoted, and enable safer shell options
(e.g. set -euo pipefail at script start or within the job) so failures surface;
after a successful move, list the destination to verify (ls -R destination) and
keep the existing empty-folder echo path for clarity.

@CCherry07 CCherry07 merged commit 5bea051 into main Sep 11, 2025
3 checks passed
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.

3 participants