Skip to content

Route CI package restores through the CFS feed - #16348

Closed
Vineeth (vineethkuttan) wants to merge 1 commit into
mainfrom
updatePipelines
Closed

Route CI package restores through the CFS feed#16348
Vineeth (vineethkuttan) wants to merge 1 commit into
mainfrom
updatePipelines

Conversation

@vineethkuttan

@vineethkuttan Vineeth (vineethkuttan) commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Why

MountainPass SR21 (SFI Network Isolation) requires pipelines to restore packages through
the Central Feed Service instead of public registries. This pipeline currently pulls from
registry.npmjs.org, which blocks it from running network-isolated.

What

New .ado/templates/configure-npm-feed.yml writes an .npmrc pointing at the
ms/react-native-public feed and runs npmAuthenticate@0, exposing npmFeedRegistry and
a secret npmFeedAuthToken. It runs before any package is fetched in:

  • templates/yarn-install.yml, templates/strict-yarn-install.yml
  • build-template.yml (inlined copy in Setup)
  • prepare-release-bot.yml

Yarn gets YARN_NPM_REGISTRY_SERVER / _ALWAYS_AUTH / _AUTH_TOKEN per step. Verdaccio's
uplink now points at the feed, and verdaccio-stop.yml restores the feed registry instead
of npm config delete registry, which was silently reverting to npmjs.org.

windows-vs-pr.yml and publish.yml need no changes — they extend build-template.yml.

Notes

  • Config is applied at build time, not committed: fork PRs in GitHub Actions have no ADO
    credentials, so a checked-in .npmrc would break external contributors.
  • No networkIsolationPolicy here. Per the SR21 TSG, YAML policies replace auto-applied
    ones; onboarding happens via the automatic 7-day lock-in or the AzRF.Onboard tag.
  • No yarn.lock changes needed (Yarn 4 resolutions carry no absolute URLs).

Prerequisite

An npm-type service connection ms/react-native-public npm Feed must exist and be
authorized. The existing ms/react-native-public ADO Feed is NuGet-type and won't work.

Microsoft Reviewers: Open in CodeFlow

@vineethkuttan

Copy link
Copy Markdown
Contributor Author

/azp run PR

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
No pipelines were found matching this branch/path.

@vineethkuttan

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
No pipelines were found matching this branch/path.

@vineethkuttan
Vineeth (vineethkuttan) marked this pull request as ready for review August 4, 2026 04:57
@vineethkuttan
Vineeth (vineethkuttan) requested review from a team as code owners August 4, 2026 04:57
Copilot AI balanced review requested due to automatic review settings August 4, 2026 04:57
@vineethkuttan

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
No pipelines were found matching this branch/path.

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

Routes Azure Pipelines npm restores through the authenticated CFS-backed Azure Artifacts feed.

Changes:

  • Adds reusable feed configuration and authentication.
  • Routes Yarn and Verdaccio restores through CFS.
  • Restores feed configuration after Verdaccio tests.

Reviewed changes

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

Show a summary per file
File Description
.ado/verdaccio/config.yaml Redirects Verdaccio’s uplink to CFS.
.ado/templates/yarn-install.yml Authenticates Yarn installs.
.ado/templates/verdaccio-stop.yml Restores the CFS registry.
.ado/templates/verdaccio-start.yml Supplies Verdaccio credentials.
.ado/templates/strict-yarn-install.yml Authenticates strict installs.
.ado/templates/configure-npm-feed.yml Configures and authenticates npm.
.ado/prepare-release-bot.yml Routes release-bot restores through CFS.
.ado/build-template.yml Configures CFS during pipeline setup.

$authToken = [regex]::Match($npmrc, '(?m)^\s*//\S+:_authToken\s*=\s*(\S+)\s*$')

if ($password.Success) {
$token = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($password.Groups[1].Value))
# Written to the user-level .npmrc rather than the repo so the working tree stays
# clean and every npm/npx invocation is covered regardless of its cwd.
- pwsh: |
$npmrc = Join-Path $env:USERPROFILE '.npmrc'
@iamAbhi-916

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
No pipelines were found matching this branch/path.

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