Skip to content

Use authenticated package feeds in packaging pipelines - #32005

Merged
Tianlei Wu (tianleiwu) merged 4 commits into
mainfrom
jiafa/isolate-dml-package-sources
Aug 13, 2026
Merged

Use authenticated package feeds in packaging pipelines#32005
Tianlei Wu (tianleiwu) merged 4 commits into
mainfrom
jiafa/isolate-dml-package-sources

Conversation

@jiafatom

Copy link
Copy Markdown
Contributor

Description

  • Route npm lockfile downloads and C# package restores through authenticated package feeds.
  • Configure package feeds before restore and build steps.
  • Skip redundant dependency scans in artifact-only packaging jobs.
  • Remove unnecessary package bootstrap steps that can contact public registries.

Motivation and Context

These changes keep packaging workflows compatible with network-isolated build agents and prevent package tools from bypassing the configured authenticated sources.

Validation

  • Parsed the modified Azure Pipelines YAML files.
  • Checked the changes for whitespace errors.

Route package restores through authenticated feeds and remove redundant public package bootstrap steps.

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

Copilot-Session: 4d78d7b1-43f9-4fe3-972f-3a70b59db4f6

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

Updates Azure Pipelines packaging workflows to ensure dependency restores and lockfile-based downloads use authenticated Azure Artifacts feeds, improving compatibility with network-isolated build agents and reducing unwanted access to public registries.

Changes:

  • Add npm configuration to ensure registry host replacement is enforced for lockfile/resolved URL scenarios.
  • Generate a single internal-feed-only NuGet config and apply it to both repo-root NuGet.config and csharp/NuGet.CSharp.config.
  • Simplify/adjust packaging pipelines: remove bootstrap steps (Az module install, NuGetToolInstaller in DML template), move feed setup earlier, and skip component governance detection in artifact-only jobs.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/ci_build/github/azure-pipelines/templates/setup-feeds-and-python-steps.yml Tightens npm behavior and ensures C# restores use the same internal-feed-only NuGet configuration.
tools/ci_build/github/azure-pipelines/templates/publish-symbolrequestprod-api.yml Removes PowerShell module bootstrap step that could hit external sources.
tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml Runs authenticated feed setup earlier in the job so restores/builds are constrained to configured sources.
tools/ci_build/github/azure-pipelines/stages/nuget-win-cuda-packaging-stage.yml Skips component governance detection for packaging job.
tools/ci_build/github/azure-pipelines/nuget/templates/dml-vs-2022.yml Removes NuGetToolInstaller step to avoid unnecessary external contact.
tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml Skips component governance detection for artifact-only download/publish job.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/ci_build/github/azure-pipelines/stages/nuget-win-cuda-packaging-stage.yml Outdated
Use the CUDA_MODULE_LOADING environment variable recognized by CUDA.

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

Copilot-Session: 4d78d7b1-43f9-4fe3-972f-3a70b59db4f6

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

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

Suppressed comments (2)

tools/ci_build/github/azure-pipelines/templates/setup-feeds-and-python-steps.yml:246

  • Same encoding issue as NuGet.config: overwriting csharp/NuGet.CSharp.config without an explicit -Encoding can produce a file whose actual encoding doesn’t match the utf-8 XML declaration, potentially breaking dotnet/msbuild restore that relies on this config.
        Set-Content -Path $csharpNugetConfigPath -Value $nugetConfig

tools/ci_build/github/azure-pipelines/templates/setup-feeds-and-python-steps.yml:241

  • $nugetConfig declares encoding="utf-8", but Set-Content without -Encoding uses Windows PowerShell’s default encoding on Windows agents. That can write a non-UTF-8 NuGet.config, which may cause NuGet/XML parsing failures or inconsistent behavior across agents. Please write the file with an explicit UTF-8 encoding to match the XML declaration.

This issue also appears on line 246 of the same file.

      Set-Content -Path "NuGet.config" -Value $nugetConfig

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

Copilot-Session: 3434ce2e-83c3-4560-a518-f8c54dec8e5f

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

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

Copilot-Session: 3434ce2e-83c3-4560-a518-f8c54dec8e5f
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