Skip to content

CFSClean: Rush toolchain private-feed fix + transient tool-install retries - #3718

Open
Gavin Barron (gavinbarron) wants to merge 2 commits into
mainfrom
gavinbarron/cfs-rush-toolchain-registry
Open

CFSClean: Rush toolchain private-feed fix + transient tool-install retries#3718
Gavin Barron (gavinbarron) wants to merge 2 commits into
mainfrom
gavinbarron/cfs-rush-toolchain-registry

Conversation

@gavinbarron

@gavinbarron Gavin Barron (gavinbarron) commented Aug 13, 2026

Copy link
Copy Markdown
Member

CFSClean: fix Rush toolchain self-install npm egress + harden transient tool installs

Two related changes to the shared common-templates/install-tools.yml (used by pipelines 187, 221, 663).

1. Force the Rush toolchain self-install onto the private npm feed (CFSClean, strict tier)

After #3696 / #3697 / #3703, the SDK dependency restore is clean, but a validation run (build 231349) still showed 2 residual registry.npmjs.org hits (PolicyViolation = CFSClean, the strict tier) in the Rush Build step. They are Rush self-installing its own toolchainrush install bootstraps the pinned Rush (5.170.1) and pnpm (10.32.1) by running npm install into ~/.rush/..., and those self-install calls do not honor the transformed common/config/rush/.npmrc registry, so they fall back to registry.npmjs.org.

Fix: set $env:npm_config_registry to the authenticated private feed (read from ~/.npmrc) at the top of the Rush Build step — the same technique already used in GenerateServiceModule.ps1 for autorest's internal npm calls. npm_config_registry is the highest-precedence npm config source and is inherited by every child process (npxrushnpm).

2. Retry transient tool-install steps (build reliability)

The Weekly build (221) intermittently fails at network-dependent installs in this template (observed: UseDotNet@2 extraction collision dotnet.exe already exists, and Install Rush). Added retryCountOnTaskFailure: 2 to the UseDotNet@2 (x2), NodeTool@0, and the three Npm@1 install steps so a transient failure retries instead of failing the whole generation build — improving the odds of a clean, trustworthy CFSClean validation run.

Scope / tiers

  • This removes the strict-tier (CFSClean) registry.npmjs.org egress for 187/221/663.
  • The PowerShell Gallery egress (www.powershellgallery.com / CDN) is a separate CFSClean2-tier item, remediated in a follow-up (route module installs through a private PSResource feed).

Validation

187 build 233065 (this branch) in progress; expect registry.npmjs.org = 0 in the Rush Build step. Then re-run 221/663.

After #3696/#3697/#3703, pipeline 187's SDK dependency restore is clean, but 2 residual registry.npmjs.org hits remain in the Rush Build step. They are Rush self-installing its own toolchain: `rush install` downloads the pinned Rush and pnpm packages into ~/.rush via `npm install`, and those npm invocations do not honor the transformed common/config/rush/.npmrc registry, so they fall back to registry.npmjs.org (verified: build 231349, node.exe during Rush Build).

Fix: set $env:npm_config_registry to the authenticated private feed (read from ~/.npmrc) at the top of the Rush Build step, mirroring the same approach already used in GenerateServiceModule.ps1 for autorest's internal npm calls. npm_config_registry is the highest-precedence npm config source and is inherited by every child process (npx -> rush -> npm), so it covers the self-install npm calls that bypass the .npmrc. Auth continues to come from ~/.npmrc (the URL matches).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d3f8fec7-b00b-46be-ba39-7e1f3e7f7188
@gavinbarron
Gavin Barron (gavinbarron) requested a review from a team as a code owner August 13, 2026 21:52
…liability)

The Weekly PowerShell V2 Build (221) intermittently fails at network-dependent tool-install steps in the shared install-tools.yml (observed: UseDotNet@2 extraction collision "dotnet.exe already exists", and Install Rush). These are transient — 187/663 pass on the same template. Add retryCountOnTaskFailure: 2 to the UseDotNet@2 (x2), NodeTool@0, and the three Npm@1 install steps so a transient failure retries instead of failing the whole generation build, improving the odds of a clean, trustworthy CFSClean validation run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d3f8fec7-b00b-46be-ba39-7e1f3e7f7188
@gavinbarron Gavin Barron (gavinbarron) changed the title Force Rush toolchain self-install onto the private npm feed (CFSClean) CFSClean: Rush toolchain private-feed fix + transient tool-install retries Aug 13, 2026
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