Skip to content

Update Yarn usage to Yarn 4#16781

Draft
adamint wants to merge 7 commits intomicrosoft:mainfrom
adamint:dev/adamint/upgrade-yarn-to-v4
Draft

Update Yarn usage to Yarn 4#16781
adamint wants to merge 7 commits intomicrosoft:mainfrom
adamint:dev/adamint/upgrade-yarn-to-v4

Conversation

@adamint
Copy link
Copy Markdown
Member

@adamint adamint commented May 5, 2026

Description

Updates the repository's Yarn usage from Yarn Classic to Yarn 4.

Summary:

  • Installs Yarn 4.14.1 through Corepack in official, unofficial, and CodeQL pipelines, including an explicit corepack@latest install.
  • Bridges npmAuthenticate@0 credentials into Yarn 4 auth environment variables so the dnceng npm feed remains usable, and adds the missing npm auth setup to CodeQL because it builds the VS Code extension.
  • Migrates the VS Code extension from .yarnrc to .yarnrc.yml, pins packageManager to yarn@4.14.1, and regenerates extension/yarn.lock in Yarn 4 format.
  • Updates extension build helpers/docs to use Corepack and removes the orphan root Yarn Classic lockfile.

Validation:

  • YARN_NPM_REGISTRY_SERVER=https://registry.npmjs.org YARN_NPM_ALWAYS_AUTH=false yarn install --immutable from extension/ passed with existing peer dependency warnings.
  • git diff --check passed.
  • VS Code diagnostics show no errors in azure-pipelines-codeql.yml, azure-pipelines-unofficial.yml, or extension/.yarnrc.yml; existing diagnostics remain in azure-pipelines.yml and extension/package.json.

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16781

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16781"

@adamint adamint marked this pull request as ready for review May 5, 2026 16:04
Copilot AI review requested due to automatic review settings May 5, 2026 16:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the repo’s VS Code extension and CI pipelines from Yarn Classic (v1) to Yarn 4, standardizing Yarn installation/activation via Corepack and updating config/lockfiles to the Yarn Berry format.

Changes:

  • Install/activate yarn@4.14.1 via Corepack in official, unofficial, and CodeQL Azure Pipelines.
  • Update the VS Code extension to use Yarn 4 conventions (packageManager, .yarnrc.yml) and remove the legacy .yarnrc and root Yarn Classic lockfile.
  • Add repo ignores for Yarn Berry artifacts and update extension build helpers/docs to reference Corepack.

Reviewed changes

Copilot reviewed 12 out of 15 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
yarn.lock Removes the root Yarn Classic (v1) lockfile.
extension/package.json Pins the package manager to yarn@4.14.1.
extension/Extension.proj Attempts to enable Yarn via Corepack before version checks during extension build.
extension/CONTRIBUTING.MD Updates contributor prerequisites to Corepack + pinned Yarn.
extension/build.sh Enables Yarn via Corepack when Yarn isn’t present; updates install guidance.
extension/build.ps1 Enables Yarn via Corepack when Yarn isn’t present; updates install guidance.
extension/.yarnrc.yml Introduces Yarn 4 config (node-modules linker, registry/auth settings).
extension/.yarnrc Removes legacy Yarn Classic configuration.
extension/.vscodeignore Excludes Yarn 4 config/artifacts from packaged VSIX.
eng/pipelines/azure-pipelines.yml Switches CI Yarn installation to Corepack + Yarn 4 and bridges npm auth into Yarn env vars.
eng/pipelines/azure-pipelines-unofficial.yml Same Yarn/Corepack + auth bridging updates for unofficial pipeline.
eng/pipelines/azure-pipelines-codeql.yml Adds npm auth + Yarn/Corepack setup so CodeQL can build the extension.
.gitignore Ignores Yarn Berry artifacts (.yarn/, .pnp.*).
.github/workflows/tests.yml Updates GitHub Actions test workflow to set up Yarn (per PR diff).

Comment thread eng/pipelines/azure-pipelines.yml Outdated
Comment thread eng/pipelines/azure-pipelines-unofficial.yml Outdated
Comment thread eng/pipelines/azure-pipelines-codeql.yml Outdated
Comment thread extension/build.sh Outdated
Comment thread extension/build.sh
Comment thread extension/build.ps1 Outdated
Comment thread extension/build.ps1
Comment thread extension/Extension.proj
@adamint adamint marked this pull request as draft May 5, 2026 16:27
@adamint adamint marked this pull request as ready for review May 5, 2026 16:35
@adamint adamint marked this pull request as draft May 5, 2026 17: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