Repository navigation
fix(ci): Make nuget.org push re-runs resume - #25666
Conversation
Re-running the nuget.org publish job failed on the first package the previous attempt had pushed: NuGetCommand@2 can't pass -SkipDuplicate, and its allowPackageConflicts doesn't recognize nuget.org's 409. A prepare step now sorts the packages into batches, leaving out the ones already on nuget.org on a re-run (System.JobAttempt > 1). The batches are pushed in order, with Uno.WinUI and then Uno.Sdk.Private last, so a push that stops midway doesn't expose a version whose other packages are missing. Fixes #25665 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Claude finished @agneszitte's task in 25s —— View job Review of #25666Verdict: ship (1 minor finding, posted inline).
What I checked (by inspection only; I did not run the pipeline):
Notes (no action required):
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Claude finished @agneszitte's task in 14s —— View job Re-review of #25666 after the new commitVerdict: ship
I checked this by reading the code. I did not run the pipeline.
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Claude finished @agneszitte's task in 13s —— View job Re-review of #25666 after commit
|
| Severity | Count |
|---|---|
| Blocking | 0 |
| Minor | 0 |
I checked this by reading the diff. I did not run the pipeline.
e16a4876adds the guard I suggested earlier. A.nupkgwith no root.nuspecnow fails with a clear message that names the package. Before, it failed with a null-reference error. Thethrowsits inside thetry, so the zip handle is still released.- That earlier inline suggestion is now resolved.
- One item is still open from the last review. The PR description's "Known limit" section says ~30 minutes, but the script says ~20. Update the description so the two match.
The CI key can't create a package ID, so the push used to stop midway with an unexplained 403. The prepare step now checks every package ID first and, if one isn't on nuget.org yet, fails before pushing anything with an error that names the file to upload by hand. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Claude finished @agneszitte's task in 18s —— View job Re-review of #25666 after commit
|
| Severity | Count |
|---|---|
| Blocking | 0 |
| Minor | 0 |
I checked this by reading the diff. I did not run the pipeline.
- New-package stop:
Get-NuGetOrgListingreturnsReached,ExistsandVersions. A 404 on the flat-container index collects the package into$newPackages, and the step exits 1 before it creates any batch variable. Nothing is pushed in that case, so there is no half-published version. The error text tells the user what to upload and where. - Fail-open path: if nuget.org can't be reached after 3 tries, the step warns and falls through to the normal push. That still fits the earlier "fail open" decision.
- Re-run skip: only
$isRerunfilters onVersions -contains, so first attempts still fail on an unexpected duplicate. - Lookups on every attempt: nuget.org is now queried on first attempts too, to find new IDs. That adds one request per package. If nuget.org is down, the retries add up to about 10s per package, which is fine for this step.
- Unverified claim: the "403 if the key doesn't allow the new package" hint in the error message depends on nuget.org's key scoping. I couldn't confirm that from the repo. It is only a hint, so it doesn't matter much.
Still open from the earlier review: the PR description's "Known limit" section says ~30 minutes, but the script says ~20. Update the description so the two match. The description also doesn't mention the new-package stop yet.
Xiaoy312
left a comment
There was a problem hiding this comment.
LGTM. A few non-blocking suggestions inline.
Checked: both callers run on hosted vmImage agents (no stale nuget-org-push folder on re-run); the nuget-packages artifact only holds *.nupkg, so copying into batch folders doesn't drop any .snupkg that nuget push would have sent along; a skipped/failed prepare step leaves the batch variables unset so all three pushes skip; -contains is case-insensitive against the lowercased flat-container versions.
- Define the last batches once, as package IDs in pushBatches. - Don't retry nuget.org answers that a retry won't change. - Log the 403 hint as its own warning. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Claude finished @agneszitte's task in 17s —— View job Re-review of #25666 at
|
| Severity | Count |
|---|---|
| Blocking | 0 |
| Minor | 1 |
I read the diff and did not run the pipeline. I posted no inline comments.
The latest commit addresses the open review nits:
- Batches in one place:
pushBatchesnow drives both the PowerShell step and the push tasks. The last two batches are matched by package ID, so the names can no longer drift apart. - Retries: non-retryable 4xx responses no longer retry. 429 and 5xx still do.
- Error output: the 403 hint is now its own warning line.
- Batch variables: names like
NuGetOrgPushUno.WinUIcontain dots. Azure DevOps accepts dots in variable names, and the condition uses the same name the step sets.
Minor, in the PR description (not the code): the validation section still names the batches "UnoWinUI" and "UnoSdkPrivate". The batches are now Uno.WinUI and Uno.Sdk.Private, so the push tasks display as Publish to nuget.org (Uno.WinUI) and so on. The Publish to nuget.org prefix is unchanged. Update the description to match.
The first master build after merge is still the real test for the push tasks.
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
@Mergifyio backport release/stable/6.7 servicing/6.8 |
✅ Backports have been createdDetails
|
…r-25666 fix(ci): Make nuget.org push re-runs resume (backport #25666)
…6.7/pr-25666 fix(ci): Make nuget.org push re-runs resume (backport #25666)
GitHub Issue: closes #25665
PR Type:
🏗️ Build or CI related changes
What changed? 🚀
Before:
Uno.DevServerin build 241054). NuGetCommand@2 can't pass-SkipDuplicate, and itsallowPackageConflictsonly recognizes Azure Artifacts' conflict message, not nuget.org's.Uno.Sdk.PrivateandUno.WinUIwithout their other packages. That happened with 7.0.0-dev.2428.After (in
build/ci/templates/nuget-publish-public.yml, used by the dev and release publish stages):Uno.WinUI(what apps resolve),Uno.Sdk.Private(what the uno.templates Uno.Sdk updater picks new versions from)..nupkgto upload by hand from thenuget-packagesartifact, and says to re-run once it's listed. Today that case shows up as an unexplained 403 halfway through the push.System.JobAttempt> 1), the step leaves out packages already listed on nuget.org, so the re-run pushes only what's missing. First attempts still push everything, so an unexpected duplicate still fails.allowPackageConflictsis removed from the nuget.org push, since it had no effect there.Why not
dotnet nuget push --skip-duplicate: NuGetAuthenticate@1 can't use an API-key service connection, so it would need the nuget.org key as a separate pipeline secret. That's one more place to rotate it every 30 days.Validation
New package Uno.WinUI.FakeNotPublished isn't on nuget.org yet, and CI can't create a new package ID. Upload Uno.WinUI.FakeNotPublished.7.0.0-dev.2428.nupkg from this build's nuget-packages artifact at https://www.nuget.org/packages/manage/upload (owner: unoplatform), wait until it's listed, then re-run this job.Known limit
nuget.org doesn't list a new package right away: today's manual uploads took up to ~20 minutes. A re-run started sooner than that can still hit a 409 on a package the previous attempt just pushed. The step prints this, and a later re-run then completes the push.
PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code