Skip to content

github actions: Use Cargo.toml and rust-toolchain.toml#482

Merged
mulkieran merged 2 commits into
stratis-storage:masterfrom
mulkieran:issue_project_819
May 18, 2026
Merged

github actions: Use Cargo.toml and rust-toolchain.toml#482
mulkieran merged 2 commits into
stratis-storage:masterfrom
mulkieran:issue_project_819

Conversation

@mulkieran
Copy link
Copy Markdown
Member

@mulkieran mulkieran commented May 16, 2026

Signed-off-by: mulhern <amulhern@redhat.com>
@mulkieran mulkieran self-assigned this May 16, 2026
@mulkieran mulkieran moved this to In Progress in 2026May May 16, 2026
@packit-as-a-service
Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/stratis-storage-libcryptsetup-rs-482
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@mulkieran mulkieran force-pushed the issue_project_819 branch from 1b6ac1e to 0312e3b Compare May 18, 2026 16:01
@mulkieran mulkieran changed the title Issue project 819 github actions: Use Cargo.toml and rust-toolchain.toml May 18, 2026
@mulkieran mulkieran force-pushed the issue_project_819 branch 3 times, most recently from 5217bde to 92e3714 Compare May 18, 2026 16:37
@mulkieran
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Walkthrough

This PR migrates the project's CI workflows from dtolnay/rust-toolchain@master to actions-rust-lang/setup-rust-toolchain@v1, introduces a rust-toolchain.toml file pinning version 1.95.0, implements runtime MSRV detection from Cargo.toml for lowest-supported jobs, adds a dedicated typos checking job, and adjusts semver-checks configuration in the nightly workflow.

Changes

Rust Toolchain Configuration & Migration

Layer / File(s) Summary
Toolchain version pin
rust-toolchain.toml
New file pins the default Rust toolchain to channel 1.95.0 for the repository.
Migrate to actions-rust-lang/setup-rust-toolchain
.github/workflows/cargo.yml, .github/workflows/main.yml, .github/workflows/nightly.yml
Replace dtolnay/rust-toolchain@master with actions-rust-lang/setup-rust-toolchain@v1 across format, lint, stable, audit, and checks-with-ci-repo CI jobs, configuring only required Rust components (cargo, rustfmt, clippy).
Add MSRV detection for lowest-supported testing
.github/workflows/main.yml
Install toml-cli, detect package.rust-version from Cargo.toml at runtime, and configure the toolchain to the detected MSRV in lowest-supported and Fedora container jobs before running tests.
Add typos CI job
.github/workflows/main.yml
Introduce a dedicated typos job that installs typos-cli and runs the make check-typos target for spell checking.
Adjust semver-checks configuration
.github/workflows/nightly.yml
Move manifest-path: libcryptsetup-rs-sys into a separate step block in the semver-checks job.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • stratis-storage/libcryptsetup-rs#456: Both PRs modify GitHub Actions Rust toolchain setup across the same workflows, switching from dtolnay/rust-toolchain@master to alternative toolchain provisioning methods.
  • stratis-storage/libcryptsetup-rs#444: Both PRs affect MSRV handling in CI, with this PR adding dynamic MSRV detection from Cargo.toml and the related PR updating the MSRV version itself.
  • stratis-storage/libcryptsetup-rs#457: Both PRs modify the lowest-supported/MSRV Rust version configuration in CI workflows, with overlapping changes to how the CI jobs consume the MSRV value.

Suggested reviewers

  • jbaublitz
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: switching CI workflows to use Cargo.toml and rust-toolchain.toml for toolchain configuration instead of hardcoded values.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
.github/workflows/main.yml (1)

227-239: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Verify toml-cli command syntax and handle potential quoted output.

The same MSRV detection concern from the lowest_supported job applies here. The toml get command may return quoted strings that would break toolchain setup.

🛡️ Potential fix to handle quoted output
       - name: Get package MSRV
         id: msrv
         run: |
