Skip to content

fix: Improve CI reliability and minor code cleanup#17

Open
hobostay wants to merge 1 commit into
mwallner:mainfrom
hobostay:fix/code-quality-and-ci
Open

fix: Improve CI reliability and minor code cleanup#17
hobostay wants to merge 1 commit into
mwallner:mainfrom
hobostay:fix/code-quality-and-ci

Conversation

@hobostay
Copy link
Copy Markdown

Summary

  • Add rust-toolchain.toml to pin minimum Rust version (1.85, required for edition = "2024")
  • Add dtolnay/rust-toolchain@stable action to both CI workflows for consistent Rust version across runners
  • Add Swatinem/rust-cache@v2 action to both CI workflows for faster builds via dependency caching
  • Remove redundant cargo test step in Windows workflow (tests already run by Invoke-Build Build,Test)
  • Add .DS_Store to .gitignore for macOS contributors
  • Simplify provenance.path_commit.clone().unwrap_or_else(|| "(none)".to_string()) to as_deref().unwrap_or("(none)") to avoid an unnecessary heap allocation

Details

Issue Location Fix
No Rust version pin Root Added rust-toolchain.toml with channel = "1.85"
Missing toolchain setup Both CI workflows Added dtolnay/rust-toolchain@stable step
No dependency cache Both CI workflows Added Swatinem/rust-cache@v2 step
Redundant test step build-windows.yml Removed duplicate cargo test (already in Invoke-Build Build,Test)
Missing .DS_Store ignore .gitignore Added .DS_Store
Unnecessary .clone() src/planner.rs:169 Used as_deref().unwrap_or() instead

Test plan

  • Code compiles with cargo build
  • Tests pass with cargo test
  • CI workflows run successfully with new toolchain/cache steps

🤖 Generated with Claude Code

- Add `rust-toolchain.toml` to pin Rust 1.85+ (required for edition 2024)
- Add `dtolnay/rust-toolchain` action to CI workflows for consistent toolchain
- Add `Swatinem/rust-cache` action to CI workflows for faster builds
- Remove redundant `cargo test` step in Windows workflow (already run by
  `Invoke-Build Build,Test`)
- Add `.DS_Store` to `.gitignore`
- Simplify `provenance.path_commit.clone().unwrap_or_else(...)` to
  `as_deref().unwrap_or(...)` in planner.rs to avoid unnecessary allocation

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@mwallner
Copy link
Copy Markdown
Owner

Hey,
Thanks for helping out, ufortunately this doesnt compile - see the actions run:

Caused by:
  rustc 1.85.1 is not supported by the following packages:
    cargo-platform@0.3.1 requires rustc 1.86
    cargo_metadata@0.23.0 requires rustc 1.86.0

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to make CI runs more deterministic and faster by pinning the Rust toolchain and adding standard Rust setup/caching steps, alongside a small runtime allocation cleanup in the planner and a macOS .gitignore tweak.

Changes:

  • Added rust-toolchain.toml to pin Rust to 1.85 (aligning with edition = "2024").
  • Updated both Linux and Windows GitHub Actions workflows to install the Rust toolchain and enable Cargo dependency caching; removed a redundant Windows test step.
  • Minor cleanup: avoid an unnecessary allocation when formatting Source-Path-Commit, and ignore .DS_Store files.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/planner.rs Reduces allocation when formatting optional provenance commit information.
rust-toolchain.toml Pins the Rust toolchain version for consistent local/CI builds.
.gitignore Ignores macOS .DS_Store files.
.github/workflows/build-windows.yml Adds Rust toolchain setup + caching; removes redundant cargo test step.
.github/workflows/build-linux.yml Adds Rust toolchain setup + caching for consistent builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/planner.rs
Comment on lines 165 to 171
format!(
"Source-Path-Commit: {}",
provenance
.path_commit
.clone()
.unwrap_or_else(|| "(none)".to_string())
.as_deref()
.unwrap_or("(none)")
),
Copilot AI added a commit that referenced this pull request May 13, 2026
…copilot-review-instructions

Agent-Logs-Url: https://github.com/mwallner/mergetopus/sessions/97054294-dd96-4aac-b561-7c510fad2be6

Co-authored-by: mwallner <5354972+mwallner@users.noreply.github.com>
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