Fix Rust release workflow toolchain#313
Conversation
Reviewer's GuidePins a specific Rust toolchain version in CI/release workflows and ensures all Rust builds/tests use that toolchain, while updating architecture docs to describe the behavior. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #313 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 569 569
=========================================
Hits 569 569
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The Rust toolchain version is now hardcoded in multiple workflows (
build-rust-wheels.ymlandrust-ci.yml); consider centralizing this in a single place (e.g., a reusable workflow, environment variable, or repository variable) to avoid drift when updating versions. - Switching
cargo test --no-default-featurestocargo testchanges which feature set is exercised in CI; if you still need coverage for the minimal feature set, consider keeping a separate job or command that runs tests without default features alongside the default configuration.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The Rust toolchain version is now hardcoded in multiple workflows (`build-rust-wheels.yml` and `rust-ci.yml`); consider centralizing this in a single place (e.g., a reusable workflow, environment variable, or repository variable) to avoid drift when updating versions.
- Switching `cargo test --no-default-features` to `cargo test` changes which feature set is exercised in CI; if you still need coverage for the minimal feature set, consider keeping a separate job or command that runs tests without default features alongside the default configuration.
## Individual Comments
### Comment 1
<location path=".github/workflows/build-rust-wheels.yml" line_range="18" />
<code_context>
env:
PACKAGE_NAME: json2xml_rs
PYTHON_VERSION: '3.12'
+ RUST_VERSION: '1.96.0'
permissions:
</code_context>
<issue_to_address>
**suggestion:** Consider deriving the Rust version from a single source of truth (e.g., rust-toolchain.toml) instead of hardcoding it here.
Hardcoding `RUST_VERSION` here can drift from the version in `rust-toolchain*` or what developers use locally. If you already define the toolchain elsewhere, consider either relying on `setup-rust-toolchain`’s default (reading `rust-toolchain*`) or defining the version once (e.g., in a reusable workflow/env) and referencing it here to keep CI and local environments aligned.
Suggested implementation:
```
env:
PACKAGE_NAME: json2xml_rs
PYTHON_VERSION: '3.12'
```
```
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| env: | ||
| PACKAGE_NAME: json2xml_rs | ||
| PYTHON_VERSION: '3.12' | ||
| RUST_VERSION: '1.96.0' |
There was a problem hiding this comment.
suggestion: Consider deriving the Rust version from a single source of truth (e.g., rust-toolchain.toml) instead of hardcoding it here.
Hardcoding RUST_VERSION here can drift from the version in rust-toolchain* or what developers use locally. If you already define the toolchain elsewhere, consider either relying on setup-rust-toolchain’s default (reading rust-toolchain*) or defining the version once (e.g., in a reusable workflow/env) and referencing it here to keep CI and local environments aligned.
Suggested implementation:
env:
PACKAGE_NAME: json2xml_rs
PYTHON_VERSION: '3.12'
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1
Summary by Sourcery
Pin Rust toolchain version in CI and release workflows and ensure Rust is explicitly installed before building wheels or running checks.
CI:
Documentation: