Skip to content

Build and publish NuGet.Client.EndToEnd.TestData if needed#7459

Open
martinrrm wants to merge 1 commit into
devfrom
dev-mruizmares-fixApexTests
Open

Build and publish NuGet.Client.EndToEnd.TestData if needed#7459
martinrrm wants to merge 1 commit into
devfrom
dev-mruizmares-fixApexTests

Conversation

@martinrrm

@martinrrm martinrrm commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Bug

Fixes:
Pipelines PR https://devdiv.visualstudio.com/DevDiv/_git/NuGet.Client-Pipelines/pullrequest/746014

Description

Adds the ability to publish a new version of the NuGet.Client.EndToEnd.TestData package, which is required to unblock the Apex integration tests.

Because the package needs to be published in an AzDO dnceng feed, we need to do a CI to publish a new package version. This is the NuGet.Client half of a two-repo change, the companion PR in NuGet.Client-Pipelines performs the actual push to the dnceng nuget-build feed, this is because NuGet.Client-Pipelines already has a connection to NuGet Development - DevDiv azure subscription and makes more sense since we also have package publish steps there.

What this PR does

  • Bumps NuGet.Client.EndToEnd.TestData to 1.0.3 (.nuspec + the Directory.Packages.props pin).
  • Adds an opt-in, queue-time PublishEndToEndTestData parameter (default false), threaded official.yml → pipeline.yml → Build.yml. It only runs in non-RTM, official builds.
  • When enabled, the official build compiles GenerateTestPackages, runs CreateTestDataPackage.ps1, and generates the package into an isolated staging directory ($(Build.StagingDirectory)\e2etestdata), then verifies exactly one package was produced and publishes it (with an SBOM) as the EndToEndTestData pipeline artifact.
  • The NuGet.Client-Release pipeline downloads that artifact and pushes it to the public dnceng nuget-build feed (companion PR).
  • Adds missing .dgml file to fix E2E test InstallPackagesConfigLocal

Why the package is isolated from artifacts/
The package bundles 700+ nested mock .nupkg fixtures as content. Generating it outside the repo artifacts tree keeps it out of: MicroBuild signing (SignTool recurses into and would corrupt the nested fixtures), BAR/Maestro publishing, and the product SBOM scan.

How to publish a new version (rare):

  1. Queue NuGetClient-Official with PublishEndToEndTestData = true → produces the artifact.
  2. Run NuGet.Client-Release with its PublishEndToEndTestData = true and run only the
    Publish EndToEnd TestData stage.

**Possible Permissions needed: ** the nuget-build-dnceng-public service connection must be authorized for the NuGet.Client-Release pipeline.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • [ ] Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@martinrrm martinrrm requested a review from a team as a code owner June 6, 2026 00:01
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Since this PR is changing CI as it modifies YML files, please verify that you've addressed how this change should apply to release branches. Either:

  • Link to equivalent PRs or Issues for each currently supported branch.
    or
  • Explain in the PR description why this change doesn't apply to release branches.

Adds an opt-in, queue-time `PublishEndToEndTestData` parameter to the official
pipeline that builds the NuGet.Client.EndToEnd.TestData package and publishes it
(with an SBOM) as the `EndToEndTestData` pipeline artifact. The companion
NuGet.Client-Pipelines change downloads that artifact and pushes it to the public
dnceng nuget-build feed.

- Bump NuGet.Client.EndToEnd.TestData to 1.0.3 (nuspec + Directory.Packages.props pin).
- Thread `PublishEndToEndTestData` through official.yml -> pipeline.yml -> Build.yml
  (default false; non-RTM, official builds only).
- Generate the package into an isolated staging directory ($(Build.StagingDirectory)\e2etestdata),
  deliberately outside the repo 'artifacts' tree so it bypasses MicroBuild signing
  (SignTool would recurse into and corrupt the bundled mock-package fixtures),
  BAR/Maestro publishing, and the product SBOM scan; verify exactly one package is
  produced, then publish it as the `EndToEndTestData` artifact.
- Track the previously git-ignored InstallPackagesConfigLocal/InstallPackagesConfigLocalGraph.dgml
  test descriptor (force-added past the `packages/` .gitignore rule). It is an input used by
  InstallPackageTest.ps1, so without it the CI-generated package would be missing those fixtures.
- Update CreateTestDataPackage.ps1 to locate GenerateTestPackages.exe under both
  local and CI output layouts and to fail with a clearer error when it is missing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@martinrrm martinrrm force-pushed the dev-mruizmares-fixApexTests branch from 4e16ac6 to c5e4048 Compare June 6, 2026 00:08
Comment on lines +138 to +142
# The EndToEnd test data package bundles nested .nupkg fixtures as content. It is generated into a
# staging directory that is deliberately OUTSIDE the repo 'artifacts' tree so it is never signed
# (SignTool would recurse into and corrupt the nested fixtures), never picked up by BAR publishing,
# and never scanned by the product SBOM. It is published unsigned to the dnceng nuget-build feed
# via the '- output: nuget' block in pipeline.yml.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So, the current design is manually queue an official build, setting the PublishEndToEndTestData parameter to true, then wait for the official build to complete, then run the release pipeline.

It seems to me we could have a single pipeline that both builds and publishes the package, so we don't need to queue two pipelines to perform one outcome.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that would be the easiest way to develop and publish the package. But TBH I don't see us publishing a new package in years, last version is from 2024 and we weren't using it. 1.0.0 is from 2020.

I just don't want to create a new pipeline for something that we might never use, I was thinking maybe Official can do the publishing too, but Official feels more like a build only pipeline.

We were doing something similar when we wanted to publish CommandLine packages, so I was following that.

I think we should choose the way that is easier for the team to maintain and do compliance on the pipeline, either a new one, keep it as two, or maybe even do everything as a new step in release pipeline, maybe we can just build this project and publish.

<metadata>
<id>NuGet.Client.EndToEnd.TestData</id>
<version>1.0.0</version>
<version>1.0.3</version>

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'm trying to understand the publish/consume ordering and could use some help. This PR bumps the central NuGet.Client.EndToEnd.TestData pin to 1.0.3, but as I understand it 1.0.3 only lands in the dnceng nuget-build feed after someone manually queues an official build with PublishEndToEndTestData=true and then runs the companion release pipeline. Meanwhile CreateEndToEndTestPackage.proj consumes this package via (central package management) and restores it from nuget-build. So, my question is: how do we avoid a window where this is merged but 1.0.3 isn't on the feed yet. Wouldn't restore of that project fail with NU1102 until the publish happens? Is 1.0.3 already published, or does the pin bump need to wait for that? (I noticed the PR is currently mergeable_state: blocked, is that related?)

- ${{ if eq(parameters.PublishEndToEndTestData, true) }}:
- output: pipelineArtifact
displayName: 'Publish EndToEnd TestData package'
condition: "and(succeeded(), eq(variables['BuildRTM'], 'false'), eq(variables['IsOfficialBuild'], 'true'))"

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.

The runtime condition on the pipelineArtifact output duplicates the BuildRTM/IsOfficialBuild logic that also lives in Build.yml. If these conditions drift, the package could be generated but not published (or vice versa). Consider centralizing the "should we publish E2E test data" predicate so the generate step and the artifact output can't get out of sync.

@dotnet-policy-service dotnet-policy-service Bot added the Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed label Jun 17, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 7 days of this comment. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch.

@martinrrm martinrrm removed the Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed label Jun 18, 2026
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