Skip to content

Add HasNoWarnNU1701 merge logic in project discovery#15090

Merged
brettfo merged 1 commit into
mainfrom
brettfo/merge-nowarn-nu1701
May 21, 2026
Merged

Add HasNoWarnNU1701 merge logic in project discovery#15090
brettfo merged 1 commit into
mainfrom
brettfo/merge-nowarn-nu1701

Conversation

@brettfo
Copy link
Copy Markdown
Contributor

@brettfo brettfo commented May 20, 2026

Merge the HasNoWarnNU1701 property using a simple OR when combining ProjectDiscoveryResult instances in DiscoveryWorker.MergeProjectDiscovery. Updated the existing merge test to verify the behavior (one result has false, the other has true, merged result is true).

@brettfo brettfo requested a review from a team as a code owner May 20, 2026 21:34
Copilot AI review requested due to automatic review settings May 20, 2026 21:34
@github-actions github-actions Bot added the L: dotnet:nuget NuGet packages via nuget or dotnet label May 20, 2026
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

Adds end-to-end tracking of projects that suppress NuGet warning NU1701 during discovery, ensures this signal is preserved when merging discovery results, and surfaces it via logger warnings. This helps operators understand when compatibility checks may be less reliable due to NU1701 being explicitly suppressed.

Changes:

  • Detect NoWarn containing NU1701 during SDK project discovery and persist it on ProjectDiscoveryResult.
  • Merge HasNoWarnNU1701 across ProjectDiscoveryResult instances using logical OR in DiscoveryWorker.MergeProjectDiscovery.
  • Emit warnings in ILogger.ReportDiscovery for affected projects and add/adjust tests for merge + logging behavior.
Show a summary per file
File Description
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ILogger.cs Logs WARN entries for projects where discovery flagged HasNoWarnNU1701.
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs Computes HasNoWarnNU1701 from evaluated NoWarn MSBuild property.
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/ProjectDiscoveryResult.cs Adds HasNoWarnNU1701 field to the discovery model.
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs Merges HasNoWarnNU1701 via OR when combining project discovery results.
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/LoggerTests.cs Adds a test validating NU1701 warning logging and ordering.
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.cs Updates merge test to verify HasNoWarnNU1701 OR merge behavior.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 2

@brettfo brettfo force-pushed the brettfo/merge-nowarn-nu1701 branch from 01672a8 to 40e7abd Compare May 20, 2026 21:46
Merge the HasNoWarnNU1701 property using a simple OR when combining
ProjectDiscoveryResult instances. Updated the existing merge test to
verify the behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@brettfo brettfo force-pushed the brettfo/merge-nowarn-nu1701 branch from 40e7abd to 84354aa Compare May 21, 2026 21:03
@brettfo brettfo merged commit 0c53e0d into main May 21, 2026
106 checks passed
@brettfo brettfo deleted the brettfo/merge-nowarn-nu1701 branch May 21, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L: dotnet:nuget NuGet packages via nuget or dotnet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants