Azure / Azure/azure-sdk-for-rust
Deprecate use-rust.yml step template
- Dominant language
- Rust
- Stars
- 884
- Forks
- 365
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 109
Description
Now that #4486 is merged, we should look at either removing or limiting use of `eng/pipelines/templates/steps/use-rust.yml`. It seems to be wrong in some uses, deciding on 1.92 but then we end up using a `stable` or `nightly` pinned toolchain making that previous `rustup set active` call useless and even deceptive when diagnosing pipeline failures.
I had copilot build a call graph and where the `Toolchain` parameter is set:
---
Top-level pipeline roots under eng/pipelines that reach use-rust.yml: pr.yml and pullrequest.yml. prepare-pipelines.yml does not. There is also one standalone template path via templates/jobs/perf.yml, but nothing under eng/pipelines references it.
- eng/pipelines/pullrequest.yml
- templates/stages/archetype-sdk-client.yml - templates/jobs/ci.yml - templates/jobs/pack.yml - templates/steps/use-rust.yml — Toolchain not passed → defaults to active
- templates/steps/use-rust.yml — Toolchain: $(PackToolchain) → 1.92
- templates/jobs/analyze.yml — ci.yml sets Toolchain*#COLON|* stable - templates/steps/use-rust.yml — Toolchain: nightly (conditional: only when analyze toolchain != nightly)
- templates/steps/use-rust.yml — Toolchain: stable
- eng/common/pipelines/templates/jobs/generate-job-matrix.yml - templates/jobs/ci.tests.yml - templates/steps/use-rust.yml — Toolchain*#COLON|* $(RustToolchainName) - from templates/stages/pr-platform-matrix.json
- values used: stable on Ubuntu/Windows/macOS; msrv and nightly only on Ubuntu
- eng/common/pipelines/templates/jobs/generate-job-matrix.yml - templates/jobs/live.tests.yml - templates/steps/use-rust.yml — Toolchain: $(RustToolchainName)
- this path exists in the hierarchy, but pullrequest.yml sets RunLiveTests: false
- templates/stages/archetype-rust-release.yml - templates/steps/use-rust.yml — Toolchain: nightly
- this path is present in the template, but pullrequest.yml sets IncludeRelease: false
- eng/pipelines/pr.yml
- same template chain as pullrequest.yml
- differences: - MatrixConfigs comes from archetype-sdk-client.yml defaults, so ci.tests.yml gets $(RustToolchainName) = stable | msrv | nightly from templates/stages/platform-matrix.json
- RunLiveTests is not set here, so it stays false by default
- IncludeRelease stays true by default, so the release path is not disabled by parameter, but it is still gated by the stage conditions in archetype-sdk-client.yml
- Standalone template path not referenced by another file in eng/pipelines
- templates/jobs/perf.yml - eng/common/pipelines/templates/jobs/perf.yml - InstallLanguageSteps - templates/steps/use-rust.yml — Toolchain: stable
Templates that set Toolchain on the way to use-rust.yml:
- templates/jobs/ci.yml → stable for analyze.yml
- templates/jobs/analyze.yml → nightly, then ${{ parameters.Toolchain }}
- templates/jobs/pack.yml → omitted once, then $(PackToolchain) = 1.92
- templates/jobs/ci.tests.yml → $(RustToolchainName)
- templates/jobs/live.tests.yml → $(RustToolchainName)
- templates/stages/archetype-rust-release.yml → nightly
- templates/jobs/perf.yml → stable
Contributor guide
Research direction
Start with eng/pipelines/templates/steps/use-rust.yml and trace its callers through pr.yml, pullrequest.yml, and the listed job and stage templates. Compare each Toolchain value, including stable, nightly, 1.92, and RustToolchainName, against the rustup set active behavior. Done means the template is removed or its uses are limited so the selected toolchain is not misleading when diagnosing pipeline failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, ci-cd, devops
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100