-          PATH="$PATH:$(python3 -m site --user-base)/bin" MSRV=$(toml get --toml-path Cargo.toml "package.rust-version")
+          PATH="$PATH:$(python3 -m site --user-base)/bin" MSRV=$(toml get --toml-path Cargo.toml "package.rust-version" | tr -d '"')
           echo "MSRV=$MSRV" >> "$GITHUB_OUTPUT"
🤖 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/main.yml around lines 227 - 239, The MSRV step (id: msrv)
uses `toml get` which can return a quoted string and break the toolchain setup;
update the run block that sets MSRV so it normalizes/strips surrounding quotes
(e.g., trim whitespace and remove leading/trailing double quotes) after invoking
`toml get` and before exporting to GITHUB_OUTPUT, and keep using that cleaned
variable when passing toolchain: ${{ steps.msrv.outputs.MSRV }} to
actions-rust-lang/setup-rust-toolchain@v1.
🤖 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 @.github/workflows/main.yml:
- Line 226: The workflow step that runs the package install uses the wrong
Fedora package name ("dnf install -y git pip"); update that run command to
install python3-pip instead of pip so the correct Fedora package is used
(replace the occurrence of "pip" in the run command with "python3-pip").

---

Duplicate comments:
In @.github/workflows/main.yml:
- Around line 227-239: The MSRV step (id: msrv) uses `toml get` which can return
a quoted string and break the toolchain setup; update the run block that sets
MSRV so it normalizes/strips surrounding quotes (e.g., trim whitespace and
remove leading/trailing double quotes) after invoking `toml get` and before
exporting to GITHUB_OUTPUT, and keep using that cleaned variable when passing
toolchain: ${{ steps.msrv.outputs.MSRV }} to
actions-rust-lang/setup-rust-toolchain@v1.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f60e6a76-8799-47f7-a31d-252761846ede

📥 Commits

Reviewing files that changed from the base of the PR and between 8f2addd and 92e3714.

📒 Files selected for processing (4)
  • .github/workflows/cargo.yml
  • .github/workflows/main.yml
  • .github/workflows/nightly.yml
  • rust-toolchain.toml

Comment thread .github/workflows/main.yml Outdated
steps:
- name: Install git
run: dnf install -y git
run: dnf install -y git pip
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

What is the correct DNF package name for pip on Fedora 33, 34, and 38?

💡 Result:

The correct DNF package name for pip on Fedora 33, 34, and 38 is python3-pip [1][2][3]. You can install it using the following command: sudo dnf install python3-pip Once installed, it is standard practice on Fedora to use the pip3 command or the python3 -m pip module to interact with pip for Python 3 [4][3][5].

Citations:


Incorrect package name for pip on Fedora.

The command dnf install -y git pip uses pip as the package name, but on Fedora the correct package is python3-pip.

🐛 Proposed fix
        run: dnf install -y git pip
+       run: dnf install -y git python3-pip
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run: dnf install -y git pip
run: dnf install -y git python3-pip
🤖 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/main.yml at line 226, The workflow step that runs the
package install uses the wrong Fedora package name ("dnf install -y git pip");
update that run command to install python3-pip instead of pip so the correct
Fedora package is used (replace the occurrence of "pip" in the run command with
"python3-pip").

@mulkieran mulkieran force-pushed the issue_project_819 branch from 92e3714 to eb7af5f Compare May 18, 2026 17:57
Use the values specified in these files to set toolchain versions in CI.

Signed-off-by: mulhern <amulhern@redhat.com>
@mulkieran mulkieran force-pushed the issue_project_819 branch from eb7af5f to e8fd0de Compare May 18, 2026 18:14
@mulkieran mulkieran merged commit 4bf12df into stratis-storage:master May 18, 2026
45 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in 2026May May 18, 2026
@mulkieran mulkieran deleted the issue_project_819 branch May 18, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant