Skip to content

Improve NuGet Push Step to Prevent 403 Quota Limit Failures#25246

Merged
ebicoglu merged 4 commits intorel-10.2from
skoc/nuget-push
Apr 13, 2026
Merged

Improve NuGet Push Step to Prevent 403 Quota Limit Failures#25246
ebicoglu merged 4 commits intorel-10.2from
skoc/nuget-push

Conversation

@skoc10
Copy link
Copy Markdown
Contributor

@skoc10 skoc10 commented Apr 13, 2026

skoc10 added 4 commits April 13, 2026 10:35
…h retry logic. Added configurable retry count and delays for improved resilience during package pushes.
…sponses. Changed warning message to reflect the new error condition and ensure clarity during retries.
…ations for failed package pushes. Added error tracking for failed packages and improved error handling during push attempts.
…ipts. Simplified error handling by exiting with a status code on failures without sending notifications.
@skoc10 skoc10 requested review from Copilot and ebicoglu April 13, 2026 11:38
@skoc10 skoc10 added the devops label Apr 13, 2026
@skoc10 skoc10 added this to the 10.2-patch milestone Apr 13, 2026
@skoc10 skoc10 changed the title Skoc/nuget push Improve NuGet Push Step to Prevent 403 Quota Limit Failures Apr 13, 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

Updates the NuGet package push PowerShell scripts to push packages one-by-one with retry logic and clearer failure handling, aiming to make nightly/MyGet and NuGet.org publishing more resilient.

Changes:

  • Push .nupkg files individually (sorted) instead of using a single wildcard push.
  • Add retry-with-backoff behavior around dotnet nuget push failures.
  • Track failed pushes and return a non-zero exit code when any push fails.

Reviewed changes

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

File Description
nupkg/push-nightly-packages-myget.ps1 Adds per-package push loop with retry/backoff and fails the script if any package cannot be pushed.
nupkg/push_packages.ps1 Adds retry/backoff around NuGet.org push attempts and exits with failure when errors occur.

Comment on lines +41 to +49
$clientError = ($pushOutput | Out-String) -match "Response status code does not indicate success:\s*4\d\d"
$canRetry = $clientError -and $attempt -le $maxRetryCount
if (-not $canRetry)
{
break
}

$retryDelay = $retryDelaysInSeconds[$attempt - 1]
Write-Warning "NuGet push returned a 4xx response for $packageName. Retrying in $retryDelay seconds (retry $attempt/$maxRetryCount)..."
if ($failedPackages.Count -gt 0)
{
$errorCount = $failedPackages.Count
Write-Host ("******* $errorCount error(s) occured *******") -ForegroundColor red
Comment thread nupkg/push_packages.ps1
Comment on lines 10 to 13
$i = 0
$errorCount = 0
$failedPackages = @()
$totalProjectsCount = $projects.length
Comment thread nupkg/push_packages.ps1
Comment on lines +44 to +50
$clientError = ($pushOutput | Out-String) -match "Response status code does not indicate success:\s*4\d\d"
$canRetry = $clientError -and $attempt -le $maxQuotaRetryCount

if (-not $canRetry)
{
break
}
Comment thread nupkg/push_packages.ps1
@@ -41,4 +76,5 @@ foreach($project in $projects) {
if ($errorCount > 0)
{
Write-Host ("******* $errorCount error(s) occured *******") -ForegroundColor red
@ebicoglu ebicoglu merged commit 2eaae1b into rel-10.2 Apr 13, 2026
6 checks passed
@ebicoglu ebicoglu deleted the skoc/nuget-push branch April 13, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants