Skip to content

Improve Azure Artifacts upload failure diagnostics - #17281

Merged
missymessa merged 2 commits into
dotnet:mainfrom
missymessa:missymessa/azure-artifacts-upload-logging
Aug 7, 2026
Merged

missymessa merged 2 commits into
dotnet:mainfrom
missymessa:missymessa/azure-artifacts-upload-logging

Conversation

@missymessa

Copy link
Copy Markdown
Member

Summary

  • log Azure Artifacts HTTP status, reason, and a bounded response body when NuGet uploads fail
  • log request exception type and message instead of returning only Final status: Unknown
  • preserve existing retry and build-result behavior

Validation

  • PublishArtifactsInManifestTests: 24 passed

The missing diagnostics were observed in dotnet-emsdk promotion builds 3041269 and 3041611.

AB#12151

Log bounded Azure Artifacts error responses and request exceptions without changing package publishing retry behavior.

AB#12151

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 60d81f8f-2eb1-4aab-969d-33a8e65fc8e8
Copilot AI review requested due to automatic review settings August 7, 2026 14:13
@missymessa
missymessa enabled auto-merge (squash) August 7, 2026 14:14

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

This PR improves diagnostics when uploading NuGet packages to Azure Artifacts fails, aiming to make failures actionable by logging HTTP status/reason and exception details while preserving existing retry/build-result behavior.

Changes:

  • Added an overload of NuGetFeedUploadPackageAsync that accepts an MSBuild TaskLoggingHelper to emit failure diagnostics.
  • On non-success HTTP responses, logs HTTP status code, reason phrase, and response body (intended to be truncated).
  • Added unit tests asserting that failed responses and request exceptions produce build messages without errors/warnings.

Reviewed changes

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

File Description
src/Microsoft.DotNet.Build.Tasks.Feed/src/PublishArtifactsInManifestBase.cs Adds logging for upload failures (HTTP + exceptions) and wires task logging into the upload callback.
src/Microsoft.DotNet.Build.Tasks.Feed.Tests/PublishArtifactsInManifestTests.cs Adds unit tests validating new failure/exception logging behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Read at most 4 KB plus one character from failed upload responses so diagnostics remain memory-bounded.

AB#12151

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 60d81f8f-2eb1-4aab-969d-33a8e65fc8e8
Copilot AI review requested due to automatic review settings August 7, 2026 14:18

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

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

@missymessa
missymessa merged commit 3affc7a into dotnet:main Aug 7, 2026
9 of 12 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 10, 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.

3 participants