Remove always-auth.#13377
Conversation
|
This line is still in the instructions for CFS. Are you sure it needs to be removed now? We could wait until we upgrade to a version of npm that fails. There is also a .npmrc in the |
We could wait 11 is the current version and it says it'll be removed in 12, but it said it was removed in npm 7 in 2021 because it wasn't used: https://docs.npmjs.com/cli/v7/using-npm/changelog#v7111-2021-04-23 |
…ft/vscode-cpptools into seanmcm/removeAlwaysAuth
There was a problem hiding this comment.
Pull request overview
Removes the deprecated always-auth=true setting from both .npmrc files to silence an npm warning.
Changes:
- Drop
always-auth=truefromExtension/.npmrc - Drop
always-auth=truefrom.github/actions/.npmrc
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Extension/.npmrc | Removes deprecated always-auth option. |
| .github/actions/.npmrc | Removes deprecated always-auth option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
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.
…401 (#4976) 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.
Fix npm warning: