Skip to content

Move main to .NET 12 - #40060

Merged
kubaflo merged 4 commits into
dotnet:mainfrom
kubaflo:dev/kubaflo/main-net12
Nov 25, 2026
Merged

kubaflo merged 4 commits into
dotnet:mainfrom
kubaflo:dev/kubaflo/main-net12

Conversation

@kubaflo

@kubaflo kubaflo commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Target Branch

This PR is for Initial base
New features, API changes, or .NET 12 work (including .NET 12 fixes) main
.NET 11 servicing fixes net11, for review
Older servicing, release integration, infrastructure, or documentation The branch designated for that work

For .NET 11 fixes, only a maintainer retargets the approved PR to the active
inflight lane and merges it after CI validates that final base. Do not merge
individual fixes directly into net11; agents must not retarget or merge.

Description of Change

Moves main from .NET 11 to .NET 12. (net11 is now the .NET 11 servicing branch.)

SDK / workloads — taken from coherent main builds of dotnet/android and dotnet/macios, which are both built against the same VMR SDK:

Version
.NET SDK / runtime 12.0.100-alpha.1.26523.103 / 12.0.0-alpha.1.26523.103
iOS (net12.0_27.1) 27.1.12089-net12-p1
Mac Catalyst / macOS / tvOS (net12.0_27.0) 27.0.13384-net12-p1 (same macios commit 7af83b1)
Android 37.99.0-preview.1.358
Workload manifest band 12.0.100-alpha.1

Arcade stays on 11 for now.

Changes

  • global.json, eng/Versions.props, eng/Version.Details.xml: SDK, runtime, Apple and Android versions; MajorVersion, SdkBandVersion and AssemblyVersion are now 12. Previous-framework workload metadata is aligned with the retained upstream parents.
  • Directory.Build.props: current TFM net12.0, iOS TPV 27.1.
  • Previous TFM is now net11 instead of net10. The net12 Apple and Android workload manifests only include net12 and net11 packs, so net10 can no longer build with this SDK. This updates the runtime manifests in Workloads.csproj (net10 → net11), MicrosoftMauiPreviousDotNetReleasedVersion (11.0.0-rc.2.26505.5) and the integration-test constants.
  • NuGet.config:
    • adds the dotnet12 and dotnet12-transport feeds;
    • adds two darc feeds from macios release/11.0.1xx. The net12 Apple manifests pin their net11 packs to builds that are only published there.
  • CI and tests:
    • ValidateXcodeVersion=false bypasses version validation, but cannot supply the iOS 27.1 APIs missing from agents with Xcode 27.0. Those public Apple builds remain blocked until a suitable toolchain is available.
    • The previous-framework Build and AOT integration partitions are retained. The mixed-platform Build partition uses the regular pool; previous-framework iOS-only jobs request Xcode 27.0. Two iOS simulator-x64 NativeAOT cases run against net11 as compatibility coverage, not as a substitute for net12 x64 coverage.
    • Internal Xcode provisioning uses the pinned package, validates its metadata and preserves explicit job-level Xcode pins. The iOS UI host has a scene manifest and simulator selection checks device compatibility.
    • Android and Apple CoreCLR device hosts build separately so Apple build failures do not block Android device tests. Apple job names avoid invalid log-artifact characters.
    • Android input-method service access uses Java type mapping and preserves the shared service lifetime. Java file-not-found exception constructors are retained at both Android asset-open boundaries for trimmed CoreCLR builds.
  • Test snapshots that embed the assembly version: 11.0.0.0 → 12.0.0.0.
  • Cake defaults now use net12.0.

Coverage still unresolved: this PR currently removes the Android Mono device-test lane and the net12 iOS simulator-x64 UI-host target because those runtime configurations are no longer supplied by the current upstream workloads. The net11 x64 cases do not restore equivalent net12 coverage. The retained iOS Mono device build also fails to link with the current workload. The request to keep every test configuration enabled is therefore not yet satisfied.

Validation: The previous-framework Build partition passed 15/15 locally, the restored net11 iOS simulator-x64 NativeAOT cases passed 2/2, current-framework iOS arm64 NativeAOT passed 2/2, and two iOS simulator integration cases passed 2/2. Apple validation used local Xcode 27.1 with the version check bypassed where required. On an Android API 33 arm64 emulator with .NET 12 CoreCLR, the Entry category passed 246 tests with 2 skipped, Essentials passed 424/424, and HybridWebView passed 97 tests with 5 skipped. Controlled reversions reproduced the input-service and missing-file failures. Full local Core and Controls runs still had failures; not all Controls leak-assertion failures have been classified. Latest-head CI is running; actual internal Xcode-package installation and the strict Xcode 27.0 job pin still require CI validation.

Issues Fixed

N/A — SDK migration.

Follow-ups (not in this PR)

  • Move Arcade to 12 and wire up Maestro subscriptions for the .NET 12 channels.
  • Provide Xcode 27.1 or later on the public macOS agents, then remove ValidateXcodeVersion=false where no longer needed.
  • Resolve the missing Android Mono and net12 iOS simulator-x64 coverage without misrepresenting a previous-framework lane as equivalent.

@kubaflo

This comment has been minimized.

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 9, 2026 00:01 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 40060

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 40060"

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 9, 2026 00:01 — with GitHub Actions Inactive
@azure-pipelines

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 9, 2026 00:02 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 9, 2026 00:04 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 9, 2026 00:05 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 9, 2026 00:06 — with GitHub Actions Inactive
@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 9, 2026
@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@MauiBot

This comment has been minimized.

@MauiBot MauiBot added s/agent-gate-failed AI could not verify tests catch the bug and removed s/agent-review-in-progress AI review is currently running for this PR labels Nov 9, 2026
@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 9, 2026
@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@MauiBot

This comment has been minimized.

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.

🔵 Needs a closer look

Release-targeted tools still cannot start with only the pinned .NET 12 prerelease runtime installed, and iOS Mono device-test coverage is removed contrary to the PR description.

3 open issues

Review effort: Balanced

@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.

Expert Review — 15 findings

Reviewed commit 62c113c.

See inline comments for details.

# Tools such as Cake target net10.0; let them run on the repo's .NET 12 preview runtime when
# no .NET 10 runtime is installed (their own roll-forward setting skips prerelease runtimes).
- name: DOTNET_ROLL_FORWARD
value: Major

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.

[major] Logic and Correctness Verification - Major-version roll-forward does not permit release-targeted tools to select prerelease runtimes. The Windows device-test stage provisions and prepends the isolated .dotnet root, then invokes net10.0 Cake for unpackaged and packaged builds. src/DotNet/DotNet.csproj deletes and recreates that root with the pinned .NET 12 alpha SDK/runtime, so Cake still fails framework resolution when no stable runtime exists there; a stable system runtime does not populate this installation. Enable DOTNET_ROLL_FORWARD_TO_PRERELEASE=1 for the affected invocations or install a compatible stable runtime into their selected root.

{
public SwitchHoverResourceState(ResourceDictionary ownerResources) => OwnerResources = ownerResources;

public ResourceDictionary OwnerResources { get; }

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.

[major] Memory Leak Prevention - Apply a non-null TrackColor to an on-switch, then replace ToggleSwitch.Resources without recoloring. The live switch's ConditionalWeakTable value strongly retains the discarded dictionary through OwnerResources, including its unrelated application resources. The replacement check runs only on a subsequent on-state TrackColor update, so the obsolete resource graph cannot be collected while the switch remains alive and unchanged. Release replaced owners without requiring another color update while preserving active-wrapper retention. Add a WeakReference collection test without recoloring; CustomOnColorPreservesReplacedResources immediately updates TrackColor and misses this path.

Comment thread eng/pipelines/ci.yml
- ImageOverride -equals 1ESPT-Ubuntu22.04

# The .NET 11 iOS compatibility workload recommends Xcode 27.0.
- name: previousXcodeVersion

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.

[major] Input and Path Correctness - The new unrestricted previousXcodeVersion string is forwarded through the integration job matrix to stage-integration-tests.yml's XCODE variable, then expanded directly into Bash source in provision.yml at XCODE_MAJOR_MINOR=$(XCODE) and the fallback XCODE_VERSION=$(XCODE) assignments. A value containing whitespace or shell metacharacters is parsed as shell syntax rather than rejected as a malformed version. The pinned-version verification happens only after this selection step. Pass the value as an environment variable and validate the numeric version format before using it, or constrain the parameter to an explicit supported-version list.

# The .NET 12 Apple workloads require Xcode 27.1. Agents without it fall back to Xcode_27.app (27.0)
# during "Select Xcode Version", so keep validation off until every image has Xcode 27.1.
- name: ValidateXcodeVersion
value: false

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.

[moderate] Build & MSBuild - On a public compilation agent with Xcode 27.0 at Xcode_27.app but no Xcode 27.1, provision.yml still accepts the major-version fallback. The compatible package installer is internal-only, while this migration pins the net12 iOS SDK and target platform to 27.1. Disabling validation and provisioning simulator runtimes for the older selected Xcode cannot supply its missing compilation SDK/APIs, so public net12 iOS framework, app and integration builds remain blocked on that configuration. Provision and require a compatible public compilation toolchain while preserving explicit previous-framework and UI-execution pins.

//This assumes that this is always running from a mac with global workloads
const string DotnetToolPathDefault = "/usr/local/share/dotnet/dotnet";
string DotnetVersion = Argument("targetFrameworkVersion", EnvironmentVariable("TARGET_FRAMEWORK_VERSION") ?? "net11.0");
string DotnetVersion = Argument("targetFrameworkVersion", EnvironmentVariable("TARGET_FRAMEWORK_VERSION") ?? "net12.0");

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.

[moderate] Build & MSBuild - The legacy branch of eng/pipelines/device-tests.yml still defaults targetFrameworkVersions to net11.0. For definitions other than maui-pr-devicetests, device-tests-jobs.yml and device-tests-steps.yml explicitly pass --targetFrameworkVersion=net11.0, overriding this new fallback. Android's ExecuteBuild consequently requests -f net11.0-android, but the device projects now expose net12 platform TFMs through MauiDeviceTestsPlatforms; the requested framework is absent from their restored assets. Update the legacy matrix alongside this default so those runs can build their test bundles.

# back to an older Xcode when the pinned one is missing; that Xcode has no device types
# for the pinned runtime, so match the selected Xcode's simulator SDK instead.
XCODE_MAJOR_MINOR="$(XCODE)"
SELECTED_SDK_VERSION=$(xcrun --sdk iphonesimulator --show-sdk-version 2>/dev/null)

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.

[moderate] Regression Prevention and Test Coverage - The selected-SDK fallback fix lacks a fixture where requested Xcode 27.1 falls back to simulator SDK 27.0. Review-PR.Tests.ps1 injects MAJOR/MINOR and extracts code starting at RUNTIME_ARCHITECTURE, bypassing this selection; deleting the new branch leaves those fixtures unchanged and permits downloading the incompatible requested runtime again. Add mismatched and matching requested/selected version cases asserting download arguments and the required runtime identifier. SimulatorRuntimeSelectionTests exercises the separate C# selector.

} elseif ($env:UI_TEST_PLATFORM) {
$buildArguments += "--$env:UI_TEST_PLATFORM"
}
$extraCakeArguments = ConvertFrom-Json -InputObject $env:UI_TEST_CAKE_ARGS -NoEnumerate

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.

[moderate] Regression Prevention and Test Coverage - The argument-array fix has no regression fixture for an option containing spaces. Current sample-build callers leave cakeArgs empty, and RunTests.Tests.ps1 checks platform interpolation rather than received arguments, so neither detects reintroduced expression parsing or argument splitting. Capture arguments with an isolated stub build.ps1 and assert --nugetsource=/tmp/NuGet Cache remains one unchanged argument. Contrast accepted empty/single-item string arrays with rejected scalar/non-string inputs to cover the new guards.

# resolve the raw framework-dependent binary there (e.g. Homebrew's
# libexec/pwsh) instead of the agent's entry point, and it fails when
# DOTNET_ROOT lacks its runtime. Keep $PSHOME, but last.
$pathEntries = $env:PATH -split ':' | Where-Object { $_ }

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.

[moderate] Regression Prevention and Test Coverage - The PATH-ordering fix lacks a regression fixture with the triggering leading Homebrew PSHOME entry. A host without that competing entry cannot detect reintroduced selection of raw libexec/pwsh instead of its wrapper, preventing subsequent PowerShell steps from starting when the selected runtime root lacks its required framework. Add isolated cases asserting repository dotnet first, wrapper before PSHOME, preserved unrelated entries, and no introduced PSHOME entry when it was absent.

# Agents don't preinstall JDK 21, so this downloads it; the download host has
# intermittent 504 windows that outlast the task-level retry backoff.
- pwsh: |
foreach ($delay in 0, 30, 60, 120) {

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.

[minor] Complexity Reduction - This four-attempt loop is also wrapped in retryCountOnTaskFailure: 4: persistent JDK provisioning failures now trigger up to 20 invocations and 1,050 seconds of explicit sleeps, excluding command time and Azure backoff. Every invocation also overwrites the same binlog. The longer backoff does not need two retry owners. Follow the single-owner pattern in eng/scripts/Install-AndroidSdkPackage.ps1: use one explicitly bounded loop with the intended total attempt budget and longer delays, disable task-level retries, and retain attempt-numbered diagnostics.

"nuget": {
"name": "Microsoft.Extensions.Configuration",
"version": "10.0.0"
"version": "11.0.0"

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.

[minor] Build & MSBuild - These generated registrations record Microsoft.Extensions.Configuration, DependencyInjection and Logging.Debug as 11.0.0, while their central eng/Versions.props values are 11.0.1. Microsoft.Maui.Templates.csproj enables automatic manifest generation; update-cgmanifest.ps1 reads these stable properties directly, so rebuilding rewrites all three entries to 11.0.1. Remove the generated-file delta and leave regeneration to the existing target rather than committing an inventory that disagrees with its producer.

kubaflo and others added 3 commits November 24, 2026 15:44
Rebased onto latest main via net11 (b8cc4e7, which contains main d4ae6c2). The PR diff is unchanged; previous head 7494403 squashed these commits:

- Move main to .NET 12
- Skip the net12 Apple scene-manifest validation for repo samples and test apps
- Provision JDK 21 for the .NET 12 Android workload
- Publish Helix xUnit payloads for the repo TFM
- Drop the iossimulator-x64 RID, which net12 iOS no longer ships
- Expect assembly version 12 in AssemblyInfoTests
- Use MAUI 11 rc.2 as the previous MauiVersion in integration tests
- Retry JDK provisioning with a longer backoff
- Run one iOS integration lane on the xcode-27 image
- Revert "Run one iOS integration lane on the xcode-27 image"
- Always use iossimulator-arm64 in integration tests
- Skip iOS runtimes XHarness can't create a simulator on
- Fix Windows CI on the .NET 12 preview SDK
- Skip .NET 12 iOS in public CI
- Make the device-test Mono lane iOS-only
- [ci] Restore public iOS coverage
- Fix iOS test host and migration validation
- Restore previous-framework Apple integration coverage
- Isolate Android test hosts from Apple builds
- Fix Android CoreCLR device test failures
- Select the pinned internal Xcode package
- Pass UI build arguments without expression evaluation
- Restore iOS device-test runner scene lifecycle
- Key Windows Switch hover state by ToggleSwitch
- Wait for asynchronous Android CoreCLR GC bridge release in device-test GC helper
- Restore Android Mono and iOS simulator-x64 test coverage
- Keep TestCases HostApp on iossimulator-arm64; net12 iOS rejects x64
- Build Android and iOS Mono device tests in separate stages
- Re-enable Debug CoreCLR sample-content integration test
- Enable macOSTemplates, iOS Mono lanes and remaining Apple template tests
- Log workload manifest state before Windows device-test builds
- Fix iOS Mono integration-test lanes on .NET 12 SDK
- Keep both iOS simulator RIDs for the net11 HostApp on CI
- Shut down build servers before Windows device-test builds
- Reconcile Windows Switch hover state with upstream dotnet#40209
- Re-enable Avalonia template tests and fix previous Apple TFMs
- [net12][ci] Remove .NET 12 Mono and iossimulator-x64 coverage
- [net12][tests] Isolate Android debug keystore per integration test
- Keep PSHOME last in persisted macOS PATH
- [ci] Require the exact iOS simulator runtime and accept already-installed runtimes
- [ci] Keep the simulator provisioning contract with exact runtime checks
- [ci] Select Xcode 27.1 for .NET 12 Apple builds where agents have it
- [ci] Keep iOS UI test execution on the pinned Xcode
- [ci] Provision simulator runtimes for the Xcode actually selected
- [ci] Require the exact iOS simulator runtime and accept already-installed runtimes (dotnet#40407)
- Restore .NET 12 dependency versions and provisioning after rebasing onto net11
- Make Issue2951Test re-query buttons after taps

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The implicit checkout fetched all tags (~158k objects vs ~27k), and those
heavy anonymous PR-merge fetches intermittently failed with 'could not read
Username', cascading into Gradle init and test failures on Android.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…redential

UI-test jobs intermittently fail checkout for short windows with 'could not
read Username' (GitHub rejects the job's credential), which cascades into
Gradle-init and test failures. dotnet/maui is public, so retry the same
commit anonymously instead of failing the job.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

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.

🟡 Changes recommended

Release-targeted tools still fail to start when only the pinned .NET 12 alpha runtime is installed because prerelease roll-forward is not enabled.

5 open issues

Review effort: Balanced

Comment on lines +145 to +146
- stage: devicetests_build_android_coreclr
displayName: ${{ parameters.TargetFrameworkVersion }} CoreCLR Android Helix Tests - Build
<!-- On CI, build universal binaries where both simulator architectures are supported. -->
<RuntimeIdentifiers Condition="$(TargetFramework.Contains('-maccatalyst')) and ('$(CI)' == 'true' or '$(TF_BUILD)' == 'true')">maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(TargetFramework.Contains('-ios')) and ('$(CI)' == 'true' or '$(TF_BUILD)' == 'true')">iossimulator-x64;iossimulator-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(TargetFramework.StartsWith('$(_MauiDotNetTfm)-ios')) and ('$(CI)' == 'true' or '$(TF_BUILD)' == 'true')">iossimulator-arm64</RuntimeIdentifiers>
@kubaflo

This comment has been minimized.

@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.

Expert Review — 12 findings

Reviewed commit c35642b.

See inline comments for details.

Previously reported findings were not duplicated.

# Tools such as Cake target net10.0; let them run on the repo's .NET 12 preview runtime when
# no .NET 10 runtime is installed (their own roll-forward setting skips prerelease runtimes).
- name: DOTNET_ROLL_FORWARD
value: Major

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.

[major] Logic and Correctness Verification - Major-version roll-forward does not permit release-targeted tools to select prerelease runtimes. The Windows device-test stage prepends the isolated .dotnet installation, then invokes net10.0 Cake for packaged and unpackaged builds. src/DotNet/DotNet.csproj deletes and recreates that root with the pinned .NET 12 alpha SDK/runtime, so Cake still fails framework resolution when it contains no stable runtime; a stable system installation does not satisfy this host. Enable prerelease roll-forward for these invocations or install a compatible stable runtime into their selected root.

Comment thread eng/pipelines/ci.yml
- ImageOverride -equals 1ESPT-Ubuntu22.04

# The .NET 11 iOS compatibility workload recommends Xcode 27.0.
- name: previousXcodeVersion

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.

[major] Input and Path Correctness - The unrestricted previousXcodeVersion parameter flows through job.xcodeVersion into XCODE in stage-integration-tests.yml, then Azure substitutes it into executable Bash at XCODE_MAJOR_MINOR=$(XCODE) in common/provision.yml:180 and the fallback XCODE_VERSION assignments. A value containing whitespace changes the assignment into a command invocation and fails provisioning under set -e. Pinned jobs disable package installation, and version verification runs afterward, so neither guards this newly connected source-to-sink path. Pass the value through an environment variable and validate numeric version syntax before selection.

# The .NET 12 Apple workloads require Xcode 27.1. Agents without it fall back to Xcode_27.app (27.0)
# during "Select Xcode Version", so keep validation off until every image has Xcode 27.1.
- name: ValidateXcodeVersion
value: false

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.

[moderate] Build & MSBuild - On a public compilation agent with Xcode 27.0 at Xcode_27.app but no Xcode 27.1, provision.yml still accepts the major-version fallback. The package installer is internal-only, while this migration pins the net12 iOS SDK and target platform to 27.1. Disabling validation and downloading simulator runtimes for the older selected Xcode cannot supply its missing compilation SDK/APIs, so net12 iOS app builds remain blocked on that configuration. Provision and require a compatible public compilation toolchain while preserving explicit previous-framework and UI-execution pins.

//This assumes that this is always running from a mac with global workloads
const string DotnetToolPathDefault = "/usr/local/share/dotnet/dotnet";
string DotnetVersion = Argument("targetFrameworkVersion", EnvironmentVariable("TARGET_FRAMEWORK_VERSION") ?? "net11.0");
string DotnetVersion = Argument("targetFrameworkVersion", EnvironmentVariable("TARGET_FRAMEWORK_VERSION") ?? "net12.0");

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.

[moderate] Logic and Correctness Verification - The legacy branch of eng/pipelines/device-tests.yml still defaults targetFrameworkVersions to net11.0. For definitions other than maui-pr-devicetests, device-tests-jobs.yml and device-tests-steps.yml explicitly pass --targetFrameworkVersion=net11.0, overriding this fallback. Android's ExecuteBuild consequently requests -f net11.0-android, but Core and Controls device projects now expose net12 platform TFMs through MauiDeviceTestsPlatforms. Update that entry point's matrix alongside this default so its default runs can build their bundles.


<!-- The current SDK pins {{BaseBuildTest.DotNetPrevious}} ILLink to a pre-release whose API does not
match the custom steps used by previous-.NET Apple SDKs for Mono builds (IL1027). -->
<Target Name="_MauiTestPinPreviousILLinkPack" BeforeTargets="ProcessFrameworkReferences">

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.

[moderate] Trimming and AOT Compatibility - This previous-framework ILLink pin is written only to the fixture-root Directory.Build.targets. BaseTemplateTests copies src/Templates/tests/Directory.Build.targets into each generated project's nearer directory; that file neither imports the parent nor contains this override. Consequently retained net11 Release SimpleTemplateTest.Build and BuildWithMauiVersion app cases miss the linker compatibility fix for the documented Apple Mono custom-step API mismatch (IL1027). Put the pin in targets those projects actually import. AppleTemplateTests derives directly from BaseBuildTest and does not have this shadowing problem.

Assert.That(updatedButton.GetText(), Is.EqualTo("B"));
// The cell re-renders after the tap, which can invalidate element references
// (StaleElementReferenceException on Mac Catalyst), so re-query on each attempt.
App.RetryAssert(() =>

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.

[moderate] Logic and Correctness Verification - If either retry initially observes the pre-update button text or count while the cell re-renders, NUnit 4.0.1 records the failed assertion before throwing. HelperExtensions.RetryAssert catches that exception without isolating or clearing the recorded failure, so a later successful poll still leaves the test failed even when the UI settles within the retry window. Poll a non-asserting predicate or use a delayed NUnit constraint instead of retrying assertions in the current test context.

} elseif ($env:UI_TEST_PLATFORM) {
$buildArguments += "--$env:UI_TEST_PLATFORM"
}
$extraCakeArguments = ConvertFrom-Json -InputObject $env:UI_TEST_CAKE_ARGS -NoEnumerate

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.

[moderate] Regression Prevention and Test Coverage - The argument-array fix has no discriminating regression fixture for an option containing spaces. Sample-build callers leave cakeArgs empty, and RunTests.Tests.ps1 checks platform interpolation rather than received arguments, so restoring expression parsing or argument splitting would go undetected. Add an isolated stub-build fixture asserting that an option containing a space arrives as one unchanged argument. Contrast accepted empty/single-item string arrays with rejected scalar/non-string inputs to cover the new guards without running a build.

# resolve the raw framework-dependent binary there (e.g. Homebrew's
# libexec/pwsh) instead of the agent's entry point, and it fails when
# DOTNET_ROOT lacks its runtime. Keep $PSHOME, but last.
$pathEntries = $env:PATH -split ':' | Where-Object { $_ }

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.

[moderate] Regression Prevention and Test Coverage - The persisted-PATH fix has no regression fixture with the triggering leading Homebrew $PSHOME entry. A host without that competing entry cannot detect reintroduced selection of raw libexec/pwsh instead of its wrapper, which prevents subsequent PowerShell steps from starting when the selected runtime root lacks its framework. Add isolated cases asserting repository dotnet first, wrapper before $PSHOME, preserved unrelated entries, and no introduced $PSHOME entry when it was absent.

# back to an older Xcode when the pinned one is missing; that Xcode has no device types
# for the pinned runtime, so match the selected Xcode's simulator SDK instead.
XCODE_MAJOR_MINOR="$(XCODE)"
SELECTED_SDK_VERSION=$(xcrun --sdk iphonesimulator --show-sdk-version 2>/dev/null)

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.

[moderate] Regression Prevention and Test Coverage - The selected-SDK fallback fix lacks a fixture where requested Xcode 27.1 falls back to simulator SDK 27.0. Review-PR.Tests.ps1 injects MAJOR/MINOR and extracts code starting at RUNTIME_ARCHITECTURE, bypassing this selection; deleting the new branch leaves those fixtures unchanged and permits downloading the incompatible requested runtime again. Add mismatched and matching requested/selected version cases asserting download arguments and the required runtime identifier. SimulatorRuntimeSelectionTests covers the separate C# selector.

# Agents don't preinstall JDK 21, so this downloads it; the download host has
# intermittent 504 windows that outlast the task-level retry backoff.
- pwsh: |
foreach ($delay in 0, 30, 60, 120) {

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.

[minor] Complexity Reduction - This four-attempt loop is also wrapped in retryCountOnTaskFailure: 4: persistent JDK provisioning failures trigger up to 20 invocations and 1,050 seconds of explicit sleeps, excluding command time and Azure backoff. Each invocation also overwrites the same binlog. The longer backoff does not need two retry owners. Follow the single-owner pattern in eng/scripts/Install-AndroidSdkPackage.ps1: use one bounded loop with the intended total attempt budget, disable task-level retries, and retain attempt-numbered diagnostics.

@kubaflo

kubaflo commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

CI after rebasing onto latest main (bca4740888, which includes all of net11 via #40577). PR head c35642b866, merge 7d49da7be7.

Pipeline Build Result
maui-pr 1697238 ✅ succeeded
maui-pr-devicetests 1697240 ✅ succeeded after 1 retry
maui-pr-uitests 1697239 ✅ 134/134 jobs pass (after 1 retry); the overall result is partiallySucceeded only because 21 jobs report "succeeded with issues" after the checkout fallback below

Android checkout fix: In the previous run, all 22 Android UI-test jobs failed when GitHub rejected the pipeline credential during checkout (could not read Username). This cascaded into cp: cannot stat eng/init.gradle. ui-tests-steps.yml now lets checkout continue on error and falls back to an anonymous, by-SHA fetch of the merge commit, retried with backoff. In this run, 21 jobs hit the credential error. The fallback recovered all 21: it checked out 7d49da7be7, the Gradle init script installed, and the tests ran normally.

Retries (not caused by this PR, no tests disabled):

  • Windows device tests: CanGoBack Is False After Navigating Back To The First Page (Issue #37534) hit TimeoutException: Failed to navigate (1 of 2,261). It passed on retry.
  • Mac Catalyst CoreCLR: ActionSheetClickItem(ActionSheetClickCancel) failed twice on agent AcesShared 72 ("(none)" instead of "SUCCESS 1"). It passed on a different agent, and it also passed in the previous run of this PR.

@kubaflo

This comment has been minimized.

@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.

Expert Review — 11 findings

Reviewed commit c35642b.

See inline comments for details.

# Tools such as Cake target net10.0; let them run on the repo's .NET 12 preview runtime when
# no .NET 10 runtime is installed (their own roll-forward setting skips prerelease runtimes).
- name: DOTNET_ROLL_FORWARD
value: Major

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.

[major] Logic and Correctness Verification - Major-version roll-forward does not allow release-targeted tools to select prerelease runtimes. The Windows device-test stage provisions and prepends the isolated .dotnet root, then invokes net10.0 Cake for unpackaged and packaged builds. src/DotNet/DotNet.csproj recreates that root with the pinned .NET 12 alpha SDK/runtime, so Cake still fails framework resolution when no stable runtime exists there; a stable system installation does not populate this root. Enable DOTNET_ROLL_FORWARD_TO_PRERELEASE=1 for these invocations or install a compatible stable runtime into their selected root.

Comment thread eng/pipelines/ci.yml

# The .NET 11 iOS compatibility workload recommends Xcode 27.0.
- name: previousXcodeVersion
type: string

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.

[major] Input and Path Correctness - The unrestricted previousXcodeVersion parameter flows through job.xcodeVersion into XCODE in stage-integration-tests.yml, then Azure substitutes it into executable Bash at XCODE_MAJOR_MINOR=$(XCODE) in common/provision.yml:180. A value containing whitespace, such as 27.0 beta, makes Bash attempt to execute the second word instead of assigning one version value, failing provisioning under set -e. These pinned jobs disable package installation, and pinned-version verification runs afterward, so neither guards this newly connected source-to-sink path. Pass the value through an environment variable and validate numeric version syntax before selection.

//This assumes that this is always running from a mac with global workloads
const string DotnetToolPathDefault = "/usr/local/share/dotnet/dotnet";
string DotnetVersion = Argument("targetFrameworkVersion", EnvironmentVariable("TARGET_FRAMEWORK_VERSION") ?? "net11.0");
string DotnetVersion = Argument("targetFrameworkVersion", EnvironmentVariable("TARGET_FRAMEWORK_VERSION") ?? "net12.0");

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.

[moderate] Logic and Correctness Verification - eng/pipelines/device-tests.yml still defaults targetFrameworkVersions to net11.0. For definitions other than maui-pr-devicetests, device-tests-jobs.yml and device-tests-steps.yml explicitly pass --targetFrameworkVersion=net11.0, overriding this updated fallback. Android's ExecuteBuild consequently requests -f net11.0-android, but Core and Controls device projects now expose net12 platform TFMs through MauiDeviceTestsPlatforms. Update the legacy entry point's framework matrix alongside this migration so default runs can build their test bundles.

- catalyst
skipProvisioning: ${{ parameters.skipProvisioning }}

- ${{ if and(containsValue(parameters.selectedPlatforms, 'android'), or(eq(length(parameters.selectedCategories), 0), and(not(contains(join(',', parameters.selectedCategories), ':')), ne(join('', parameters.selectedCategories), 'Material3')), contains(replace(join(',', parameters.selectedCategories), 'android:Material3', ''), 'android:'))) }}:

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.

[moderate] Regression Prevention and Test Coverage - Splitting out the Android build adds an eleventh plain-category guard, but the existing 'handles qualified selections in every stage guard, including the dedicated lanes' test in .github/scripts/RunTests.Tests.ps1:645 still asserts exactly ten occurrences. That contract assertion necessarily fails against this template, independent of selected platforms or categories. Update the contract alongside the split while preserving its qualified-selection checks.


<!-- The current SDK pins {{BaseBuildTest.DotNetPrevious}} ILLink to a pre-release whose API does not
match the custom steps used by previous-.NET Apple SDKs for Mono builds (IL1027). -->
<Target Name="_MauiTestPinPreviousILLinkPack" BeforeTargets="ProcessFrameworkReferences">

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.

[moderate] Trimming and AOT Compatibility - This previous-framework ILLink pin is written only to the fixture-root Directory.Build.targets. BaseTemplateTests copies src/Templates/tests/Directory.Build.targets into each generated project's nearer directory; that file neither imports the parent nor contains this override. Retained net11 Release SimpleTemplateTest.Build and BuildWithMauiVersion app cases therefore miss the linker compatibility fix for the documented previous-Apple Mono custom-step API mismatch (IL1027). Put the pin in targets those projects actually import. AppleTemplateTests derives directly from BaseBuildTest and does not have this shadowing problem.

} elseif ($env:UI_TEST_PLATFORM) {
$buildArguments += "--$env:UI_TEST_PLATFORM"
}
$extraCakeArguments = ConvertFrom-Json -InputObject $env:UI_TEST_CAKE_ARGS -NoEnumerate

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.

[moderate] Regression Prevention and Test Coverage - The argument-array fix and its rejection guards lack a discriminating regression fixture. Current sample-build callers do not supply an option containing spaces, and RunTests.Tests.ps1 checks platform interpolation rather than received arguments, so reintroducing expression parsing or argument splitting would go undetected. Add an isolated stub-build fixture asserting that an option with a space-containing path arrives as one unchanged argument; contrast accepted empty/single-item string arrays with rejected scalar/non-string inputs.

# resolve the raw framework-dependent binary there (e.g. Homebrew's
# libexec/pwsh) instead of the agent's entry point, and it fails when
# DOTNET_ROOT lacks its runtime. Keep $PSHOME, but last.
$pathEntries = $env:PATH -split ':' | Where-Object { $_ }

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.

[moderate] Regression Prevention and Test Coverage - The persisted-PATH fix has no regression fixture with the triggering leading Homebrew PSHOME entry. A host without that competing entry cannot detect reintroduced selection of raw libexec/pwsh instead of its wrapper, which prevents subsequent PowerShell steps from starting when the selected runtime root lacks its framework. Add isolated cases asserting repository dotnet first, wrapper before PSHOME, preservation of unrelated entries, and no introduced PSHOME entry when it was absent.

# back to an older Xcode when the pinned one is missing; that Xcode has no device types
# for the pinned runtime, so match the selected Xcode's simulator SDK instead.
XCODE_MAJOR_MINOR="$(XCODE)"
SELECTED_SDK_VERSION=$(xcrun --sdk iphonesimulator --show-sdk-version 2>/dev/null)

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.

[moderate] Regression Prevention and Test Coverage - The selected-SDK fallback fix lacks a fixture where requested Xcode 27.1 falls back to simulator SDK 27.0. Review-PR.Tests.ps1 injects MAJOR/MINOR and extracts code starting at RUNTIME_ARCHITECTURE, bypassing this new selection; deleting the branch leaves those fixtures unchanged and permits downloading the incompatible requested runtime again. Add mismatched and matching requested/selected version cases asserting download arguments and the required runtime identifier. SimulatorRuntimeSelectionTests exercises the separate C# selector.

# Agents don't preinstall JDK 21, so this downloads it; the download host has
# intermittent 504 windows that outlast the task-level retry backoff.
- pwsh: |
foreach ($delay in 0, 30, 60, 120) {

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.

[minor] Complexity Reduction - This four-attempt loop remains wrapped in retryCountOnTaskFailure: 4. Persistent JDK provisioning failures therefore trigger up to 20 ProvisionJdk invocations and 1,050 seconds of explicit sleeps, excluding command time and Azure backoff, rather than the existing five-total-attempt setup budget. Use one retry owner: keep the longer delays in one bounded loop and remove the enclosing task retry.

"nuget": {
"name": "Microsoft.Extensions.Configuration",
"version": "10.0.0"
"version": "11.0.0"

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.

[minor] Build & MSBuild - These committed generated registrations record Microsoft.Extensions.Configuration, DependencyInjection and Logging.Debug as 11.0.0, while their central eng/Versions.props values are 11.0.1. Microsoft.Maui.Templates.csproj enables automatic manifest generation; update-cgmanifest.ps1 reads these stable properties directly, so rebuilding rewrites all three entries to 11.0.1. Remove the generated-file delta and leave regeneration to the existing target rather than committing an inventory that disagrees with its producer.

@kubaflo

kubaflo commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@dalexsoto stamp

@kubaflo

This comment has been minimized.

@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.

Expert Review — 11 findings

Reviewed commit c35642b.

See inline comments for details.

Previously reported findings were not duplicated.

value: false
# Tools such as Cake target net10.0; let them run on the repo's .NET 12 preview runtime when
# no .NET 10 runtime is installed (their own roll-forward setting skips prerelease runtimes).
- name: DOTNET_ROLL_FORWARD

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.

[major] Logic and Correctness Verification - DOTNET_ROLL_FORWARD=Major still excludes prerelease runtimes for release-targeted tools. The Windows device stage provisions and prepends the isolated .dotnet root before invoking net10.0 Cake for its unpackaged and packaged builds. src/DotNet/DotNet.csproj deletes and recreates that root with the pinned .NET 12 alpha SDK/runtime, so Cake cannot resolve its framework when no stable runtime exists there; a stable system installation does not populate this root. Enable DOTNET_ROLL_FORWARD_TO_PRERELEASE=1 for these invocations or install a compatible stable runtime into their selected root.

Comment thread eng/pipelines/ci.yml

# The .NET 11 iOS compatibility workload recommends Xcode 27.0.
- name: previousXcodeVersion
type: string

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.

[major] Input and Path Correctness - The unrestricted previousXcodeVersion queue parameter flows through matrix xcodeVersion into XCODE in arcade/stage-integration-tests.yml, then into executable Bash through the unquoted XCODE_MAJOR_MINOR=$(XCODE) macro in common/provision.yml:180 and assignments at lines 202 and 205. Azure substitutes the value before Bash parses it: a value such as 27.0 beta becomes an assignment followed by execution of beta, failing provisioning under set -e rather than rejecting an invalid version. These pinned jobs disable package installation, and version verification occurs after this sink. Pass the value through the task environment and validate a numeric version or explicit allowlist before use.

//This assumes that this is always running from a mac with global workloads
const string DotnetToolPathDefault = "/usr/local/share/dotnet/dotnet";
string DotnetVersion = Argument("targetFrameworkVersion", EnvironmentVariable("TARGET_FRAMEWORK_VERSION") ?? "net11.0");
string DotnetVersion = Argument("targetFrameworkVersion", EnvironmentVariable("TARGET_FRAMEWORK_VERSION") ?? "net12.0");

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.

[moderate] Logic and Correctness Verification - eng/pipelines/device-tests.yml still defaults targetFrameworkVersions to net11.0. For definitions other than maui-pr-devicetests, the jobs/steps templates explicitly pass --targetFrameworkVersion=net11.0, overriding this updated fallback. Android consequently requests -f net11.0-android, but Core and Controls device projects expose only current net12 platform TFMs through MauiDeviceTestsPlatforms. Update the legacy entry point matrix alongside this migration so default runs can build their test bundles.

- catalyst
skipProvisioning: ${{ parameters.skipProvisioning }}

- ${{ if and(containsValue(parameters.selectedPlatforms, 'android'), or(eq(length(parameters.selectedCategories), 0), and(not(contains(join(',', parameters.selectedCategories), ':')), ne(join('', parameters.selectedCategories), 'Material3')), contains(replace(join(',', parameters.selectedCategories), 'android:Material3', ''), 'android:'))) }}:

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.

[moderate] Logic and Correctness Verification - Splitting out the Android build adds an eleventh plain-category guard, but the existing qualified-selection contract in .github/scripts/RunTests.Tests.ps1:645 still asserts exactly ten occurrences. That assertion necessarily fails against this template, independent of selected platforms or categories. Update the contract alongside the split while preserving coverage that platform-qualified selections cannot activate unrelated stages.


<!-- The current SDK pins {{BaseBuildTest.DotNetPrevious}} ILLink to a pre-release whose API does not
match the custom steps used by previous-.NET Apple SDKs for Mono builds (IL1027). -->
<Target Name="_MauiTestPinPreviousILLinkPack" BeforeTargets="ProcessFrameworkReferences">

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.

[moderate] Trimming and AOT Compatibility - This previous-framework ILLink pin is written only to the fixture-root Directory.Build.targets. BaseTemplateTests copies src/Templates/tests/Directory.Build.targets into each generated project directory; that nearer file neither imports the parent nor contains this override. Retained net11 Release SimpleTemplateTest.Build and BuildWithMauiVersion app cases therefore miss the compatibility fix for the documented previous-Apple Mono custom-step API mismatch (IL1027). Put the pin in targets those projects actually import. AppleTemplateTests derives directly from BaseBuildTest and does not have this shadowing problem.

Assert.That(updatedButton.GetText(), Is.EqualTo("B"));
// The cell re-renders after the tap, which can invalidate element references
// (StaleElementReferenceException on Mac Catalyst), so re-query on each attempt.
App.RetryAssert(() =>

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.

[moderate] Logic and Correctness Verification - App.RetryAssert catches exceptions without isolating the NUnit result. These platform test projects use NUnit 4.0.1, where a failed Assert.That records an assertion failure before throwing. If the first poll sees the old text or button count, a later successful poll returns from the helper but leaves that recorded failure behind, so the intended asynchronous retry still fails the test. Poll a non-asserting predicate and assert once after success, use a delayed NUnit constraint, or isolate each assertion attempt.

} elseif ($env:UI_TEST_PLATFORM) {
$buildArguments += "--$env:UI_TEST_PLATFORM"
}
$extraCakeArguments = ConvertFrom-Json -InputObject $env:UI_TEST_CAKE_ARGS -NoEnumerate

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.

[moderate] Regression Prevention and Test Coverage - The argument-array fix and its rejection guards lack a discriminating regression fixture. Current sample-build callers do not supply an option containing spaces, and RunTests.Tests.ps1 checks platform interpolation rather than received arguments, so reintroducing expression parsing or argument splitting would go undetected. Add an isolated stub-build fixture asserting that an option with a space-containing path arrives as one unchanged argument, with accepted empty/single-item string arrays and rejected scalar/non-string inputs.

# back to an older Xcode when the pinned one is missing; that Xcode has no device types
# for the pinned runtime, so match the selected Xcode's simulator SDK instead.
XCODE_MAJOR_MINOR="$(XCODE)"
SELECTED_SDK_VERSION=$(xcrun --sdk iphonesimulator --show-sdk-version 2>/dev/null)

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.

[moderate] Regression Prevention and Test Coverage - The selected-SDK fallback fix lacks a fixture where requested Xcode 27.1 falls back to simulator SDK 27.0. Review-PR.Tests.ps1 injects MAJOR/MINOR and extracts code starting at RUNTIME_ARCHITECTURE, bypassing this selection; deleting the new branch leaves those fixtures unchanged and permits downloading the incompatible requested runtime again. Add mismatched and matching requested/selected version cases asserting download arguments and the required runtime identifier. SimulatorRuntimeSelectionTests exercises the separate C# selector.

# Agents don't preinstall JDK 21, so this downloads it; the download host has
# intermittent 504 windows that outlast the task-level retry backoff.
- pwsh: |
foreach ($delay in 0, 30, 60, 120) {

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.

[minor] Complexity Reduction - This four-attempt loop remains wrapped in retryCountOnTaskFailure: 4. Persistent JDK provisioning failures therefore trigger up to 20 ProvisionJdk invocations and 1,050 seconds of explicit sleeps, excluding command time and Azure backoff, rather than the previous five total attempts. Follow the single-owner pattern in eng/scripts/Install-AndroidSdkPackage.ps1: keep the longer delays in one bounded loop with an explicit total attempt budget and remove the enclosing task retry.

"nuget": {
"name": "Microsoft.Extensions.Configuration",
"version": "10.0.0"
"version": "11.0.0"

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.

[minor] Build & MSBuild - These committed generated registrations record Microsoft.Extensions.Configuration, DependencyInjection and Logging.Debug as 11.0.0, while their central eng/Versions.props values are 11.0.1. The template project automatically regenerates this manifest, and update-cgmanifest.ps1 reads these stable properties directly, so rebuilding rewrites all three entries to 11.0.1. Remove the generated-file delta and leave regeneration to the existing target rather than committing an inventory that disagrees with its producer.

dalexsoto
dalexsoto previously approved these changes Nov 24, 2026

@dalexsoto dalexsoto 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.

Stamping as requested by @kubaflo; no code review performed.

Preserve selected device-test dispatches and Helix filters with separate Android and Apple build stages.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kubaflo

kubaflo commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Resolved the merge conflicts with main in 8260118668. The device-test pipelines retain separate Android and Apple builds and now apply main’s platform, project, and category filters to those stages.

@kubaflo

kubaflo commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

@dalexsoto stamp

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.

🟡 Changes recommended

The roll-forward policy still prevents release-targeted CI tools from using the pinned .NET 12 alpha runtime because prerelease roll-forward is not enabled.

6 open issues

Review effort: Balanced

Comment thread Directory.Build.props

<!-- The .NET 12 Apple SDKs reject apps without a UIApplicationSceneManifest (MT7199); our samples and test apps don't use scenes yet. -->
<PropertyGroup>
<ValidateSceneManifest Condition="'$(ValidateSceneManifest)' == ''">false</ValidateSceneManifest>
@kubaflo

kubaflo commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

/review expert-review

@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.

Expert Review — 10 findings

Reviewed commit 8260118.

Source assessment incomplete (11/12 dimensions); finding count is partial.

See inline comments for details.

1 findings could not be attached inline; retained in run artifacts.

# Tools such as Cake target net10.0; let them run on the repo's .NET 12 preview runtime when
# no .NET 10 runtime is installed (their own roll-forward setting skips prerelease runtimes).
- name: DOTNET_ROLL_FORWARD
value: Major

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.

[major] Logic and Correctness Verification - Major-version roll-forward does not allow release-targeted tools to select prerelease runtimes. The Windows device-test stage provisions and prepends the isolated .dotnet root before invoking net10.0 Cake for unpackaged and packaged builds. src/DotNet/DotNet.csproj recreates that root with the pinned .NET 12 alpha SDK/runtime; a stable system installation does not populate this selected host. With no stable runtime in that root, Cake fails framework resolution before building the apps. Enable DOTNET_ROLL_FORWARD_TO_PRERELEASE=1 for these tool invocations or install a compatible stable runtime into their selected root.

Comment thread eng/pipelines/ci.yml
- ImageOverride -equals 1ESPT-Ubuntu22.04

# The .NET 11 iOS compatibility workload recommends Xcode 27.0.
- name: previousXcodeVersion

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.

[major] Input and Path Correctness - The unrestricted previousXcodeVersion parameter flows through matrix xcodeVersion into XCODE in arcade/stage-integration-tests.yml, then Azure substitutes it into executable Bash at XCODE_MAJOR_MINOR=$(XCODE) in common/provision.yml:180. A value such as 27.0 beta makes Bash attempt to execute beta instead of assigning one version value, failing provisioning under set -e. These pinned jobs disable package installation, and pinned-version verification runs afterward, so neither guards the assignment. Pass the value through the task environment and validate numeric version syntax before selection.

- catalyst
skipProvisioning: ${{ parameters.skipProvisioning }}

- ${{ if and(containsValue(parameters.selectedPlatforms, 'android'), or(eq(length(parameters.selectedCategories), 0), and(not(contains(join(',', parameters.selectedCategories), ':')), ne(join('', parameters.selectedCategories), 'Material3')), contains(replace(join(',', parameters.selectedCategories), 'android:Material3', ''), 'android:'))) }}:

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.

[moderate] Logic and Correctness Verification - Splitting out the Android build adds an eleventh not(contains(join(',', parameters.selectedCategories), ':')) expression, but the qualified-selection contract in .github/scripts/RunTests.Tests.ps1:662 still asserts exactly ten occurrences. That assertion fails against this template independently of platform or category selection. Update the contract alongside the split while retaining checks that platform-qualified selections cannot activate unrelated stages.


<!-- The current SDK pins {{BaseBuildTest.DotNetPrevious}} ILLink to a pre-release whose API does not
match the custom steps used by previous-.NET Apple SDKs for Mono builds (IL1027). -->
<Target Name="_MauiTestPinPreviousILLinkPack" BeforeTargets="ProcessFrameworkReferences">

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.

[moderate] Trimming and AOT Compatibility - The previous-framework ILLink pin is written only to the fixture-root Directory.Build.targets. BaseTemplateTests copies src/Templates/tests/Directory.Build.targets into each generated project directory; that nearer file neither imports the parent nor contains this override. Retained net11 Release SimpleTemplateTest.Build and BuildWithMauiVersion app cases therefore miss the compatibility fix for the documented previous-Apple Mono custom-step API mismatch (IL1027). Put the pin in targets those projects actually import and assert the resolved linker version in both fixture layouts. AppleTemplateTests derives directly from BaseBuildTest and does not have this shadowing problem.

# for the pinned runtime, so match the selected Xcode's simulator SDK instead.
XCODE_MAJOR_MINOR="$(XCODE)"
SELECTED_SDK_VERSION=$(xcrun --sdk iphonesimulator --show-sdk-version 2>/dev/null)
if [[ "$SELECTED_SDK_VERSION" =~ ^([0-9]+)\.([0-9]+) ]]; then

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.

[moderate] Regression Prevention and Test Coverage - The selected-SDK fallback fix has no fixture for requested Xcode 27.1 falling back to simulator SDK 27.0. Review-PR.Tests.ps1 extracts architecture/download selection starting at RUNTIME_ARCHITECTURE and injects MAJOR/MINOR directly, bypassing this new branch. Removing the branch leaves those tests unchanged while provisioning again requests the incompatible 27.1 runtime. Add contrasting mismatched and matching requested/selected SDK fixtures asserting the download version and required runtime identifier. SimulatorRuntimeSelectionTests exercises the separate C# selector, not this branch.

# libexec/pwsh) instead of the agent's entry point, and it fails when
# DOTNET_ROOT lacks its runtime. Keep $PSHOME, but last.
$pathEntries = $env:PATH -split ':' | Where-Object { $_ }
$otherEntries = @($pathEntries | Where-Object { $_.TrimEnd('/') -ne $PSHOME.TrimEnd('/') })

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.

[moderate] Regression Prevention and Test Coverage - The persisted-PATH fix has no regression fixture with the triggering leading Homebrew PSHOME entry. Without that competing entry, reverting to the old PATH construction is indistinguishable, although later steps can again select raw libexec/pwsh instead of the agent launcher and fail runtime resolution. Add isolated transformation cases with PSHOME before the launcher and absent entirely, asserting repository dotnet first, preserved unrelated entry order, and PSHOME moved last only when originally present.

$extraCakeArguments = ConvertFrom-Json -InputObject $env:UI_TEST_CAKE_ARGS -NoEnumerate
if ($extraCakeArguments -isnot [array]) {
throw 'cakeArgs must be an array of individual arguments.'
}

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.

[moderate] Regression Prevention and Test Coverage - The argument-array change and rejection guards have no discriminating fixture. Current sample-build callers leave cakeArgs empty, and RunTests.Tests.ps1 checks platform interpolation rather than received arguments, so neither detects renewed splitting of an option containing a path with spaces. Capture arguments with an isolated stub build.ps1 and assert such an option arrives as one unchanged argument; contrast accepted empty/single-item string arrays with rejected scalar and non-string inputs.

Assert.That(updatedButton.GetText(), Is.EqualTo("B"));
// The cell re-renders after the tap, which can invalidate element references
// (StaleElementReferenceException on Mac Catalyst), so re-query on each attempt.
App.RetryAssert(() =>

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.

[moderate] Async and Threading Safety - If either retry initially observes the old button text or count while the cell re-renders, NUnit 4.0.1 records the failed assertion before throwing. HelperExtensions.RetryAssert catches that exception without isolating or clearing the recorded failure, so a later successful poll still leaves the test failed even when the UI settles within the retry window. Poll a non-asserting predicate or use a delayed NUnit constraint instead.

# Agents don't preinstall JDK 21, so this downloads it; the download host has
# intermittent 504 windows that outlast the task-level retry backoff.
- pwsh: |
foreach ($delay in 0, 30, 60, 120) {

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.

[minor] Complexity Reduction - The four-attempt loop is also wrapped in retryCountOnTaskFailure: 4. A persistent JDK provisioning failure therefore permits 20 ProvisionJdk invocations and 1,050 seconds of explicit sleeps, excluding command time and Azure backoff. Keep the necessary longer backoff under one retry owner and remove the enclosing task retry.

@dalexsoto dalexsoto 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.

Stamping as requested by @kubaflo; no code review performed.

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

Labels

s/agent-gate-failed AI could not verify tests catch the bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants