Skip to content

Design a maintainable guard for workflow Rust toolchain pinning #503

Description

@pawellisowski

Context

PR #490 fixed the two current workflow jobs that bypassed cli/rust-toolchain.toml. Its custom guard was intentionally removed before merge because review showed it was becoming an incomplete model of shell and GitHub Actions behavior.

Problem

A future workflow edit could reintroduce a floating or alternate Rust toolchain. A useful guard must cover more than literal cargo commands: actions such as Swatinem/rust-cache invoke Cargo internally, environment overrides can exist at workflow, job, container, and step scope, and nested tracked toolchain files can override the repository pin.

Desired outcome

Design a small, maintainable enforcement mechanism that:

  • covers direct Cargo steps and known Cargo-running actions;
  • accounts for supported GitHub Actions environment scopes, including container.env and Windows case-insensitive keys;
  • considers tracked repository toolchain files without scanning ignored worktrees;
  • avoids hand-parsing arbitrary shell;
  • fails clearly when a new workflow shape requires an explicit policy decision.

Acceptance

  • The guard rejects a floating installer, a literal alternate version, a late installer, a known Cargo-running action before installation, RUSTUP_TOOLCHAIN overrides, and tracked nested toolchain files.
  • It accepts ignored/untracked worktrees.
  • Its implementation remains deliberately bounded and reviewable.

Related: #490

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    qa-readyFix shipped or ready for QA validation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions