Skip to content

[net11.0] Flow merge validation CI fixes - #37036

Merged
PureWeen merged 5 commits into
net11.0from
kubaflo/net11-merge-ci-fixes
Aug 3, 2026
Merged

[net11.0] Flow merge validation CI fixes#37036
PureWeen merged 5 commits into
net11.0from
kubaflo/net11-merge-ci-fixes

Conversation

@kubaflo

@kubaflo kubaflo commented Aug 3, 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!

Description

Flows the remaining CI fixes discovered while validating the automated net11.0 to Preview 7 merge in #36986 back to net11.0.

  • Adds the missing iOS hosting namespace so the TabbedPage device tests compile.
  • Makes Avalonia template tests skip template post-action restore and use a test-specific NuGet configuration. Existing approved feeds remain mapped to all packages; NuGet.org is limited to the external Avalonia* and MicroCom.* dependency families.
  • Serializes DispatcherTests and MainThreadBridgeTests, which both mutate the process-global DispatcherProvider, preventing the Helix race observed in build 1536641.

The modal device-test override fix was removed from this PR after it landed independently in #37030.

These remaining fixes produced a successful aggregate maui-pr run for #36986 in build 1536659.

The source-only version-property merge hardening remains separately tracked by #37019.

Testing

Copilot AI review requested due to automatic review settings August 3, 2026 12:48
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool August 3, 2026 12:48 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Aug 3, 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 -- 37036

Or

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

Copilot AI and others added 5 commits August 3, 2026 14:52
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 37faae15-0e4c-46fd-9bef-f3006c8aaee8
Use a test-specific NuGet configuration that permits only Avalonia.Controls.Maui packages from NuGet.org while retaining the existing approved feeds for the rest of the dependency graph.

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

Copilot-Session: 37faae15-0e4c-46fd-9bef-f3006c8aaee8
Keep NuGet.org restricted by package-source mapping while including the Avalonia transitive dependency graph required by the template build.

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

Copilot-Session: 37faae15-0e4c-46fd-9bef-f3006c8aaee8
Include the non-Avalonia-named MicroCom runtime dependency in the test-only NuGet.org package-source mapping while keeping all other packages on approved feeds.

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

Copilot-Session: 37faae15-0e4c-46fd-9bef-f3006c8aaee8
Prevent the MainThread bridge and dispatcher tests from clearing their shared process-global DispatcherProvider state while another test is running.

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

Copilot-Session: 37faae15-0e4c-46fd-9bef-f3006c8aaee8
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool August 3, 2026 12:52 — with GitHub Actions Inactive
@kubaflo
kubaflo force-pushed the kubaflo/net11-merge-ci-fixes branch from 2bfc50a to 34979f9 Compare August 3, 2026 12:53
@github-actions github-actions Bot added area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions platform/ios labels Aug 3, 2026

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.

Pull request overview

This PR flows merge-validation CI fixes back to net11.0, targeting three areas: (1) integration tests for Avalonia-enabled templates, (2) unit-test stability by disabling parallelization for dispatcher-provider-mutating tests, and (3) device-test compilation fixes via namespace/import cleanup and a restored override hook for modal test setup.

Changes:

  • Updated SimpleTemplateTest to run Avalonia template creation without restore and to generate a restricted NuGet.config with package source mapping for Avalonia*/MicroCom.*.
  • Added a new xUnit collection definition to serialize tests that mutate the process-global DispatcherProvider, and applied it to DispatcherTests and MainThreadBridgeTests.
  • Restored an overridable modal device-test setup hook and fixed iOS device-test using directives ordering/namespace availability.

Reviewed changes

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

Show a summary per file
File Description
src/TestUtils/src/Microsoft.Maui.IntegrationTests/SimpleTemplateTest.cs Adds Avalonia-specific dotnet new/NuGet restore behavior and generates a dedicated NuGet config with source mapping.
src/Core/tests/UnitTests/TestClasses/DispatcherProviderTestCollection.cs Introduces a non-parallel xUnit collection for tests that mutate global dispatcher provider state.
src/Core/tests/UnitTests/Hosting/MainThreadBridgeTests.cs Assigns MainThreadBridgeTests to the non-parallel dispatcher-provider collection.
src/Core/tests/UnitTests/Dispatching/DispatcherTests.cs Assigns DispatcherTests to the non-parallel dispatcher-provider collection.
src/Controls/tests/DeviceTests/Elements/TabbedPage/TabbedPageTests.iOS.cs Restores/normalizes required using directives for iOS device-test compilation.
src/Controls/tests/DeviceTests/Elements/Modal/ModalTests.cs Makes modal test setup overridable again via a protected virtual entry point.

Comment on lines 10 to 14
namespace Microsoft.Maui.UnitTests.Hosting
{
[Category(TestCategory.Core, TestCategory.Hosting)]
[Collection(nameof(DispatcherProviderTestCollection))]
public class MainThreadBridgeTests : IDisposable
Comment on lines 38 to +56
@@ -47,6 +49,12 @@ public void Build(string id, string framework, string config, bool shouldPack, s

var buildProps = BuildProps;

if (usesAvalonia)
{
buildProps.RemoveAll(p => p.StartsWith("RestoreConfigFile=", StringComparison.Ordinal));
buildProps.Add($"RestoreConfigFile={CreateAvaloniaNuGetConfig(projectDir)}");
}
Comment on lines 10 to 14
// Technically these tests are useless because they cannot test shipping code as they are
// none of the platforms. However, they sort of do test the test dispatcher...
[Category(TestCategory.Core, TestCategory.Dispatching)]
[Collection(nameof(DispatcherProviderTestCollection))]
public class DispatcherTests : IDisposable
Copilot AI review requested due to automatic review settings August 3, 2026 12:55
@kubaflo

kubaflo commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

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.

Pull request overview

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

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

Adversarial code review

No high-confidence issues found on the current head.

The dispatcher-provider fix places both test classes that mutate the process-global provider in the same nonparallel xUnit collection. The Avalonia template path skips the template post-action restore, then restores through a generated config that limits NuGet.org to Avalonia* and MicroCom.* while retaining the approved internal feeds for the remaining dependency graph.

Test coverage assessment: Appropriate for these test-infrastructure changes: both global-state-mutating classes are serialized together, the existing Avalonia build theory exercises template creation and build restore, and the iOS change is compile-scoped.

Prior review reconciliation: The earlier namespace-resolution comments are not applicable because C# resolves the collection type from the enclosing parent namespace. The earlier Avalonia restore concern was also rechecked against the current implementation and dependency mapping; no unresolved issue remains.

Methodology: 3 independent reviewers with adversarial consensus + repo domain specialist. Two single-reviewer configuration concerns were disputed and discarded after repository/feed verification.

@PureWeen
PureWeen merged commit af127e8 into net11.0 Aug 3, 2026
126 of 142 checks passed
@PureWeen
PureWeen deleted the kubaflo/net11-merge-ci-fixes branch August 3, 2026 15:17
@github-actions github-actions Bot added this to the .NET 11.0-preview7 milestone Aug 3, 2026
Vignesh-SF3580 pushed a commit to Vignesh-SF3580/maui that referenced this pull request Aug 10, 2026
<!-- Please let the below note in for people that find this PR -->
> [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Description

Flows the remaining CI fixes discovered while validating the automated
`net11.0` to Preview 7 merge in dotnet#36986 back to `net11.0`.

- Adds the missing iOS hosting namespace so the TabbedPage device tests
compile.
- Makes Avalonia template tests skip template post-action restore and
use a test-specific NuGet configuration. Existing approved feeds remain
mapped to all packages; NuGet.org is limited to the external `Avalonia*`
and `MicroCom.*` dependency families.
- Serializes `DispatcherTests` and `MainThreadBridgeTests`, which both
mutate the process-global `DispatcherProvider`, preventing the Helix
race observed in build 1536641.

The modal device-test override fix was removed from this PR after it
landed independently in dotnet#37030.

These remaining fixes produced a successful aggregate `maui-pr` run for
dotnet#36986 in [build
1536659](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1536659).

The source-only version-property merge hardening remains separately
tracked by dotnet#37019.

## Testing

- `Core.UnitTests`: 22 targeted `DispatcherTests` and
`MainThreadBridgeTests` passed on .NET 11 RC1 after rebasing.
- iOS device-test compilation was validated while fixing dotnet#36986.
- Avalonia integration scenarios restored through the restricted
package-source mapping in successful `maui-pr` build 1536659.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Vally Fixture <vally-fixture@example.invalid>
Copilot-Session: 37faae15-0e4c-46fd-9bef-f3006c8aaee8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions platform/ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants