Skip to content

NuGet: Add circular dependency detection to MSBuildHelper.ThrowOnError#15116

Merged
brettfo merged 1 commit into
mainfrom
dev/brettfo/nuget-circular-dep-error
May 22, 2026
Merged

NuGet: Add circular dependency detection to MSBuildHelper.ThrowOnError#15116
brettfo merged 1 commit into
mainfrom
dev/brettfo/nuget-circular-dep-error

Conversation

@brettfo
Copy link
Copy Markdown
Contributor

@brettfo brettfo commented May 22, 2026

Add a new ThrowOnCircularDependency helper that matches the pattern 'Circular dependency detected ...' in MSBuild output and throws a plain Exception with the message 'Circular dependency detected' to enable proper grouping in telemetry.

Changes

  • Added ThrowOnCircularDependency private method in MSBuildHelper.cs
  • Wired it into the ThrowOnError dispatch method
  • Added test case in MSBuildHelperTests.cs verifying the pattern match

Copilot AI review requested due to automatic review settings May 22, 2026 16:18
@brettfo brettfo requested a review from a team as a code owner May 22, 2026 16:18
@github-actions github-actions Bot added the L: dotnet:nuget NuGet packages via nuget or dotnet label May 22, 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 NuGet/MSBuild output parsing for circular dependency failures so they surface as a stable, standardized exception message (improving telemetry grouping), with a corresponding test case.

Changes:

  • Add ThrowOnCircularDependency to detect MSBuild output matching Circular dependency detected '...' and throw Exception("Circular dependency detected").
  • Wire the new detection into MSBuildHelper.ThrowOnError.
  • Add a test case validating the new pattern-to-error mapping.
Show a summary per file
File Description
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs Detect circular dependency output and throw a standardized exception via ThrowOnError.
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs Adds coverage ensuring circular dependency output becomes an unknown_error with the standardized message.

Copilot's findings

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

Add a new ThrowOnCircularDependency helper that matches the pattern
'Circular dependency detected ''..''' in MSBuild output and throws a
plain Exception with the message 'Circular dependency detected' to
enable proper grouping in telemetry.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@brettfo brettfo force-pushed the dev/brettfo/nuget-circular-dep-error branch from 13e33af to 8edf1af Compare May 22, 2026 20:46
@brettfo brettfo merged commit b183c09 into main May 22, 2026
139 of 140 checks passed
@brettfo brettfo deleted the dev/brettfo/nuget-circular-dep-error branch May 22, 2026 21:24
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