-
Notifications
You must be signed in to change notification settings - Fork 887
Pin Corepack explicitly for the VS Code extension build #17630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adamint
wants to merge
20
commits into
microsoft:main
Choose a base branch
from
adamint:dev/adamint/extension-corepack
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
bf63569
Pin Corepack explicitly for the VS Code extension build
adamint aae3dd5
Address code review for Corepack pin
adamint bfe70a5
Drop unnecessary --registry override on corepack install
adamint 7b49877
Fix Corepack registry handling
adamint ff7454b
Avoid Corepack registry override for Azure Artifacts
adamint f544e0b
Force Corepack shim install in CI
adamint 0959adb
Prepend npm Corepack shim path in CI
adamint f8ea0a5
Seed Corepack Yarn cache via npm pack
adamint 98078ee
Invoke npm CLI directly for Corepack Yarn seed
adamint 1a26f40
Handle duplicate equivalent ATS capabilities
adamint d1c3252
Merge remote-tracking branch 'microsoft/main' into dev/adamint/extens…
adamint 328aa22
Align duplicate ATS compatibility fix
adamint bc819bc
Remove duplicate ATS compatibility fix
adamint 21d7304
Merge remote-tracking branch 'microsoft/main' into dev/adamint/extens…
adamint c15ab5a
Export NPM_REGISTRY in build.sh and document Corepack cache-path coup…
adamint 994f7b2
Address PR review feedback for Corepack bootstrap
adamint fdcb5f5
Set COREPACK_HOME via $GITHUB_ENV instead of job env
adamint 1c9eeee
Merge remote-tracking branch 'microsoft/main' into dev/adamint/extens…
adamint 93ac6f2
Address PR #17630 round-3 review feedback
adamint 0e2136e
Address PR #17630 Mitch review feedback
adamint File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| parameters: | ||
| # Prefix prepended to step displayNames (e.g. the 🟣 emoji used by the | ||
| # internal-1ES jobs in azure-pipelines.yml / azure-pipelines-unofficial.yml). | ||
| # Public/CodeQL pipelines omit it. Kept as a parameter so the displayName | ||
| # convention of each calling pipeline is preserved. | ||
| - name: displayPrefix | ||
| type: string | ||
| default: '' | ||
|
|
||
| steps: | ||
| - task: PowerShell@2 | ||
| displayName: ${{ parameters.displayPrefix }}Install Corepack | ||
| inputs: | ||
| targetType: 'inline' | ||
| script: | | ||
| # Pinned Corepack shim version, sourced from | ||
| # extension/scripts/corepack-version.txt so this script, | ||
| # extension/build.sh, extension/build.ps1, the GitHub Actions | ||
| # workflow, and every AzDO pipeline that references this template | ||
| # stay in sync. The Yarn release itself is pinned in | ||
| # extension/package.json via the `packageManager` field. | ||
| $CorepackVersion = (Get-Content -Raw -Path '$(Build.SourcesDirectory)/extension/scripts/corepack-version.txt').Trim() | ||
| $corepackHome = Join-Path '$(Agent.TempDirectory)' 'corepack' | ||
| $env:COREPACK_HOME = $corepackHome | ||
| Write-Host "##vso[task.setvariable variable=COREPACK_HOME]$corepackHome" | ||
|
|
||
| # Hosted Windows images can already have yarn in npm's global prefix. | ||
| # The npm Corepack package owns that shim too, so force only in CI | ||
| # where the tool install is job-scoped. | ||
| npm install -g --force --registry "$env:NPM_REGISTRY" "corepack@$CorepackVersion" | ||
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | ||
|
|
||
| $npmGlobalBin = (npm prefix --global).Trim() | ||
| $env:PATH = "$npmGlobalBin$([IO.Path]::PathSeparator)$env:PATH" | ||
| Write-Host "##vso[task.prependpath]$npmGlobalBin" | ||
|
|
||
| # Verify the version actually on PATH matches our pin. On Windows the | ||
| # Node.js installer registers a `corepack.cmd` under | ||
| # %ProgramFiles%\nodejs which may shadow the npm-global shim under | ||
| # %APPDATA%\npm, so a successful `npm install -g corepack@<version>` | ||
| # does NOT guarantee that subsequent `corepack` calls resolve to it. | ||
| $installed = (corepack --version).Trim() | ||
| if ($installed -ne $CorepackVersion) { | ||
| Write-Error "corepack version mismatch: expected $CorepackVersion, got '$installed'. The bundled Corepack on PATH may be taking precedence over the npm-global install." | ||
| exit 1 | ||
| } | ||
|
|
||
| corepack enable | ||
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | ||
|
|
||
| node ./scripts/prepareCorepackYarn.mjs | ||
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | ||
|
|
||
| corepack yarn --version | ||
| workingDirectory: '$(Build.SourcesDirectory)\extension' |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.