Skip to content

Force autorest cache pre-population onto the private npm feed (CFSClean) - #3697

Merged
Ramses Sanchez-Hernandez (ramsessanchez) merged 1 commit into
mainfrom
gavinbarron/cfs-prepopulate-registry
Aug 6, 2026
Merged

Force autorest cache pre-population onto the private npm feed (CFSClean)#3697
Ramses Sanchez-Hernandez (ramsessanchez) merged 1 commit into
mainfrom
gavinbarron/cfs-prepopulate-registry

Conversation

@gavinbarron

Copy link
Copy Markdown
Member

What

Fixes the residual CFSClean network-isolation violation on the PowerShell pipelines (187/221/663): 2 registry.npmjs.org requests per build that remained after the autorest --skip-upgrade-check fix (#3696).

Root cause

Traced from build telemetry + task logs: the 2 hits come from the "Pre-populate autorest extension cache" task. PrePopulateAutorestCache.ps1 runs:

npm install @autorest/core@3.10.4      --prefix <cacheDir>
npm install @autorest/modelerfour@4.24.3 --prefix <cacheDir>

With --prefix, npm did not honor the registry/auth in the authenticated ~/.npmrc (produced by install-tools.yml) and reached registry.npmjs.org directly — each npm install = 1 hit, 2 total. The task meant to prevent autorest's npm calls was itself the leak.

Change (tools/Utilities/PrePopulateAutorestCache.ps1)

Derive --userconfig and --registry from the authenticated ~/.npmrc and pass them explicitly to each npm install, so both installs use the PowerShell_V2_Build private feed (no hard-coded URL). Warn if ~/.npmrc is missing.

Notes

  • Complements Stop autorest upgrade-check from egressing to npmjs (CFSClean) #3696 (autorest core upgrade-check) — together these should clear the registry.npmjs.org CFSClean egress for 187/221/663.
  • The private feed already serves these packages (verified), so the installs will resolve through it.
  • Needs a validation run on main post-merge to confirm zero registry.npmjs.org hits.

Relates to S360 KPI 527fb616-07aa-8198-6419-50d04ef1c2f3 (1ES network isolation).

PrePopulateAutorestCache.ps1 runs 'npm install <ext> --prefix <dir>' for @autorest/core and @autorest/modelerfour. With --prefix, npm did not honor the registry/auth in ~/.npmrc and reached registry.npmjs.org directly (2 hits/build) - the residual CFSClean violation on pipeline 187 after the autorest --skip-upgrade-check fix (#3696). Pass --userconfig and --registry explicitly (read from the authenticated ~/.npmrc that install-tools.yml produced) so both installs use the PowerShell_V2_Build private feed.

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 6, 2026 17:42
@ramsessanchez
Ramses Sanchez-Hernandez (ramsessanchez) merged commit e29ebec into main Aug 6, 2026
4 of 7 checks passed
@ramsessanchez
Ramses Sanchez-Hernandez (ramsessanchez) deleted the gavinbarron/cfs-prepopulate-registry branch August 6, 2026 23:50
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