Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 23 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: cargo
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
- uses: baptiste0928/cargo-install@v3
with:
crate: typos-cli
Expand All @@ -100,10 +99,6 @@ jobs:
image: quay.io/fedora/fedora:43 # CURRENT DEVELOPMENT ENVIRONMENT
options: --privileged --userns=host --ipc=host -v /run/dbus/system_bus_socket:/run/dbus/system_bus_socket:ro -v /usr/share/dbus-1:/usr/share/dbus-1
steps:
- uses: dtolnay/rust-toolchain@master
with:
components: cargo
toolchain: 1.85.0 # LOWEST SUPPORTED RUST TOOLCHAIN
- name: Install python prerequisites
run: >
dnf install -y
Expand Down Expand Up @@ -141,12 +136,23 @@ jobs:
python3-psutil
python3-wcwidth
systemd-devel
toml-cli
- uses: stratis-storage/github-actions/github-modify@HEAD
with:
repo: stratisd
- name: Print head commit
run: git log --oneline -1
working-directory: stratisd
- name: Get package MSRV
id: msrv
run: |
MSRV=$(toml get --toml-path Cargo.toml "workspace.package.rust-version")
echo "MSRV=$MSRV" >> "$GITHUB_OUTPUT"
Comment on lines +149 to +150
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot May 16, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

For toml-cli, does toml get --toml-path Cargo.toml "workspace.package.rust-version"return quoted strings by default, and is--raw the correct way to emit an unquoted value for CI outputs?

💡 Result:

Yes, for the toml-cli tool (by gnprice), the toml get command emits data as JSON by default [1]. When the target data is a string, this default JSON output includes quotes [1]. Using the --raw (or -r) flag is the correct way to emit the value as a raw string without quotes, which is specifically designed for use in shell scripts and CI/CD pipelines [1]. Example usage: toml get --toml-path Cargo.toml "workspace.package.rust-version" --raw [1]

Citations:


Use --raw flag with toml get to extract unquoted MSRV values.

By default, toml-cli emits JSON-formatted output, which wraps string values in quotes. Without the --raw flag, MSRV will contain "1.xx" instead of 1.xx. Passing quoted strings to setup-rust-toolchain risks breaking toolchain resolution and failing CI jobs.

✅ Proposed fix
       - name: Get package MSRV
         id: msrv
         run: |
-          MSRV=$(toml get --toml-path Cargo.toml "workspace.package.rust-version")
+          MSRV=$(toml get --raw --toml-path Cargo.toml "workspace.package.rust-version")
+          test -n "$MSRV"
           echo "MSRV=$MSRV" >> "$GITHUB_OUTPUT"
         working-directory: stratisd

Also applies to: lines 152-155, 219-220, 222-225

🤖 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 149 - 150, The workflow extracts
MSRV with toml CLI but omits the --raw flag, so MSRV becomes a quoted JSON
string (e.g., "\"1.xx\"") which can break setup-rust-toolchain; update the
invocations that call toml get (the lines that set MSRV using toml get
--toml-path Cargo.toml "workspace.package.rust-version") to add the --raw flag
(toml get --raw ...) so the value is emitted unquoted, and apply the same change
to the other toml get occurrences noted (the blocks that set MSRV and other Rust
version variables used by setup-rust-toolchain).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

toml-cli get has no --raw flag and its output without that non-existent --raw flag is plain text.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@mulkieran, you are correct — I apologize for the confusion. My review comment was based on the gnprice/toml-cli Rust crate, which outputs JSON by default and requires --raw/-r to print strings directly. However, the workflow uses --toml-path syntax, which identifies it as the Python toml-cli from PyPI — a completely different tool that outputs plain text by default and does not have a --raw flag. The review comment was incorrect and the existing code is fine. Sorry for the noise!


✏️ Learnings added
Learnt from: mulkieran
Repo: stratis-storage/stratis-cli PR: 1282
File: .github/workflows/main.yml:149-150
Timestamp: 2026-05-18T15:18:25.754Z
Learning: In stratis-cli's GitHub Actions workflows (.github/workflows/main.yml), the `toml-cli` package installed via `dnf install -y toml-cli` is the Python toml-cli from PyPI (not gnprice's Rust toml-cli). It uses `--toml-path` flag syntax (e.g., `toml get --toml-path Cargo.toml "workspace.package.rust-version"`) and outputs plain text (unquoted strings) by default. It does NOT have a `--raw` flag and does NOT require one to get unquoted output.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

working-directory: stratisd
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: cargo
toolchain: ${{ steps.msrv.outputs.MSRV }}
- name: Overwrite stratisd dependencies as necessary
uses: stratis-storage/github-actions/stratisd-modify@HEAD
with:
Expand Down Expand Up @@ -200,16 +206,23 @@ jobs:
python3-psutil
python3-wcwidth
systemd-devel
- uses: dtolnay/rust-toolchain@master
with:
components: cargo
toolchain: 1.85.0 # LOWEST SUPPORTED RUST TOOLCHAIN
toml-cli
- uses: stratis-storage/github-actions/github-modify@HEAD
with:
repo: stratisd
- name: Print head commit
run: git log --oneline -1
working-directory: stratisd
- name: Get package MSRV
id: msrv
run: |
MSRV=$(toml get --toml-path Cargo.toml "workspace.package.rust-version")
echo "MSRV=$MSRV" >> "$GITHUB_OUTPUT"
working-directory: stratisd
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: cargo
toolchain: ${{ steps.msrv.outputs.MSRV }}
- name: Overwrite stratisd dependencies as necessary
uses: stratis-storage/github-actions/stratisd-modify@HEAD
with:
Expand Down
Loading