Repository navigation
ci(core): automate Rust core crate releases via release-please - #2462
Conversation
The Rust core crates (wren-manifest-macro, wren-core-base, wren-semantic-core) were published to crates.io manually. Add them as release-please packages so future versions cut a release PR and publish on merge, matching how the Python and npm packages are already released. The three crates share one version via the linked-versions plugin and publish bottom-up in a single reusable workflow using crates.io Trusted Publishing (OIDC, no stored token) — the same token-less pattern as the PyPI/npm publishers. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughAdds release-please tracking for three Rust crates and connects semantic-core releases to a reusable GitHub Actions workflow that authenticates with crates.io and publishes the crates in dependency order. ChangesRust crate release automation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ReleasePlease
participant PublishWrenCrates
participant CratesIO
ReleasePlease->>PublishWrenCrates: invoke with version and tag_name
PublishWrenCrates->>CratesIO: authenticate with OIDC
PublishWrenCrates->>CratesIO: publish wren-manifest-macro
PublishWrenCrates->>CratesIO: publish wren-core-base
PublishWrenCrates->>CratesIO: publish wren-semantic-core
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.github/workflows/publish-wren-crates.yml (2)
31-33: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winSet
persist-credentials: falseon checkoutThe checkout action persists the GitHub token in
.git/configafter checkout. No subsequent step needs git auth, so disabling credential persistence reduces the exposure surface.🔒️ Proposed fix
- uses: actions/checkout@v4 with: ref: ${{ inputs.tag_name }} + persist-credentials: false🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/publish-wren-crates.yml around lines 31 - 33, Update the checkout step using actions/checkout@v4, identified by its ref input, to set persist-credentials: false in the with configuration.Source: Linters/SAST tools
22-29: 🔒 Security & Privacy | 🔵 TrivialRegister crates.io Trusted Publisher with the caller workflow path
When using reusable workflows with OIDC Trusted Publishing, GitHub Actions'
job_workflow_refclaim resolves to the caller workflow (.github/workflows/release-please.yml), not the reusable callee (.github/workflows/publish-wren-crates.yml). Ensure the crates.io Trusted Publisher is registered with the caller workflow path during the one-time setup mentioned in the PR summary. Based on learnings from this repo's PyPI Trusted Publishing workflows, the same OIDCjob_workflow_refbehavior applies. As per coding guidelines from the retrieved learning, this is expected behavior and not a defect in the reusable workflow structure.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/publish-wren-crates.yml around lines 22 - 29, Register the crates.io Trusted Publisher against the caller workflow path “.github/workflows/release-please.yml”, since OIDC job_workflow_ref identifies the invoking workflow rather than the reusable publish workflow. Keep the existing reusable workflow structure and permissions unchanged, and update the one-time Trusted Publisher setup documentation or instructions accordingly.Source: Learnings
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@release-please-config.json`:
- Around line 72-83: Update the `core/wren-core` configuration in
`release-please-config.json` to use `release-type: "simple"` instead of
`"rust"`, and add an `extra-files` entry targeting `Cargo.toml` with `jsonpath:
"$.workspace.package.version"` while retaining the existing
`$.workspace.dependencies.wren-core-base.version` entry.
---
Nitpick comments:
In @.github/workflows/publish-wren-crates.yml:
- Around line 31-33: Update the checkout step using actions/checkout@v4,
identified by its ref input, to set persist-credentials: false in the with
configuration.
- Around line 22-29: Register the crates.io Trusted Publisher against the caller
workflow path “.github/workflows/release-please.yml”, since OIDC
job_workflow_ref identifies the invoking workflow rather than the reusable
publish workflow. Keep the existing reusable workflow structure and permissions
unchanged, and update the one-time Trusted Publisher setup documentation or
instructions accordingly.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6e60abd8-990a-4698-8a49-4d1ccfb5652a
📒 Files selected for processing (4)
.github/workflows/publish-wren-crates.yml.github/workflows/release-please.yml.release-please-manifest.jsonrelease-please-config.json
core/wren-core is a virtual Cargo workspace (no [package]; the crate inherits version.workspace = true), which the rust release-type cannot bump. Switch it to release-type: simple and drive the shared [workspace.package].version through an extra-files TOML updater, keeping the wren-core-base dependency pin in sync. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
@coderabbitai review Pushed bb557cb addressing the workspace-version finding: |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
gh pr view 2462 --repo Canner/WrenAI --json title,body,state,commits 2>&1 | head -100
echo "---"
gh pr diff 2462 --repo Canner/WrenAI > /tmp/pr.diff 2>&1
wc -l /tmp/pr.diff
echo "---"
cat /tmp/pr.diffLength of output: 12224 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== core/wren-core/Cargo.toml =="
cat core/wren-core/Cargo.toml 2>&1 | head -60
echo "== core/wren-core/core/Cargo.toml =="
cat core/wren-core/core/Cargo.toml 2>&1 | head -60
echo "== core/wren-core-base/Cargo.toml =="
cat core/wren-core-base/Cargo.toml 2>&1 | head -60
echo "== core/wren-core-base/manifest-macro/Cargo.toml =="
cat core/wren-core-base/manifest-macro/Cargo.toml 2>&1 | head -60
echo "== ls core/wren-core =="
fd . core/wren-core -d 1Length of output: 5075 🏁 Script executed: #!/bin/bash
set -euo pipefail
gh api repos/Canner/WrenAI/pulls/2462/comments --paginate | jq -r '.[] | select(.user.login=="coderabbitai[bot]") | "\(.path):\(.line // .original_line) \n\(.body)\n---"' | head -300Length of output: 10068 This confirms the fix in bb557cb correctly resolves the earlier finding —
This matches the documented pattern for release-please with Cargo workspace version inheritance (switching to ✅ Action performedReview finished.
|
What & why
The Rust core crates were published to crates.io manually. This adds an automated release
line for them via release-please + a reusable publish workflow, matching how the Python
(
wren-core-py,wren) and npm (wren-core-wasm) packages are already released.Three publishable crates form a bottom-up dependency chain:
wren-manifest-macrocore/wren-core-base/manifest-macrowren-core-basecore/wren-core-basewren-manifest-macrowren-semantic-corecore/wren-core(workspace membercore)wren-core-baseChanges
release-please-config.json— add the three crates asrelease-type: rustpackages,grouped with the
linked-versionsplugin so they always share one version and land in asingle release PR. Cross-crate pinned dependency requirements are kept in sync with
type: "toml"extra-filesupdaters (same mechanism already used for theuv.lockbumps)..release-please-manifest.json— seed the three paths at the current0.1.0..github/workflows/publish-wren-crates.yml(new) — reusable workflow that publishes thechain bottom-up in one run. Uses crates.io Trusted Publishing (
rust-lang/crates-io-auth-action,OIDC, no stored token) — the same token-less pattern as the PyPI/npm publishers.
cargo publishblocks until each crate is live on the index before the next, so the pinned deps resolve in order.
.github/workflows/release-please.yml— expose thewren-semantic-coreoutputs and add apublish-wren-cratesjob gated onrelease_created(linked crates release together, so gatingon the top crate covers all three).
Verification
cargo publish --dry-runpasses for all three crates (each packages and builds cleanly).actionlintclean on both workflow files.release-please release-pr --dry-runagainst this branch parses the config and resolves allthree new packages as
rustwith thelinked-versionsplugin, no errors.Follow-up (one-time, repo-admin — not in this PR)
Trusted Publishing needs a one-time setup before the first automated publish:
Canner/WrenAI,workflow
publish-wren-crates.yml, environmentcrates-io.crates-ioGitHub environment under repo Settings → Environments (mirrors theexisting
npm/pypienvironments).Summary by CodeRabbit