[flaky-ci] Retry MAUI restore during feed publication lag - #12713
simonrozsival wants to merge 5 commits into
Conversation
MAUI's prerelease template can resolve a newly published Microsoft.Extensions.Logging.Debug package while NuGet still holds an older Microsoft.Extensions.Logging version index. This causes NU1102 in the first gating R2R build even though the dependency is already on dotnet11. Pre-restore the Android-only generated project without the HTTP cache. Retry only correlated prerelease Logging NU1102 diagnostics, clear the HTTP cache between bounded attempts, and fail all other restore errors immediately. Clear stale metadata after success so later restore graphs see the same published package set. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/review |
|
✅ Android PR Reviewer completed successfully!
|
There was a problem hiding this comment.
Review summary
Verdict: Looks good overall — 0 errors, 0 warnings, 1 suggestion.
The retry is bounded, limited to the intended prerelease Microsoft.Extensions.Logging* NU1102 publication-skew signature, preserves hard failures for unrelated or mixed errors, and has focused regression coverage. All 44 GitHub checks passed, including the MAUI integration lane; Azure DevOps build 1586938 succeeded.
I left one non-blocking inline suggestion for handling a leaf-only binary-log path.
Generated by Android PR Reviewer for #12713 · gpt56 · 132.1 AIC · ⌖ 14.1 AIC · ⊞ 25.7K
Comment /review to run again
Use the current directory when BinaryLogPath has no parent directory. Add a focused regression assertion for the generated attempt log argument. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/review |
|
✅ Android PR Reviewer completed successfully!
|
There was a problem hiding this comment.
The retry is bounded and the focused tests cover the main success/failure paths, but the classifier does not yet establish that the reported nearest version is actually older than the requested version, so it can retry non-transient range incompatibilities. CI is also currently red in the macOS, Linux, and Windows build jobs.
Generated by Android PR Reviewer for #12713 · gpt56 · 110.4 AIC · ⌖ 8.85 AIC · ⊞ 25.7K
Comment /review to run again
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Do not run helper self-tests in every MAUI integration job. Restrict retry classification to NuGet's exact simple prerelease lower-bound diagnostic so bounded or otherwise incompatible ranges remain hard failures. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new restore helper can fail the job after a successful restore if HTTP-cache clearing returns a non-zero exit code, introducing a new CI failure mode.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite
Findings: 2
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
build-tools/automation/scripts/RestoreMauiTemplate.ps1 — DotNetPath, Project, and NuGetConfig are required for this… |
|
build-tools/automation/scripts/RestoreMauiTemplate.ps1 — ❌ error (operational implications): if dotnet restore succeeds, failing the step because `dotnet… |
What changed in this PR
Adds a shared, reusable restore step for the generated Android-only MAUI template project to mitigate transient NuGet feed “publication lag” that can surface as NU1102 during CI.
Changes:
- Introduces
RestoreMauiTemplate.ps1to perform adotnet restorewith bounded retries, targetedNU1102classification, and NuGet HTTP-cache clearing. - Adds a
restore-maui-template.yamltemplate to call the script consistently across pipelines. - Wires the new restore template into the public, internal, and shared MAUI pipeline YAMLs before the Debug/Release build legs.
| File | Description |
|---|---|
| build-tools/automation/yaml-templates/restore-maui-template.yaml | New pipeline template that invokes the restore-retry script for the generated MAUI project. |
| build-tools/automation/scripts/RestoreMauiTemplate.ps1 | New PowerShell helper implementing retry + NU1102 classification + HTTP-cache clearing. |
| build-tools/automation/azure-pipelines.yaml | Adds the restore template step in the shared pipeline before building the template. |
| build-tools/automation/azure-pipelines-public.yaml | Adds the restore template step in the public pipeline before building the template. |
| build-tools/automation/azure-pipelines-internal.yaml | Adds the restore template step in the internal pipeline before building the template. |
Require non-empty dotnet, project, and NuGet configuration paths before starting the restore. Remove the unused definition-only mode now that the pipeline self-test is gone. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/review |
|
✅ Android PR Reviewer completed successfully!
|
There was a problem hiding this comment.
The retry is bounded, targets only the intended prerelease Microsoft.Extensions.Logging* NU1102 shape, preserves unrelated and mixed restore failures, and is consistently wired into all three MAUI pipelines. However, the final PR removes the focused executable tests for this nontrivial classifier and retry state machine; the manual checks listed in the description are not durable regression coverage.
All 44 current checks passed, including dotnet-android (MAUI Tests MAUI Integration) and Azure DevOps build 1592868.
Generated by Android PR Reviewer for #12713 · copilot · gpt56 · 125.7 AIC · ⌖ 11.3 AIC · ⊞ 21K
Comment /review to run again
| if ($missingPackageCount -gt 0 -and -not $currentPackageHasOlderDotNet11Version) { | ||
| return $false | ||
| } | ||
| if ($line -notmatch '(?i)error NU1102: Unable to find package Microsoft\.Extensions\.Logging(?:\.[A-Za-z0-9.-]+)? with version \(>= \d+\.\d+\.\d+-(preview|rc|alpha|beta)(?:\.[0-9A-Za-z-]+)+\)\s*$') { |
There was a problem hiding this comment.
🤖 RestoreMauiTemplate.Tests.ps1 exercised the positive, mixed-error, unrelated-package, persistent-failure, cache-clear, and backoff paths; removing it means the “direct checks” in the PR description cannot catch future regex or control-flow regressions. Please retain focused tests and run them in one appropriate validation lane rather than executing them in every MAUI job.
Rule: Preserve regression coverage for retry classification

Why
The MAUI integration job can resolve a newly published floating
Microsoft.Extensions.Logging.Debugbuild while NuGet still has an oldercached version list for its exact
Microsoft.Extensions.Loggingdependency.This produced
NU1102in builds 1575484, 1581740, 1581742, and 1582480 eventhough the requested packages had already reached the
dotnet11feed.This addresses #12704.
What changed
--no-http-cachebefore the Debug, Release, Mono, and R2R paths.
Microsoft.Extensions.LoggingNU1102diagnostics with an exact simple lower-bound requirement where
dotnet11reports an older nearest version.
success, so later implicit restore graphs cannot reuse stale metadata.
gating.
Validation
Direct positive and bounded-range negative checks of the restore failure
classifier.
Generated Android-only MAUI project restore using the affected
Microsoft.Extensions.Logging.Debugbuild and thedotnet11feed.Azure Pipeline YAML syntax parsing.
Useful description of why the change is necessary.
Links to issues fixed
Unit tests (not applicable to this CI-only script change)