Skip to content

Migrate CI/CD to Rust scripts and adopt template best practices#133

Merged
konard merged 4 commits intomainfrom
issue-132-46bf111e3bd8
Mar 21, 2026
Merged

Migrate CI/CD to Rust scripts and adopt template best practices#133
konard merged 4 commits intomainfrom
issue-132-46bf111e3bd8

Conversation

@konard
Copy link
Member

@konard konard commented Mar 21, 2026

Summary

  • Migrated all CI/CD pipeline scripts from Node.js (.mjs) to Rust (.rs) using rust-script, matching the rust-ai-driven-development-pipeline-template
  • Fixed the CI/CD "Auto Release" failure (run 23390203130) caused by hard-failing on missing CARGO_REGISTRY_TOKEN
  • Added 9 new Rust scripts and comprehensive workflow improvements from the template

Root Cause

The "Publish to Crates.io" step used inline bash that called exit 1 when no CARGO_REGISTRY_TOKEN was configured. The template uses a dedicated publish-crate.rs script that handles auth failures gracefully, supports --allow-dirty, and handles "already exists" responses.

Changes

New Rust scripts (matching template):

  • publish-crate.rs — Graceful crates.io publishing with auth error handling
  • check-release-needed.rs — Checks crates.io API instead of git tags
  • check-version-modification.rs — Prevents manual version edits in PRs
  • detect-code-changes.rs — Smart change detection for CI optimization
  • git-config.rs, get-version.rs, rust-paths.rs — Utility scripts
  • check-changelog-fragment.rs — PR-diff-aware changelog validation
  • create-changelog-fragment.rs — Manual release changelog creation
  • Rust equivalents: version-and-commit.rs, get-bump-type.rs, collect-changelog.rs, bump-version.rs, check-file-size.rs, create-github-release.rs

Workflow improvements:

  • Added detect-changes job for smart CI optimization
  • Added version-check job to prevent manual version modification
  • Added Clippy lint check
  • Added doc tests and package verification
  • Added changelog-pr release mode
  • Proper always() && !cancelled() job dependency patterns
  • Release checks crates.io instead of git tags

Documentation:

  • Case study in docs/case-studies/issue-132/ with timeline, root cause analysis, and lessons learned
  • CI logs preserved in compressed format

Test plan

  • cargo fmt --all -- --check passes
  • cargo clippy --all-targets --all-features passes
  • cargo test --all-features — 67 tests pass
  • Workflow YAML validates correctly
  • Working tree clean, no uncommitted changes
  • CI pipeline runs on this PR to validate workflow syntax

Fixes #132

🤖 Generated with Claude Code

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #132
@konard konard self-assigned this Mar 21, 2026
konard and others added 2 commits March 21, 2026 22:45
Migrate all CI/CD pipeline scripts from .mjs (Node.js) to .rs (Rust)
to match best practices from the rust-ai-driven-development-pipeline-template.

New Rust scripts added:
- publish-crate.rs: Graceful crates.io publishing with auth error handling
- check-release-needed.rs: Check crates.io (not git tags) for release state
- check-version-modification.rs: Prevent manual version changes in PRs
- detect-code-changes.rs: Smart change detection for CI optimization
- git-config.rs: Git user configuration for automated commits
- get-version.rs: Extract version from Cargo.toml for CI outputs
- rust-paths.rs: Multi-language repo path detection utility
- check-changelog-fragment.rs: PR-diff-aware changelog fragment validation
- create-changelog-fragment.rs: Manual release changelog fragment creation
- version-and-commit.rs, get-bump-type.rs, collect-changelog.rs,
  bump-version.rs, check-file-size.rs, create-github-release.rs

Workflow improvements:
- Added detect-changes job for smart CI optimization
- Added version-check job to prevent manual version modification
- Added clippy lint check
- Added doc tests (cargo test --doc)
- Added cargo package --list verification
- Added changelog-pr release mode for manual changelog PR creation
- Switched to rust-script for all script execution
- Added proper always() && !cancelled() patterns for job dependencies
- Release now checks crates.io instead of git tags for version state
- Publish step uses publish-crate.rs with graceful auth error handling

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Add comprehensive case study in docs/case-studies/issue-132/ with
  timeline, root cause analysis, solution details, and lessons learned
- Save compressed CI logs from failing run 23390203130
- Add changelog fragment for the CI/CD migration changes

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@konard konard changed the title [WIP] Looks like our CI/CD has missing version bump from https://github.com/link-foundation/rust-ai-driven-development-pipeline-template Migrate CI/CD to Rust scripts and adopt template best practices Mar 21, 2026
@konard konard marked this pull request as ready for review March 21, 2026 22:50
@konard
Copy link
Member Author

konard commented Mar 21, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $8.393055
  • Calculated by Anthropic: $4.291513 USD
  • Difference: $-4.101543 (-48.87%)

🤖 Models used:

  • Tool: Claude
  • Requested: opus
  • Model: Claude Opus 4.6 (claude-opus-4-6)

📎 Log file uploaded as Gist (1654KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Member Author

konard commented Mar 21, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit ef2d55d into main Mar 21, 2026
14 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.

Looks like our CI/CD has missing version bump from https://github.com/link-foundation/rust-ai-driven-development-pipeline-template

1 participant