Use Yarn-only restore for VS Code extension#17474
Conversation
Make the VS Code extension build use Yarn as the single authoritative package manager. Add a pre-restore MSBuild guard for public npm registry URLs, use frozen non-interactive Yarn installs, remove the npm package lock/overrides, and fix leaked public registry URLs in yarn.lock. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17474Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17474" |
Update the VS Code extension test workflow to use the same Yarn-only restore path as the extension build. The workflow now validates lockfile registries before restore, uses frozen Yarn install, runs tests with Yarn, and packages via the local vsce dependency. Also update extension build scripts to use frozen non-interactive Yarn installs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR makes Yarn the single authoritative package manager for restoring, building, testing, and packaging the VS Code extension, primarily to avoid failures on internal agents that cannot reach public npm registries.
Changes:
- Switches extension build/test/package paths to use
yarn install --frozen-lockfile --non-interactiveand Yarn-based script invocations. - Adds MSBuild-time validation to fail fast if
extension/yarn.lockcontains public npm/Yarn registry URLs. - Updates the GitHub Actions extension test job to use Yarn and updates docs/scripts accordingly.
Show a summary per file
| File | Description |
|---|---|
extension/yarn.lock |
Rewrites a few resolved tarball URLs to use the internal dotnet-public-npm feed instead of registry.npmjs.org. |
extension/package.json |
Updates scripts to call through Yarn and removes npm overrides (leaving Yarn resolutions as the pin mechanism). |
extension/Extension.proj |
Uses Yarn for version override + frozen/non-interactive installs; adds a target to reject public-registry URLs in yarn.lock. |
extension/CONTRIBUTING.MD |
Updates contributor guidance to reflect Yarn-only restore/pinning and the lockfile registry guard. |
extension/build.sh |
Removes npm prerequisite checks; switches to frozen/non-interactive Yarn install. |
extension/build.ps1 |
Removes npm prerequisite checks; switches to frozen/non-interactive Yarn install. |
.github/workflows/tests.yml |
Updates the Windows extension test job to validate the lockfile and run install/test/package via Yarn. |
Copilot's findings
- Files reviewed: 6/8 changed files
- Comments generated: 1
Update the GitHub Actions lockfile validation regex to match registry.npmjs.org and registry.yarnpkg.com explicitly so public registry URLs are caught before Yarn restore. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Regarding the top-level Copilot review summary: thanks, no code action was needed for the summary itself. I handled the actionable inline thread separately. |
|
❓ CLI E2E Tests unknown — 96 passed, 0 failed, 5 unknown (commit View all recordings
📹 Recordings uploaded automatically from CI run #26418513695 |
|
✅ No documentation update needed. docs_optional → build_or_ci_only / internal_refactor Triggered signals (1): Why this is a false positive: The All 8 changed files fall into build/CI/internal-contributor categories:
No user-facing Aspire functionality, public API, CLI command, configuration key, or published documentation was changed. The aspire.dev docs site has no coverage of yarn vs npm for VS Code extension contributor workflows, and none is needed. |
Description
Internal AzDO Windows builds were failing during the VS Code extension restore because
extension/yarn.lockcontained committedregistry.npmjs.orgtarball URLs. The internal agents block direct public npm access, which surfaced asconnect EACCES 192.0.2.14:443instead of a clear lockfile problem.This makes Yarn the single authoritative package manager for the extension restore and test paths.
Extension.projnow runsyarn install --frozen-lockfile --non-interactive, uses Yarn for version overrides, and fails before restore ifyarn.lockcontains public npm or Yarn registry URLs. The GitHub extension test workflow now uses the same Yarn-based install/test/version/package commands instead of npm, and the local extension build scripts use frozen non-interactive Yarn installs.The change also removes the extension
package-lock.jsonand npmoverrides, updates extension scripts/docs to use Yarn, and fixes the leakedpostcss,uuid, andweb-tree-sitterlockfile URLs to use the internaldotnet-public-npmfeed.Validation:
dotnet msbuild extension/Extension.proj /t:ValidateYarnLockRegistries /v:minimal /nologoyarn install --frozen-lockfile --non-interactive --ignore-scripts --forcewith no public registry access observedyarn run compile-testsyarn run compileyarn run lintyarn run vsce package --pre-release -o out/aspire-extension.vsixFixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?