Skip to content

Remove Corepack from extension build scripts - #17627

Closed
joperezr wants to merge 1 commit into
microsoft:mainfrom
joperezr:revert-extension-corepack-main
Closed

Remove Corepack from extension build scripts#17627
joperezr wants to merge 1 commit into
microsoft:mainfrom
joperezr:revert-extension-corepack-main

Conversation

@joperezr

Copy link
Copy Markdown
Member

Description

Reverts the Corepack-specific Yarn invocation added to the VS Code extension build scripts.

Internal Azure Pipelines builds run with network isolation, and corepack yarn@1.22.22 attempts to download Yarn from the public Yarn registry before the extension's .yarnrc package registry configuration is used. That public download is blocked in internal builds. This change keeps the Yarn-only/frozen-lockfile restore path, but invokes the configured yarn executable directly again so the build no longer depends on Corepack fetching Yarn from the public registry.

Validation:

  • git diff --check
  • Parsed extension\Extension.proj as XML
  • Confirmed no corepack references remain in the targeted extension build files

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

Revert the Corepack-specific Yarn invocation added to the extension build so internal Azure Pipelines builds use the configured Yarn executable instead of downloading Yarn from the public registry.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 28, 2026 21:00
@joperezr
joperezr requested a review from adamint as a code owner May 28, 2026 21:00
@github-actions

Copy link
Copy Markdown
Contributor

🚀 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 -- 17627

Or

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the VS Code extension build pipeline to stop using Corepack’s Yarn invocation and instead call yarn directly, avoiding Corepack’s attempt to download Yarn from the public registry in network-isolated build environments.

Changes:

  • Replaced corepack yarn@1.22.22 … with direct yarn … invocations in the MSBuild extension packaging project.
  • Updated bash and PowerShell build scripts to check for yarn instead of corepack and to run yarn install/yarn compile directly.
  • Updated error messaging to reflect the new prerequisite (Yarn on PATH).
Show a summary per file
File Description
extension/Extension.proj Switches MSBuild exec steps from Corepack Yarn to direct yarn commands; updates prerequisite check/error text.
extension/build.sh Replaces Corepack checks/invocations with yarn checks/invocations for install/compile.
extension/build.ps1 Replaces Corepack checks/invocations with yarn checks/invocations for install/compile.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 3

Comment thread extension/Extension.proj
<Error Condition="'$(YarnExitCode)' != '0'" Text="Corepack is not installed or cannot run Yarn Classic. To build the extension, install a Node.js version that includes Corepack." />
<Error Condition="'$(YarnExitCode)' != '0'" Text="yarn is not installed or not available in PATH. To build the extension, install yarn: https://yarnpkg.com/getting-started/install" />

<Message Importance="high" Text="yarn version: $(YarnVersion)" />
Comment thread extension/build.sh
Comment on lines +12 to 18
# Check for yarn
if ! command -v yarn &> /dev/null; then
echo "Error: yarn is not installed. Please install yarn first."
echo "You can install yarn by running: npm install -g yarn"
exit 1
fi

Comment thread extension/build.ps1
Write-Host "You can install yarn by running: npm install -g yarn"
exit 1
}

@joperezr

Copy link
Copy Markdown
Member Author

Closing in favor of the release/13.4-targeted PR: #17628

@joperezr joperezr closed this May 28, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 13.5 milestone May 28, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants