Skip to content

Move NuGet.org publish to separate release pipeline#14

Closed
jfversluis wants to merge 7 commits into
mainfrom
fix/separate-nuget-publish-pipeline
Closed

Move NuGet.org publish to separate release pipeline#14
jfversluis wants to merge 7 commits into
mainfrom
fix/separate-nuget-publish-pipeline

Conversation

@jfversluis
Copy link
Copy Markdown
Member

Problem

The publish_nuget stage in devflow-official.yml fails because MicroBuild signing (enableMicrobuild: true) enables CFS network isolation at the pipeline level, which sinkhole-blocks api.nuget.org to 192.0.2.2 (TEST-NET). This happens regardless of networkIsolationPolicy — every inline approach has failed:

  • Permissive alone (3f0661a) ❌
  • Permissive, CFSClean2 (e3e3905) ❌
  • Permissive, CFSClean, CFSClean2 (336076a) ❌

Root Cause

The CFS enforcement is scoped to the entire pipeline definition, not individual stages. Since the build stage uses MicroBuild for code signing, all stages in that pipeline — including the NuGet publish stage — are subject to CFS network restrictions.

Fix

Move NuGet.org publishing to a separate pipeline (release-publish-nuget.yml) that does not use MicroBuild signing. This is the same pattern used by:

  • dotnet/aspire: release-publish-nuget.yml (separate from azure-pipelines.yml)
  • dotnet/maui: ci-official-release.yml (separate from ci-official.yml)

This was actually attempted before in 4dcf64c but reverted 4 minutes later (cb4990e) — likely before the new pipeline definition could be registered in Azure DevOps.

Changes

eng/pipelines/release-publish-nuget.yml (new):

  • networkIsolationPolicy: Permissive (works because no MicroBuild in this pipeline)
  • SBOM generation via PrepareArtifacts → releaseJob pattern (from aspire)
  • Package signature verification before publish
  • Dry run and skip flags for safe re-runs after partial failures
  • Pipeline resource pointing to dotnet-maui-labs-official

eng/pipelines/devflow-official.yml (cleaned up):

  • Removed inline publish_nuget stage
  • Removed networkIsolationPolicy workaround settings
  • Removed publishPackagesNuget parameter
  • Now focused on build, sign, and validate only

Prerequisites (manual steps after merge)

  1. Register release-publish-nuget.yml as a new pipeline in Azure DevOps (dnceng/internal)
  2. Authorize the nuget.org (dotnetframework) service connection for the new pipeline

cc @ruimarinho — you authored several of the earlier attempts at this, wanted to get your eyes on this approach.

MicroBuild signing (enableMicrobuild: true) in devflow-official.yml enables
CFS network isolation at the pipeline level. This sinkhole-blocks
api.nuget.org to 192.0.2.2 (TEST-NET), regardless of the
networkIsolationPolicy setting. Every attempt to publish inline has failed:
- Permissive alone (3f0661a)
- Permissive, CFSClean2 (e3e3905)
- Permissive, CFSClean, CFSClean2 (336076a)

The fix is to use a separate pipeline without MicroBuild, matching the
pattern used by dotnet/aspire (release-publish-nuget.yml) and dotnet/maui
(ci-official-release.yml). This was attempted before in 4dcf64c but
reverted 4 minutes later (cb4990e) — likely before the new pipeline
definition could be registered in Azure DevOps.

Changes:
- New eng/pipelines/release-publish-nuget.yml with:
  - networkIsolationPolicy: Permissive (works without MicroBuild CFS)
  - SBOM generation via PrepareArtifacts/releaseJob pattern
  - Package signature verification before publish
  - Dry run and skip flags for safe operation
- Cleaned devflow-official.yml: removed inline publish_nuget stage and
  CFS workaround settings

Prerequisite: register release-publish-nuget.yml as a new pipeline
definition in Azure DevOps (dnceng/internal) and authorize the
'nuget.org (dotnetframework)' service connection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 22, 2026 19:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Moves NuGet.org package publishing out of the main official DevFlow pipeline into a dedicated release pipeline to avoid CFS network isolation triggered by MicroBuild signing.

Changes:

  • Added a new manual release-publish-nuget.yml pipeline that downloads PackageArtifacts, regenerates SBOM via 1ES outputs, verifies package signatures, and publishes to NuGet.org (with dry-run / skip flags).
  • Removed the inline NuGet publish stage, related parameters, and network isolation workarounds from devflow-official.yml.

Reviewed changes

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

File Description
eng/pipelines/release-publish-nuget.yml New standalone release pipeline that prepares artifacts (SBOM) and publishes signed packages to NuGet.org.
eng/pipelines/devflow-official.yml Removes embedded NuGet publishing so the official build pipeline focuses on build/sign/validate only.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread eng/pipelines/release-publish-nuget.yml
Comment thread eng/pipelines/release-publish-nuget.yml Outdated
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

@jfversluis I've opened a new pull request, #15, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits March 23, 2026 10:02
[WIP] [WIP] Address feedback on NuGet.org publish release pipeline changes
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

@jfversluis I've opened a new pull request, #16, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits March 23, 2026 10:06
Add `checkout: none` to PublishNuGet job in release pipeline
@jfversluis
Copy link
Copy Markdown
Member Author

Not needed anymore, it works for now.

@jfversluis jfversluis closed this Mar 23, 2026
mattleibow added a commit that referenced this pull request May 12, 2026
Critical/High fixes:
- #1: Use namespace+class for unique hint names (prevents AddSource crash
  when two pages share the same simple class name)
- #2: CrossFileResolver uses FQN lookup + ambiguity detection for
  duplicate simple names across namespaces
- #3: CollectionView conditional rendering fixed — no more [[double brackets]],
  uses unified annotation list builder
- #4: Root ContentPage walks children directly, preventing SemanticProperties
  on root from swallowing the entire page
- #5: Visibility conditions on layout containers now propagate as
  condition group wrappers ('When [visible when X = true]:')
- #6: Property-element content (ContentPage.Content, ScrollView.Content)
  no longer dropped — unknown property elements are transparent by default,
  only known non-visual ones (Resources, Triggers, etc.) are suppressed
- #7: Shell routes stored in UiElement for Shell page markdown

Medium fixes:
- #8: Promoted containers (Border with Description) now walk children too,
  preserving actionable descendants like buttons
- #9: Unresolved user controls kept as placeholders (previously dropped),
  important for third-party controls with SemanticProperties
- #10: DataTrigger with IsVisible=False setter now correctly inverted
  to 'hidden when Property = Value' instead of 'visible when'
- #11: IsVisible=False elements skipped entirely — not reachable by screen
  readers, should not appear in accessibility-first index
- #12: Aggregate namespace validated as legal C# before emitting
- #13: Always use global:: for page references in aggregate, even for
  no-namespace pages
- #14: BindingRegex now requires whitespace after 'Binding' keyword,
  preventing false matches like {BindingSource}
- #15: CrossFileResolver uses in-progress set for cycle detection,
  preventing partial cache on indirect A→B→A cycles

Low fixes:
- #16: Dead emptyViewChildren code block removed
- #17: Removed unused TemplateVariants from dead CollectionView code

104 exact-match tests, all passing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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