From f23434a3a137d31242c59f75f75895c7c6228c6a Mon Sep 17 00:00:00 2001 From: Abram Sanderson Date: Wed, 24 Sep 2025 12:58:06 -0700 Subject: [PATCH] Allow specifying primary registry in include-install-pnpm.yaml --- tools/pipelines/templates/include-install-pnpm.yml | 8 ++++++-- .../templates/include-upload-stage-telemetry.yml | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/pipelines/templates/include-install-pnpm.yml b/tools/pipelines/templates/include-install-pnpm.yml index 58b1317191b3..0650a87808e3 100644 --- a/tools/pipelines/templates/include-install-pnpm.yml +++ b/tools/pipelines/templates/include-install-pnpm.yml @@ -27,6 +27,10 @@ parameters: type: string default: $(Agent.TempDirectory)/.npmrc +- name: primaryRegistry + type: string + default: $(ado-feeds-primary-registry) + steps: - ${{ if eq(parameters.enableCache, true) }}: - task: Cache@2 @@ -69,13 +73,13 @@ steps: echo "##vso[task.setvariable variable=registryType]private" fi env: - NPM_REGISTRY: $(ado-feeds-primary-registry) + NPM_REGISTRY: ${{ parameters.primaryRegistry }} NPM_CONFIG_USERCONFIG: ${{ parameters.userNpmrcPath}} # We should leverage the primary npm registry to install pnpm as well. However, ADO artifacts feeds do not implement # the full npm registry API including a route that corepack uses to get package metadata--the version route here: # https://github.com/nodejs/corepack/blob/bc13d40037d0b1bfd386e260ae741f55505b5c7c/sources/npmRegistryUtils.ts#L32 # Thus installing pnpm from an ADO feed using corepack is not possible at time of writing. - # COREPACK_NPM_REGISTRY: $(ado-feeds-primary-registry) + # COREPACK_NPM_REGISTRY: ${{ parameters.primaryRegistry }} # Authenticate to npm feed if required - task: npmAuthenticate@0 diff --git a/tools/pipelines/templates/include-upload-stage-telemetry.yml b/tools/pipelines/templates/include-upload-stage-telemetry.yml index 348a17b5ba1e..25a8aad2a38f 100644 --- a/tools/pipelines/templates/include-upload-stage-telemetry.yml +++ b/tools/pipelines/templates/include-upload-stage-telemetry.yml @@ -49,6 +49,7 @@ stages: - template: /tools/pipelines/templates/include-install-pnpm.yml@self parameters: buildDirectory: $(Build.SourcesDirectory) + primaryRegistry: $(ado-feeds-ff-download-only) - task: Bash@3 displayName: 'Install dependencies'