Repository navigation
Make NuGet Apex tests self-suppress the Preview Changes dialog - #7500
Merged
Merged
Conversation
Nigusu-Allehu
marked this pull request as ready for review
June 23, 2026 16:57
nkolev92
reviewed
Jun 23, 2026
Nigusu-Allehu
marked this pull request as draft
June 23, 2026 17:10
Nigusu-Allehu
marked this pull request as ready for review
June 23, 2026 17:53
nkolev92
reviewed
Jun 23, 2026
nkolev92
previously approved these changes
Jun 23, 2026
nkolev92
left a comment
Member
There was a problem hiding this comment.
I'll let you make a choice for the unsetting logic, if any.
Nigusu-Allehu
force-pushed
the
dev-nyenework-Apex-init
branch
from
June 24, 2026 00:17
eceb14a to
3f89fe0
Compare
Nigusu-Allehu
enabled auto-merge (squash)
June 24, 2026 00:23
zivkan
approved these changes
Jun 24, 2026
| private const string DoNotShowPreviewWindowRegistryName = "DoNotShowPreviewWindow"; | ||
| private const string SuppressUILegalDisclaimerRegistryName = "SuppressUILegalDisclaimer"; | ||
|
|
||
| private readonly List<RegistryValueSnapshot> _originalValues = new(); |
Member
There was a problem hiding this comment.
We only have two values, so I feel like keeping a list and defining a custom data type is overkill. I think two string? fields would be sufficient.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Fixes: https://github.com/NuGet/Client.Engineering/issues/3784
Description
The
NuGet.Tests.ApexStagingGate were failing in the staging pipeline but succeed in nuget test pipeline. And it looks like the NuGet test pipeline has a predeployment operationSetupFunctionalTests.ps1.The setup suppresses two
HKCU:\Software\NuGetregistry values (DoNotShowPreviewWindow,SuppressUILegalDisclaimer).Adds
NuGetUISuppression,IDisposablehelper. On construction it captures the original registry state of each value and then writes the suppression values as. OnDispose()it restores the captured state exactly: deletes values that were absent before, and rewrites pre-existing values with their original data and kind.Tested: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=14455613&view=results
I ran a test on this in staging by creating a branch that points to this PRs drop path. I hard coded it in the branch and ran the tests.
The tests are failing with
I think that is probably because the
NuGet.PackageManagementbit in the test VS is different from theNuget.PackageManagementin the test dll I attached by hard coding the VS drop url. That means we probably have to wait until this is inserted to see the results in the staging pipeline.My local tests show with this change one can run these tests without having to run the setup PS1 file.
PR Checklist