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
Copy link
Copy Markdown
Contributor

@martinrrm martinrrm commented Jun 6, 2026

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.

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.

2 participants