feat: update Rust CI/CD to latest best practices from template#21
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #20
⏳ Usage Limit ReachedThe automated solution draft was interrupted because the Claude usage limit was reached. 📊 Limit Information
🔄 How to ContinueOnce the limit resets at 8:00 AM, you can resume this session by running: (cd "/tmp/gh-issue-solver-1767851145039" && claude --resume 734740f8-9e34-48f6-9e76-3eb98735473d --model opus)Click to expand execution log (44KB)This session was interrupted due to usage limits. You can resume once the limit resets. |
This reverts commit 501a73e.
|
🤖 AI Work Session Started Starting automated work session at 2026-01-11T04:28:46.834Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
Updated the Rust CI/CD workflow and scripts to match best practices from rust-ai-driven-development-pipeline-template repository. Key changes: - Added detect-changes job for conditional job execution based on file changes - Added version-check job to prevent manual version modification in PRs - Added crates.io publishing support with CARGO_REGISTRY_TOKEN/CARGO_TOKEN - Added changelog-pr manual release mode for review-based releases - Added multi-language repository support via rust-paths.mjs utility - Improved job conditions using always() && !cancelled() pattern New scripts added: - rust-paths.mjs: Core utility for auto-detecting Rust package root - detect-code-changes.mjs: File change detection for CI/CD - check-version-modification.mjs: Prevents manual version changes in PRs - check-changelog-fragment.mjs: Validates changelog fragments - git-config.mjs: Git user configuration utility - get-bump-type.mjs: Determines version bump type from fragments - check-release-needed.mjs: Checks if release should proceed - get-version.mjs: Extracts version from Cargo.toml - collect-changelog.mjs: Collects and processes changelog fragments - create-changelog-fragment.mjs: Creates changelog fragments - publish-crate.mjs: Publishes to crates.io Resolves #20 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
We also should adjuct js.yml, to not trigger on rust or common ./scripts code. And rust.yml should not be triggered when only js code is changed. Also double check latest best practices for both:
May be we have something else needing to update. |
|
🤖 AI Work Session Started Starting automated work session at 2026-01-12T22:34:02.305Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
- Remove 'scripts/**' from path triggers in both workflows since scripts are shared between Rust and JS CI/CD pipelines - Add detect-changes job to js.yml similar to rust.yml for conditional job execution - Update detect-code-changes.mjs to output language-specific flags: - rust-code-changed: true when Rust code (rust/, .github/workflows/rust.yml) changes - js-code-changed: true when JS code (js/, .github/workflows/js.yml) changes - rust-workflow-changed, js-workflow-changed: specific workflow changes - Add version-check job to js.yml to prevent manual version changes - Update changelog checks to only run for language-specific code changes - Add concurrency with cancel-in-progress to js.yml This ensures: - Rust CI/CD only runs when Rust code changes - JS CI/CD only runs when JS code changes - Shared scripts don't trigger both workflows unnecessarily Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The changelog/changeset checks should only run when actual package code changes (files in rust/ or js/ directories), not when workflow files or shared scripts change. Changes: - Add isRustPackageCode() and isJsPackageCode() functions to detect actual package code changes (excluding changelog.d and .changeset) - Add rust-package-changed and js-package-changed outputs - Update changelog check to use rust-package-changed instead of rust-code-changed - Update changeset-check to use js-package-changed instead of js-code-changed This allows workflow-only PRs (like CI/CD improvements) to pass without requiring changelog fragments or changesets. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
Updates both Rust and JavaScript CI/CD workflows and scripts to match best practices from:
Key Changes
Workflow Isolation for Multi-Language Repos
rust.yml) only triggers on changes to:rust/**- Rust package files.github/workflows/rust.yml- Rust workflowjs.yml) only triggers on changes to:js/**- JavaScript package files.github/workflows/js.yml- JS workflowscripts/) are used by both workflows but don't trigger them directlySmart Change Detection (
detect-code-changes.mjs)The script now outputs language-specific flags for conditional job execution:
rust-code-changedjs-code-changedrust-package-changedjs-package-changedrust-workflow-changedjs-workflow-changedThis distinction means:
Workflow Improvements
detect-changesjob to skip unnecessary jobsversion-checkjob to prevent manual version modificationalways() && !cancelled()pattern for proper job dependency handlingcancel-in-progress: truefor faster PR feedbackNew Scripts for Rust CI/CD
rust-paths.mjsdetect-code-changes.mjscheck-version-modification.mjscheck-changelog-fragment.mjsgit-config.mjsget-bump-type.mjscheck-release-needed.mjsget-version.mjscollect-changelog.mjscreate-changelog-fragment.mjspublish-crate.mjsTest Plan
Resolves #20
Generated with Claude Code