Skip to content

fix(ci): configure pnpm to use authenticated registry#27699

Open
MarioJGMsoft wants to merge 2 commits into
microsoft:mainfrom
MarioJGMsoft:mariojgmsoft-fix-pnpm-userconfig
Open

fix(ci): configure pnpm to use authenticated registry#27699
MarioJGMsoft wants to merge 2 commits into
microsoft:mainfrom
MarioJGMsoft:mariojgmsoft-fix-pnpm-userconfig

Conversation

@MarioJGMsoft

@MarioJGMsoft MarioJGMsoft commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description

The client pipeline already configures an artifct for npm. However, pnpm 11 does not automatically adopt that configuration through NPM_CONFIG_USERCONFIG.

Set PNPM_CONFIG_USERCONFIG so pnpm 11 adopts the pipeline's existing configuration. This ensures pnpm registry commands, including registry-backed version utility tests, use the appropriate configuration

Reviewer Guidance

The review process is outlined on this wiki page.

Fixes AB#73158

Set PNPM_CONFIG_USERCONFIG to the authenticated Azure Artifacts npmrc so pnpm 11 registry commands do not fall back to the public npm registry.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 34c6e107-8597-4cc1-bae3-00a842a57870
@github-actions

Copy link
Copy Markdown
Contributor

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (1 lines, 1 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

@MarioJGMsoft
MarioJGMsoft marked this pull request as ready for review July 15, 2026 23:00
Copilot AI review requested due to automatic review settings July 15, 2026 23:00

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.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

set -eu -o pipefail
echo "Using node $(node --version)"
echo "##vso[task.setvariable variable=NPM_CONFIG_USERCONFIG]$NPM_CONFIG_USERCONFIG"
echo "##vso[task.setvariable variable=PNPM_CONFIG_USERCONFIG]$NPM_CONFIG_USERCONFIG"

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.

I don't think this belongs here.

I see two reasons:

  1. This part of this pipeline is setting up npm so we can use npm to install pnpm. See the "Install and configure pnpm" section for where it would go.
  2. I'm pretty sure pnpm is picking up the existing npm setting already, since it wasn't, our pnpm install steps would already be failing to run under networks isolation. Maybe I'm missing something, but I think we have had such enforcement for a long time now, and this has been working as is.

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.

Another concerning thing looking at this change is we also set NPM_CONFIG_USERCONFIG in tools/pipelines/templates/include-setup-npmrc-for-download.yml : we should not be doing this in multiple places. If a change is need to this copy of the logic, one is likely needed there as well: we should deduplicate them first.

Also note there is additional logic to plumb NPM_CONFIG_USERCONFIG into our docker images, see its use in NPM_CONFIG_USERCONFIG

If there is some other special value we need for this for pnpm reasons, it likely would have to do something inside the docker image to handle it as well.

set -eu -o pipefail
echo "Using node $(node --version)"
echo "##vso[task.setvariable variable=NPM_CONFIG_USERCONFIG]$NPM_CONFIG_USERCONFIG"
echo "##vso[task.setvariable variable=PNPM_CONFIG_USERCONFIG]$NPM_CONFIG_USERCONFIG"

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.

Where is PNPM_CONFIG_USERCONFIG documented to be a thing pnpm looks at? I don't see it in its docs: https://pnpm.io/npmrc#auth-file-locations

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.

Those docs do state The npm-style NPM_CONFIG_USERCONFIG variable is also honored as a fallback. which implies NPM_CONFIG_USERCONFIG should just work (like think it has been), but nothing in there implies PNPM_CONFIG_USERCONFIG is a thing that has any impact.

PNPM_CONFIG_USERCONFIG is mentioned in the implementation of pnpm, just not in their docs (which is annoying):

https://github.com/search?q=repo%3Apnpm%2Fpnpm%20PNPM_CONFIG_USERCONFIG%20&type=code

The docs in https://github.com/pnpm/pnpm/blob/fb4639f8d2885da64b79cf97d385af97004b65b4/pnpm/crates/config/src/lib.rs#L1125-L1126 imply PNPM_CONFIG_NPMRC_AUTH_FILE / PNPM_CONFIG_USERCONFIG / npm_config_userconfig all do the same thing though thats from a future version of pnpm.

Anyway, I conclude I don't have enough information to know what's going on.

@github-actions

Copy link
Copy Markdown
Contributor

Bundle size comparison

Base commit: b72f836d09437654e0ef5787625073f9da41cf9f
Head commit: 7254e8abab050970d9ca4cea5f995d363986ef8c

Notable changes

No bundles changed by ≥ 500 bytes parsed.

Per-bundle deltas

@fluid-example/bundle-size-tests

  • azureClient.js: parsed 619911 → 619967 (+56), gzip 164958 → 165003 (+45)
  • odspClient.js: parsed 592637 → 592693 (+56), gzip 159070 → 159114 (+44)
  • aqueduct.js: parsed 526400 → 526435 (+35), gzip 140839 → 140870 (+31)
  • fluidFramework.js: parsed 394822 → 394843 (+21), gzip 112116 → 112132 (+16)
  • sharedTree.js: parsed 384209 → 384223 (+14), gzip 109499 → 109510 (+11)
  • containerRuntime.js: parsed 304750 → 304764 (+14), gzip 83332 → 83340 (+8)
  • sharedString.js: parsed 175984 → 175991 (+7), gzip 49445 → 49453 (+8)
  • experimentalSharedTree.js: parsed 160798 → 160798 (0), gzip 45804 → 45804 (0)
  • matrix.js: parsed 159845 → 159852 (+7), gzip 45411 → 45418 (+7)
  • loader.js: parsed 145256 → 145270 (+14), gzip 39063 → 39076 (+13)
  • odspDriver.js: parsed 104329 → 104350 (+21), gzip 32625 → 32635 (+10)
  • directory.js: parsed 66616 → 66623 (+7), gzip 18532 → 18540 (+8)
  • 748.js: parsed 58793 → 58793 (0), gzip 17827 → 17827 (0)
  • map.js: parsed 46709 → 46716 (+7), gzip 14310 → 14317 (+7)
  • odspPrefetchSnapshot.js: parsed 45642 → 45656 (+14), gzip 15277 → 15284 (+7)
  • 985.js: parsed 44491 → 44491 (0), gzip 13726 → 13726 (0)
  • summarizerDelayLoadedModule.js: parsed 30749 → 30749 (0), gzip 7753 → 7753 (0)
  • socketModule.js: parsed 26476 → 26483 (+7), gzip 7887 → 7894 (+7)
  • createNewModule.js: parsed 12480 → 12480 (0), gzip 4786 → 4786 (0)
  • summaryModule.js: parsed 3797 → 3797 (0), gzip 1860 → 1860 (0)
  • connectionState.js: parsed 724 → 724 (0), gzip 429 → 429 (0)
  • sharedTreeAttributes.js: parsed 666 → 673 (+7), gzip 432 → 442 (+10)
  • debugAssert.js: parsed 429 → 429 (0), gzip 299 → 299 (0)
  • FluidFramework-HashFallback.js: parsed 422 → 422 (0), gzip 316 → 316 (0)

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.

3 participants