Stop autorest upgrade-check from egressing to npmjs (CFSClean) - #3696
Merged
Ramses Sanchez-Hernandez (ramsessanchez) merged 1 commit intoAug 5, 2026
Merged
Conversation
The PowerShell generation pipelines (187/221/663) still tripped CFSClean with node.exe -> registry.npmjs.org despite the private-feed .npmrc and autorest cache pre-population. The residual leak is autorest core's upgrade check: check-autorest-update.ts calls the public npm registry unless --skip-upgrade-check is set (@autorest/modelerfour is already passed as a local --use, so it is not the source). Add --skip-upgrade-check to the autorest invocation in GenerateServiceModule.ps1, and set npm_config_registry from the authenticated ~/.npmrc as belt-and-suspenders so any autorest npm-registry-fetch uses the private feed rather than defaulting to registry.npmjs.org. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d3f8fec7-b00b-46be-ba39-7e1f3e7f7188
Ramses Sanchez-Hernandez (ramsessanchez)
approved these changes
Aug 5, 2026
Ramses Sanchez-Hernandez (ramsessanchez)
merged commit Aug 5, 2026
436cf6b
into
main
6 of 8 checks passed
Ramses Sanchez-Hernandez (ramsessanchez)
deleted the
gavinbarron/cfs-autorest-skip-upgrade
branch
August 5, 2026 23:19
Ramses Sanchez-Hernandez (ramsessanchez)
pushed a commit
that referenced
this pull request
Aug 6, 2026
…an) (#3697) 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Stops the residual CFSClean network-isolation violation on the PowerShell generation pipelines (187 PowerShell V2 Build, 221 Weekly PowerShell V2 Build, 663 Command-Metadata-Refresh):
node.exe->registry.npmjs.orgduring autorest generation.Why
The repo already has a thorough private-feed npm setup (
Configure-PrivateNpmFeed.ps1,install-tools.ymlcopying an authenticated.npmrcto~/.npmrc,PrePopulateAutorestCache.ps1, and@autorest/modelerfourpassed as a local--use:path). ThePowerShell_V2_Buildfeed serves the autorest packages from itself (verified), so package downloads don't leak.The residual egress is autorest core's upgrade check. In
Azure/autorest,check-autorest-update.tsqueries the public npm registry unless--skip-upgrade-checkis set:The generation invocation in
GenerateServiceModule.ps1didn't set that flag, so every autorest run pinged npmjs to check for a newer@autorest/core.Changes (
tools/GenerateServiceModule.ps1)--skip-upgrade-checkto thenpx --no-install autorest ...command (gates the exact code path above).npm_config_registryfrom the authenticated~/.npmrcbefore the call — belt-and-suspenders so any autorestnpm-registry-fetchuses the private feed instead of defaulting toregistry.npmjs.org. (No feed URL is hard-coded; it's read from the.npmrcthatinstall-tools.ymlalready produced.)Notes
@autorest/core,@autorest/modelerfour), and the PowerShell generator is a local submodule (use:local path) — so no cache expansion was needed; the leak was purely the upgrade check.www/cdn.powershellgallery.com) — a looser tier, out of scope here.mainpost-merge to confirm theregistry.npmjs.orgegress is gone.Relates to S360 KPI 527fb616-07aa-8198-6419-50d04ef1c2f3 (1ES network isolation).