Fix CFS feeds#4976
Merged
Merged
Conversation
The prior commit a3316fa deleted the user .npmrc and left always-auth=true in the project .npmrc, but neither was the cause of the E401. The actual cause: the azure-public/cpp_PublicPackages CFS feed under CFSClean network isolation only serves package versions that have already been saved to the feed - it does not transparently pull from upstream npmjs. Requests for yarn@1.22.19 return 401 because that tarball is not in the feed; yarn@1.22.22 IS in the feed and IS pre-installed on the 1ESPT-Windows2025 image. The npm error 'authentication token seems to be invalid' is just how npm formats any 401 with a WWW-Authenticate: Bearer header. This change adopts the working microsoft/vscode-cpptools and microsoft/vscode-makefile-tools loc pipeline pattern: - Use pre-installed Yarn 1.22.22 (no npm install -g yarn). - Use @vscode/vsce from devDependencies via 'yarn run vsce' (no npm install -g @vscode/vsce) in pipelines that check out the repo. - Drop always-auth=true from .npmrc. It is a no-op for anonymous CFS reads in both clients: npm 10 ignores it entirely (removed in v7.11.1, will warn/error in npm 11/12), and Yarn 1 gates the Authorization header behind 'if (authorization)' so it has no effect without a configured credential. Mirrors microsoft/vscode-cpptools#13377. - Bump the packageManager field to yarn@1.22.22 to match the pre-installed Yarn the signing pipelines now rely on. - Keep the del %USERPROFILE%\.npmrc cleanup step and the npm_config_registry env on yarn/vsce steps as defense-in-depth. Both are no-ops on the current 1ESPT-Windows2025 image and yarn.lock pinning, but guard against future image changes that inject a scoped .npmrc or a tool that reads npm_config_registry directly. The release.yml / prerelease.yml release jobs do not check out the repo, so they cannot use the devDependency. They keep 'npm install -g @vscode/vsce' but pin to @3.1.0 - the same version the build pipelines resolve via yarn.lock, verified saved in the CFS feed. Without a pin, npm would resolve 'latest' to 3.9.2, which is NOT saved in the feed and 401s; a3316fa inherited this latent bug from #4086. Pinning to 3.1.0 keeps the package, sign, and publish steps on a single vsce version. Long-term, the cleaner fix is to bundle vsce into the vsix artifact so release jobs never hit the feed for tooling.
snehara99
approved these changes
Jun 16, 2026
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.
The prior commit a3316fa deleted the user .npmrc and left always-auth=true in the project .npmrc, but neither was the cause of the E401. The actual cause: the azure-public/cpp_PublicPackages CFS feed under CFSClean network isolation only serves package versions that have already been saved to the feed - it does not transparently pull from upstream npmjs. Requests for yarn@1.22.19 return 401 because that tarball is not in the feed; yarn@1.22.22 IS in the feed and IS pre-installed on the 1ESPT-Windows2025 image. The npm error 'authentication token seems to be invalid' is just how npm formats any 401 with a WWW-Authenticate: Bearer header.
This change adopts the working microsoft/vscode-cpptools and microsoft/vscode-makefile-tools loc pipeline pattern:
The release.yml / prerelease.yml release jobs do not check out the repo, so they cannot use the devDependency. They keep 'npm install -g @vscode/vsce' but pin to @3.1.0 - the same version the build pipelines resolve via yarn.lock, verified saved in the CFS feed. Without a pin, npm would resolve 'latest' to 3.9.2, which is NOT saved in the feed and 401s; a3316fa inherited this latent bug from #4086. Pinning to 3.1.0 keeps the package, sign, and publish steps on a single vsce version.
Long-term, the cleaner fix is to bundle vsce into the vsix artifact so release jobs never hit the feed for tooling.