Skip to content

Include failing NuGet source in workload advertising manifest update errors - #55081

Merged
marcpopMSFT merged 4 commits into
mainfrom
copilot/provide-feed-details-unauthorized-error
Jul 29, 2026
Merged

Include failing NuGet source in workload advertising manifest update errors#55081
marcpopMSFT merged 4 commits into
mainfrom
copilot/provide-feed-details-unauthorized-error

Conversation

Copilot AI commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Workload advertising manifest updates on secured/inaccessible feeds surfaced repeated 401 Unauthorized failures without identifying which feed failed, making diagnosis difficult. This change propagates source context into the surfaced error so users can immediately identify the problematic feed.

  • Error propagation: include source on protocol failures

    • Updated NuGetPackageDownloader.GetPackageMetadataAsync(...) to wrap non-ignored FatalProtocolException with NuGetPackageInstallerException that includes the failing source URL and original protocol message.
    • This improves workload advertising-manifest failure output because WorkloadManifestUpdater already reports the thrown exception message.
  • Targeted coverage for source-aware failures

    • Added GivenAFailedSourceItShouldIncludeSourceInError in NuGetPackageInstallerTests.
    • Validates the wrapped exception message includes source context, preserves FatalProtocolException as InnerException, and carries through the inner message.
catch (FatalProtocolException e)
{
    throw new NuGetPackageInstallerException(
        $"{string.Format(CliStrings.FailedToLoadNuGetSource, source.Source)}: {e.Message}", e);
}

Copilot AI and others added 2 commits June 30, 2026 20:53
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Copilot AI changed the title [WIP] Add feed details to unauthorized error messages Include failing NuGet source in workload advertising manifest update errors Jun 30, 2026
Copilot AI requested a review from marcpopMSFT June 30, 2026 20:57
@marcpopMSFT
marcpopMSFT marked this pull request as ready for review July 28, 2026 20:51
@marcpopMSFT
marcpopMSFT requested a review from a team as a code owner July 28, 2026 20:51
@marcpopMSFT
marcpopMSFT requested review from baronfel and Copilot July 28, 2026 20:51
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@marcpopMSFT

Copy link
Copy Markdown
Member

I was unable to test this to recreate the exact situation, but the change looks good to me.

Copilot AI left a comment

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.

Pull request overview

Improves diagnosability of workload advertising-manifest update failures by surfacing the specific failing NuGet source when protocol-level errors occur during package metadata queries.

Changes:

  • Wrapes non-ignored FatalProtocolException in GetPackageMetadataAsync(...) with a NuGetPackageInstallerException that includes the failing source URL in the message.
  • Adds a unit test asserting the wrapped exception message includes the source and preserves the FatalProtocolException as InnerException.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Cli/dotnet/NugetPackageDownloader/NuGetPackageDownloader.cs Wraps FatalProtocolException to include source context in surfaced errors.
test/Microsoft.DotNet.PackageInstall.Tests/NuGetPackageInstallerTests.cs Adds test validating source-aware error messaging for failed protocol sources.

Comment on lines +929 to +932
catch (FatalProtocolException e)
{
throw new NuGetPackageInstallerException($"{string.Format(CliStrings.FailedToLoadNuGetSource, source.Source)}: {e.Message}", e);
}
Comment thread test/Microsoft.DotNet.PackageInstall.Tests/NuGetPackageInstallerTests.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@marcpopMSFT
marcpopMSFT requested a review from baronfel July 29, 2026 00:08
@marcpopMSFT
marcpopMSFT enabled auto-merge (squash) July 29, 2026 00:08
@marcpopMSFT
marcpopMSFT merged commit d2afe1e into main Jul 29, 2026
21 checks passed
@marcpopMSFT
marcpopMSFT deleted the copilot/provide-feed-details-unauthorized-error branch July 29, 2026 02:26
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Jul 31, 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.

Provide feed details when erroring on unauthorized feed

4 participants