Skip to content

[flaky-ci] Retry MAUI restore during feed publication lag - #12713

Open
simonrozsival wants to merge 5 commits into
mainfrom
simonrozsival-maui-restore-publication-lag
Open

simonrozsival wants to merge 5 commits into
mainfrom
simonrozsival-maui-restore-publication-lag

Conversation

@simonrozsival

@simonrozsival simonrozsival commented Sep 8, 2026

Copy link
Copy Markdown
Member

Why

The MAUI integration job can resolve a newly published floating
Microsoft.Extensions.Logging.Debug build while NuGet still has an older
cached version list for its exact Microsoft.Extensions.Logging dependency.
This produced NU1102 in builds 1575484, 1581740, 1581742, and 1582480 even
though the requested packages had already reached the dotnet11 feed.

This addresses #12704.

What changed

  • Pre-restore the generated Android-only MAUI project with --no-http-cache
    before the Debug, Release, Mono, and R2R paths.
  • Retry only correlated prerelease Microsoft.Extensions.Logging NU1102
    diagnostics with an exact simple lower-bound requirement where dotnet11
    reports an older nearest version.
  • Clear only NuGet's HTTP cache between bounded attempts and after an immediate
    success, so later implicit restore graphs cannot reuse stale metadata.
  • Keep unrelated, bounded-range, and persistently missing package failures
    gating.
  • Use the same helper in the public, internal, and shared MAUI pipelines.

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.Debug build and the dotnet11 feed.

  • 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)

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>
@simonrozsival simonrozsival added the flaky-ci Intermittent CI failures and work to improve CI reliability label Sep 8, 2026
@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #12713

@github-actions github-actions Bot 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.

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

Comment thread build-tools/automation/scripts/RestoreMauiTemplate.ps1
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>
@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #12713

@github-actions github-actions Bot 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.

⚠️ Needs Changes — 0 errors, 1 warning, 0 suggestions.

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

Comment thread build-tools/automation/scripts/RestoreMauiTemplate.ps1
simonrozsival and others added 2 commits September 9, 2026 11:09
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>
@simonrozsival
simonrozsival marked this pull request as ready for review September 10, 2026 10:40
Copilot AI lite review requested due to automatic review settings September 10, 2026 10:40

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.

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 Medium severity

New issues introduced by this change (2)
Severity Finding
Medium severity build-tools/​automation/​scripts/​RestoreMauiTemplate.ps1⚠️ warning (best practices): DotNetPath, Project, and NuGetConfig are required for this…
Medium severity 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.ps1 to perform a dotnet restore with bounded retries, targeted NU1102 classification, and NuGet HTTP-cache clearing.
  • Adds a restore-maui-template.yaml template 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.

Comment thread build-tools/automation/scripts/RestoreMauiTemplate.ps1
Comment thread build-tools/automation/scripts/RestoreMauiTemplate.ps1
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>
@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #12713

@github-actions github-actions Bot 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.

⚠️ Needs Changes — 0 errors, 1 warning, 0 suggestions.

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*$') {

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.

🤖 ⚠️ Testing — This classifier is the safety boundary between retrying a known publication race and masking a real restore failure, but the final change has no checked-in executable coverage for its output grammar. The earlier 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flaky-ci Intermittent CI failures and work to improve CI reliability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants