Skip to content

Retry newly created feed publishing - #17289

Merged
mmitche merged 2 commits into
dotnet:mainfrom
mmitche:dev/mmitche/feed-readiness-retry
Aug 8, 2026
Merged

mmitche merged 2 commits into
dotnet:mainfrom
mmitche:dev/mmitche/feed-readiness-retry

Conversation

@mmitche

@mmitche mmitche commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary

  • wait for newly created Azure DevOps feeds to become readable by the publishing identity
  • use the existing exponential retry handler for NuGet package uploads
  • cover feed readiness and failed upload retries with unit tests

Validation

  • Build.cmd -projects .\src\Microsoft.DotNet.Build.Tasks.Feed.Tests\Microsoft.DotNet.Build.Tasks.Feed.Tests.csproj -test -configuration Debug

Wait for newly created Azure DevOps feeds to become readable before publishing and use exponential backoff for NuGet package uploads.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: ace92a75-6eaa-4e5c-956c-464de70257e1
Copilot AI lite review requested due to automatic review settings August 8, 2026 00:04
vseanreesermsft
vseanreesermsft previously approved these changes Aug 8, 2026

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 resilience of Azure DevOps feed publishing in Arcade by (1) waiting for newly created feeds to become readable by the publishing identity and (2) standardizing NuGet package upload retries on the shared exponential retry mechanism, with new unit test coverage.

Changes:

  • Switch NuGet package upload retry logic in PushNugetPackageAsync to use the existing ExponentialRetry handler.
  • Add a feed-readiness polling step after Azure DevOps feed creation, honoring Retry-After when present.
  • Add/extend unit tests covering feed readiness retries and upload retry behavior.

Reviewed changes

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

File Description
src/Microsoft.DotNet.Build.Tasks.Feed/src/PublishArtifactsInManifestBase.cs Replaces manual retry loop for NuGet uploads with the shared exponential retry handler.
src/Microsoft.DotNet.Build.Tasks.Feed/src/CreateAzureDevOpsFeed.cs Adds a retry-based “feed readiness” check after feed creation to avoid transient permission/readability issues.
src/Microsoft.DotNet.Build.Tasks.Feed.Tests/PublishArtifactsInManifestTests.cs Updates existing tests to inject ExponentialRetry and adds a new test for failed-upload retry behavior.
src/Microsoft.DotNet.Build.Tasks.Feed.Tests/CreateAzureDevOpsFeedTests.cs Adds tests validating feed readiness retry success and failure scenarios.
Suppressed comments (1)

src/Microsoft.DotNet.Build.Tasks.Feed.Tests/PublishArtifactsInManifestTests.cs:482

  • This test currently only asserts the number of delays, but not that the delays increase (or match expected values), so it doesn't actually validate the exponential backoff behavior. Add an assertion that the second delay is greater than the first (and/or assert the exact expected delays if using a deterministic retry configuration).
            attempts.Should().Be(3);
            retryDelays.Should().HaveCount(2);
            buildEngine.BuildErrorEvents.Should().BeEmpty();
        }

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 1638 to 1643
Log.LogMessage(MessageImportance.Normal, $"Pushing package {id}@{version} to target feed {feedConfig.TargetURL}");
int attemptIndex = 0;
RetryHandler.MaxAttempts = MaxRetryCount;
int attemptsMade = 0;

do
await RetryHandler.RunAsync(async attempt =>
{

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 65cab2c by using a local ExponentialRetry instance for package pushes instead of mutating the task-wide RetryHandler configuration.

Use a local exponential retry handler for package pushes so other publishing operations retain their configured retry behavior.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: ace92a75-6eaa-4e5c-956c-464de70257e1
Copilot AI review requested due to automatic review settings August 8, 2026 00:13
@mmitche
mmitche enabled auto-merge (squash) August 8, 2026 00:17

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 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/Microsoft.DotNet.Build.Tasks.Feed/src/PublishArtifactsInManifestBase.cs:1649

  • packagePushRetryHandler.MaxAttempts is set directly from MaxRetryCount. In the previous do/while implementation, MaxRetryCount = 0 still performed a single push attempt (because the counter was incremented before checking the loop condition). With ExponentialRetry, MaxAttempts = 0 results in zero attempts, leaving packageStatus as Unknown and logging a failure after 0 attempts. Consider clamping to at least 1 attempt to preserve prior behavior and avoid surprising misconfiguration.
                var packagePushRetryHandler = new ExponentialRetry
                {
                    MaxAttempts = MaxRetryCount,
                    DelayBase = RetryHandler.DelayBase,
                    DelayConstant = RetryHandler.DelayConstant,

@missymessa missymessa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM shipit

@mmitche
mmitche merged commit 2129602 into dotnet:main Aug 8, 2026
10 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.

4 participants