Skip to content

CI: pin cargo-deny/cargo-vet install versions - #2168

Merged
nullPointerEnjoyer merged 2 commits into
masterfrom
chore/pin-cargo-ci-tools
Nov 20, 2026
Merged

nullPointerEnjoyer merged 2 commits into
masterfrom
chore/pin-cargo-ci-tools

Conversation

@nullPointerEnjoyer

Copy link
Copy Markdown
Collaborator

cargo-deny 0.22.0 was released today and requires rustc 1.95, breaking every static-checks run on the 1.92 toolchain (the current runs for #2093 and #2167 fail at the install step). Pin cargo-deny to 0.21.0 (the last release supporting the CI toolchain) and cargo-vet to the version currently in use, preventing this breakage class. Unpinned install-latest steps are a standing availability risk for every PR's CI.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

🔍 OpenCodeReview found 4 issue(s) in this PR.

  • ✅ Successfully posted inline: 0 comment(s)
  • 📋 Routed to summary by policy: 2 comment(s)
  • ❌ Failed to post inline: 2 comment(s)

performance · low

📄 .github/workflows/code_checks.yml (L47-L48)

⚠️ GitHub could not post this as an inline comment: Routed to summary (severity low · category performance)

Pinning the versions is good, but cargo install still compiles both tools from source on every run (each takes several minutes). Consider caching these installations (e.g., actions/cache keyed on the pinned versions, or use taiki-e/install-action which downloads prebuilt binaries), especially since this workflow also runs on a daily schedule.

💡 Suggested Change

Before:

      - name: Install cargo-deny
        run: cargo install cargo-deny --locked --version 0.21.0

After:

      - name: Cache cargo-deny and cargo-vet installs
        uses: actions/cache@v4
        with:
          path: ~/.cargo/bin
          key: cargo-tools-deny-0.21.0-vet-0.10.2-${{ runner.os }}

performance · low

📄 .github/workflows/code_checks.yml (L14-L15)

⚠️ GitHub could not post this as an inline comment: Routed to summary (severity low · category performance)

The workflow triggers on push, pull_request, and a daily schedule with no concurrency group, so force-pushes to a PR can queue up multiple redundant expensive runs (each compiles tooling from source). Add a concurrency group with cancel-in-progress for push/PR events.

💡 Suggested Change

Before:

env:
  CARGO_TERM_COLOR: always

After:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always

maintainability · medium

📄 .github/workflows/code_checks.yml (L19-L21)

⚠️ GitHub could not post this as an inline comment: Lines 19-21 could not be resolved (outside PR diff hunks)

This workflow has no top-level permissions: key, so jobs run with the default (potentially broad) token permissions. These are read-only static checks that don't need any token access; declare least-privilege permissions explicitly.

💡 Suggested Change

Before:

jobs:
  static_checks_ubuntu:
    runs-on: ubuntu-latest

After:

permissions:
  contents: read

jobs:
  static_checks_ubuntu:
    runs-on: ubuntu-latest

maintainability · medium

📄 .github/workflows/code_checks.yml (L20-L22)

⚠️ GitHub could not post this as an inline comment: Lines 20-22 could not be resolved (outside PR diff hunks)

None of the jobs set timeout-minutes. Since these jobs compile cargo-deny/cargo-vet from source (several minutes each), a stuck step (e.g., network hang during rustup/cargo install) can consume runner time indefinitely. Add an explicit timeout to each job.

💡 Suggested Change

Before:

  static_checks_ubuntu:
    runs-on: ubuntu-latest
    steps:

After:

  static_checks_ubuntu:
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:

Comment thread .github/workflows/code_checks.yml Outdated

- name: Install cargo-deny
run: cargo install cargo-deny --locked
run: cargo install cargo-deny --locked --version 0.21.0 --version 0.21.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · critical
cargo-deny's install accepts only one --version flag; repeating it twice will cause a CLI argument error, breaking all three jobs. Keep a single --version 0.21.0.

Suggestion:

Suggested change
run: cargo install cargo-deny --locked --version 0.21.0 --version 0.21.0
run: cargo install cargo-deny --locked --version 0.21.0

Comment thread .github/workflows/code_checks.yml Outdated

- name: Install cargo-vet
run: cargo install cargo-vet --locked
run: cargo install cargo-vet --locked --version 0.10.2:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · critical
Stray trailing colon after the version: --version 0.10.2: is not a valid semver, so cargo will fail to parse it and the install step will error in all three jobs.

Suggestion:

Suggested change
run: cargo install cargo-vet --locked --version 0.10.2:
run: cargo install cargo-vet --locked --version 0.10.2

@nullPointerEnjoyer
nullPointerEnjoyer merged commit 1ef6272 into master Nov 20, 2026
21 checks passed
@nullPointerEnjoyer
nullPointerEnjoyer deleted the chore/pin-cargo-ci-tools branch November 20, 2026 14:40
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.

2 participants