Skip to content

Add integration tests for third-party toolkit compatibility - #34051

Closed
PureWeen with Copilot wants to merge 8 commits into
mainfrom
copilot/add-integration-test-regression
Closed

PureWeen with Copilot wants to merge 8 commits into
mainfrom
copilot/add-integration-test-regression

Conversation

Copilot AI commented Feb 13, 2026 •

Copy link
Copy Markdown
Contributor

MAUI changes can break compatibility with popular ecosystem packages without being caught by existing tests. This adds integration tests that validate builds with commonly-used third-party toolkits.

Changes

New file: src/TestUtils/src/Microsoft.Maui.IntegrationTests/ToolkitTests.cs

Three test scenarios (6 test cases: Debug + Release each):

  • BuildWithCommunityToolkit - Validates CommunityToolkit.Maui integration
  • BuildWithSyncfusionToolkit - Validates Syncfusion.Maui.Toolkit integration
  • BuildWithMultipleToolkits - Validates both toolkits simultaneously (catches conflicts)

Pattern

Each test:

  1. Creates MAUI app from template
  2. Injects package references into .csproj
  3. Updates MauiProgram.cs with toolkit initialization
  4. Builds with TreatWarningsAsErrors=true

Package versions sourced from eng/Versions.props to stay current with tracked versions.

Example

[Theory]
[InlineData("maui", DotNetCurrent, "Debug")]
[InlineData("maui", DotNetCurrent, "Release")]
public void BuildWithCommunityToolkit(string id, string framework, string config)
{
    // Create template project
    DotnetInternal.New(id, projectDir, framework);
    
    // Add toolkit package
    var version = GetPackageVersion("CommunityToolkitMauiPackageVersion");
    FileUtilities.ReplaceInFile(projectFile, "</Project>",
        $"<ItemGroup><PackageReference Include=\"CommunityToolkit.Maui\" Version=\"{version}\" /></ItemGroup></Project>");
    
    // Update MauiProgram.cs
    FileUtilities.ReplaceInFile(mauiProgramFile, 
        ".UseMauiApp<App>()", 
        ".UseMauiApp<App>().UseMauiCommunityToolkit()");
    
    // Build and verify
    DotnetInternal.Build(projectFile, config, properties: BuildProps, msbuildWarningsAsErrors: true);
}

Part of "Build" test category, runs in standard integration test pipeline.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh pr view 34047 --json title,body,files (http block)
  • https://api.github.com/repos/dotnet/maui/pulls/34047
    • Triggering command: /usr/bin/curl curl -s REDACTED git conf�� Fusion s/AppleTemplateTests.cs de/node/bin/grep red/Core.DeviceTgrep .Benchmarks.cspr-l d/Benchmarks.Drotoolkit\|34047 e.DeviceTests.cs./.github/skills/run-helix-tests/SKILL.md Unit�� amples/Controls.Sample/Pages/Controls/RadioButtonGalleries/RadioButtonContentGallery.xaml.cs .IntegrationTests/SampleTests.cs inks/src/Compatibility.Android.AppLinks.csproj ndroid/Compatibigrep ompatibility.Uni-l inUI/Compatibilitoolkit\|34047 OS/Compatibility./.github/skills/write-xaml-tests/SKILL.md (http block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 14, 2026 00:13
Created ToolkitTests.cs with three test cases:
1. BuildWithCommunityToolkit - Tests MAUI compatibility with CommunityToolkit.Maui
2. BuildWithSyncfusionToolkit - Tests MAUI compatibility with Syncfusion.Maui.Toolkit
3. BuildWithMultipleToolkits - Tests MAUI with both toolkits simultaneously

These tests help catch regressions where MAUI changes break compatibility with popular third-party packages.

Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Added comprehensive documentation explaining:
- Purpose: Catch regressions breaking third-party package compatibility
- Pattern: Similar to SampleTests.cs
- Context: Reference to PR #34047
- Ecosystem impact: Ensures MAUI build system remains compatible with community packages

Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Copilot AI changed the title [WIP] Add integration test similar to SyncFusion toolkit tests Add integration tests for third-party toolkit compatibility Feb 14, 2026
Copilot AI requested a review from PureWeen February 14, 2026 00:17
@kubaflo

kubaflo commented May 24, 2026

Copy link
Copy Markdown
Contributor

@PureWeen what is the status of this PR?

@kubaflo

kubaflo commented May 24, 2026

Copy link
Copy Markdown
Contributor

/review -b feature/refactor-copilot-yml

MauiBot

This comment was marked as outdated.

@MauiBot MauiBot added s/agent-review-incomplete s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels May 24, 2026
@MauiBot

This comment has been minimized.

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

Could you please check the ai's suggestions?

@kubaflo

kubaflo commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

/review -b feature/enhanced-reviewer -p android

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 1 findings

See inline comments for details.

MauiBot

This comment was marked as outdated.

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

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 -- 34051

Or

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

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

kubaflo commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🔍 This is an AI-generated comment posted on @kubaflo's behalf.

Adversarial review found one actionable issue: claude-opus-4.8 noted the Android runtime test registered Syncfusion.Maui.Toolkit but did not instantiate any Syncfusion control, so handler/runtime regressions could still pass. Addressed in f126358 by adding a Syncfusion SfButton to the generated MainPage.xaml before install/run. gpt-5.6-sol raised an explicit-restore concern, but this follows the existing AndroidTemplateTests dotnet build -t:Install pattern; gemini-3.1-pro-preview reported no high-confidence findings.

@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 Jul 13, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 1 findings

See inline comments for details.

@MauiBot MauiBot added s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates and removed s/agent-fix-win AI found a better alternative fix than the PR labels Jul 13, 2026
MauiBot

This comment was marked as outdated.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jul 13, 2026
Copilot AI added 2 commits July 14, 2026 01:32
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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 Jul 13, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 1 findings

See inline comments for details.

MauiBot

This comment was marked as outdated.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jul 14, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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 Jul 14, 2026
@MauiBot MauiBot added s/agent-fix-win AI found a better alternative fix than the PR and removed s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates labels Jul 14, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review Summary

@copilot — new AI review results are available based on this last commit: f860a7a. To request a fresh review after new comments or commits, comment /review rerun.

Gate No Tests Confidence Low Platform Android Requested For Try


🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix

Gate Result: ⚠️ SKIPPED

No tests were detected in this PR.

Recommendation: Add tests to verify the fix using the write-tests-agent.


📋 Pre-Flight — Context & Validation

Issue: N/A - No linked issue detected
PR: #34051 - Add integration tests for third-party toolkit compatibility
Platforms Affected: Android requested for try-fix testing; PR test category is Build plus RunOnAndroid runtime smoke coverage
Files Changed: 1 implementation/test infrastructure, 0 gate-detected tests

Key Findings

  • PR adds src/TestUtils/src/Microsoft.Maui.IntegrationTests/ToolkitTests.cs with third-party toolkit compatibility integration coverage.
  • Current checked-out PR contains build-only tests for CommunityToolkit.Maui, Syncfusion.Maui.Toolkit, and both packages, plus Android install/run smoke tests for CommunityToolkit AvatarView and Syncfusion SfButton.
  • Prior bot review flagged CommunityToolkit/net10 version incompatibility and insufficient runtime coverage; current code appears to address those by using DotNetPrevious for CommunityToolkit and adding Android runtime smoke tests with actual controls.
  • GitHub CLI is unauthenticated; PR metadata and prior comments were gathered through public GitHub API/cached branch state. Required CI remains undetermined/pending.
  • Gate result supplied by caller: ⚠️ SKIPPED — no tests detected in this PR. Gate was not re-run.

Code Review Summary

Verdict: NEEDS_DISCUSSION
Confidence: low
Errors: 0 | Warnings: 0 | Suggestions: 0

Key code review findings:

  • No actionable code findings in the current diff.
  • CI/gate evidence is incomplete, so code-review confidence is capped low.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #34051 Build-only toolkit compatibility tests plus Android runtime smoke tests for CommunityToolkit AvatarView and Syncfusion SfButton ⚠️ SKIPPED (Gate: no tests detected) src/TestUtils/src/Microsoft.Maui.IntegrationTests/ToolkitTests.cs Original/current PR

🔬 Code Review — Deep Analysis

Code Review — PR #34051

Independent Assessment

What this changes: Adds integration tests for MAUI template projects using CommunityToolkit.Maui and Syncfusion.Maui.Toolkit, plus Android install/run smoke coverage with representative controls.

Inferred motivation: Catch third-party ecosystem compatibility regressions in restore/build and Android startup/control instantiation.

Reconciliation with PR Narrative

Author claims: Adds toolkit compatibility integration tests.
Agreement/disagreement: Agrees, though the description understates the current PR: it now also includes Android runtime smoke tests and uses the template Syncfusion version for net10 cases.

Prior Review Reconciliation

Prior ❌ Error Finding Source Status Evidence
CommunityToolkit net10/package incompatibility MauiBot ✅ Fixed CommunityToolkit cases now target DotNetPrevious / net9.0.
Syncfusion Android smoke test used stale Versions.props package MauiBot ✅ Fixed RunSyncfusionToolkitOnAndroid uses GetCurrentTemplateSyncfusionToolkitPackageVersion().
Runtime coverage only covered Syncfusion MauiBot ✅ Fixed RunCommunityToolkitOnAndroid was added with AvatarView.

Blast Radius Assessment

  • Runs for all instances: no — test-only additions.
  • Startup impact: no product startup impact; Android test app startup is intentionally exercised.
  • Static/shared state: no product static state.

CI Status

  • Required-check result: undetermined via gh; public check-runs for head show maui-pr queued/in progress.
  • Classification: undetermined/pending.
  • Action taken: confidence capped low.

Findings

No actionable ❌ Error, ⚠️ Warning, or 💡 Suggestion findings found.

Failure-Mode Probing

  • net10 CommunityToolkit incompatibility: avoided by targeting DotNetPrevious.
  • Android restore with non-Android TFMs: runtime tests call --no-restore, strip non-Android TFMs, then build Android only.
  • Stale Syncfusion net10 coverage: current Syncfusion runtime/build net10 paths use the template package version.

Verdict: NEEDS_DISCUSSION

Confidence: low
Summary: Code changes look sound and prior blocking findings appear addressed. However, required CI could not be verified with authenticated gh, and public checks are still pending, so this cannot be LGTM under the skill rules.


🛠️ Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
1 maui-expert-reviewer Replace isolated Android runtime tests with one combined app registering both CommunityToolkit and Syncfusion and rendering both controls ⚠️ Blocked ToolkitTests.cs Test assembly built; local dotnet new maui failed because MAUI templates are not installed. Higher-risk interaction coverage, but loses separate attribution and current Syncfusion runtime isolation.
2 maui-expert-reviewer Use MAUI template package versions as source of truth for both toolkits and run CommunityToolkit Android on DotNetCurrent ⚠️ Blocked ToolkitTests.cs Test assembly built; local dotnet new maui failed because MAUI templates are not installed. Improves version consistency, but may drop explicit DotNetPrevious CommunityToolkit compatibility coverage.
3 maui-expert-reviewer Teach Detect-TestsInDiff.ps1 to detect MAUI integration test files and emit Run-IntegrationTests entries for Build and RunOnAndroid categories ✅ Passed detection validation .github/scripts/shared/Detect-TestsInDiff.ps1 Directly addresses the supplied gate skip: ToolkitTests.cs is detected as Build + RunOnAndroid integration coverage. Does not alter toolkit runtime test logic.
PR PR #34051 Build-only toolkit tests plus separate Android runtime smoke tests for CommunityToolkit AvatarView and Syncfusion SfButton ⚠️ Gate skipped ToolkitTests.cs Current PR code review found no actionable code issues, but the supplied gate did not detect tests.

Cross-Pollination / Learning

Round Input from Previous Attempts New Idea Result
1 Current PR has isolated toolkit build/runtime coverage Combined Android app with both toolkits to exercise interaction risk Blocked by missing MAUI templates
2 Candidate 1 blocked locally; combined app risks attribution/current-TFM coverage Template-sourced toolkit versions with isolated Android runtime tests Compiled, then blocked by missing MAUI templates
3 Gate skipped because no tests were detected; runtime attempts blocked locally Fix integration-test detection so gate can select Build and RunOnAndroid categories Passed detection validation

Exhausted: Yes for meaningfully different local candidates. Remaining runtime candidates would be trivial variations until the environment has MAUI templates/workloads and an Android emulator.
Selected Fix: Candidate #3 — it is the only candidate with a passing validation in this environment and directly fixes the supplied gate failure mode by making the PR's integration tests discoverable. It is complementary to, not a replacement for, the PR's toolkit test implementation.


📝 Recommended PR Title & Description

Assessment: ✏️ Recommend updating — the current title and description describe only build compatibility tests, but the actual diff also adds Android runtime smoke tests with real CommunityToolkit and Syncfusion controls.

Recommended title

[Integration Tests] Toolkit compatibility: Add build and Android runtime coverage

Recommended description

MAUI changes can break compatibility with popular ecosystem packages without being caught by existing tests. This adds integration tests that validate both build compatibility and Android runtime startup with commonly-used third-party toolkits.

## Changes

**New file:** `src/TestUtils/src/Microsoft.Maui.IntegrationTests/ToolkitTests.cs`

Adds build coverage for three toolkit scenarios:

- **BuildWithCommunityToolkit** - Validates a `DotNetPrevious` MAUI app builds with `CommunityToolkit.Maui`
- **BuildWithSyncfusionToolkit** - Validates a `DotNetCurrent` MAUI app builds with `Syncfusion.Maui.Toolkit`
- **BuildWithMultipleToolkits** - Validates both toolkits simultaneously in a `DotNetPrevious` app to catch package conflicts

Adds Android runtime smoke coverage:

- **RunCommunityToolkitOnAndroid** - Installs and launches an Android MAUI app using `CommunityToolkit.Maui` and an actual `AvatarView`
- **RunSyncfusionToolkitOnAndroid** - Installs and launches an Android MAUI app using `Syncfusion.Maui.Toolkit` and an actual `SfButton`

## Pattern

Each build test:
1. Creates a MAUI app from the template
2. Injects package references into the generated `.csproj`
3. Updates `MauiProgram.cs` with toolkit initialization
4. Builds with `TreatWarningsAsErrors=true`

The Android runtime tests:
1. Create a MAUI app from the template without restore
2. Strip non-Android TFMs so only the Android app is built
3. Add toolkit package references and toolkit initialization
4. Inject a real toolkit control into `MainPage.xaml`
5. Install the Android app and launch it with XHarness

Package versions are selected to match the target framework under test: tracked `eng/Versions.props` versions for `DotNetPrevious` coverage, and the current MAUI template Syncfusion version for `DotNetCurrent` Syncfusion coverage.

Part of the `Build` and `RunOnAndroid` test categories, running through the standard integration test pipeline.

🏁 Report — Final Recommendation

Comparative Report — PR #34051

Candidate ranking

Rank Candidate Result Assessment
1 try-fix-3 ✅ Passed detection validation Best candidate. It directly fixes the supplied gate failure mode by teaching the PR-review detector to recognize integration tests in src/TestUtils/src/Microsoft.Maui.IntegrationTests, producing Run-IntegrationTests entries for both Build and RunOnAndroid.
2 pr-plus-reviewer ⚠️ Gate skipped / CI undetermined Same functional test coverage as the PR plus a sandbox maintainability comment documenting intentional DotNetPrevious version selection. Does not make the tests discoverable to the gate.
3 pr ⚠️ Gate skipped / CI undetermined The toolkit test implementation is directionally sound and has no expert-review correctness errors, but the supplied gate did not detect the tests, so the PR cannot demonstrate regression coverage in the review workflow.
4 try-fix-2 ⚠️ Blocked locally Improves version-source consistency, but validation was blocked at dotnet new maui because MAUI templates are not installed. It also drops explicit DotNetPrevious CommunityToolkit coverage, so it is weaker than the PR for compatibility breadth.
5 try-fix-1 ⚠️ Blocked locally Exercises both toolkits in one Android app, but validation was blocked at template creation. It reduces failure attribution and loses the PR's separate Syncfusion/current-TFM runtime smoke path.

Winning candidate

Winner: try-fix-3

try-fix-3 is the only candidate with a passing validation result and it addresses the concrete blocker supplied by the orchestrator: "Gate ⚠️ SKIPPED — no tests detected in this PR." The raw PR fix and pr-plus-reviewer add reasonable integration coverage, but neither can be preferred while the review gate fails to discover that coverage. The blocked runtime candidates are ranked lower because they did not pass regression validation in this environment.

Notes for applying the winner

try-fix-3 is complementary to the PR's ToolkitTests.cs implementation rather than a replacement for it. Apply the integration-test discovery change so PRs adding Microsoft.Maui.IntegrationTests files produce Run-IntegrationTests work items; keep the PR's toolkit tests, optionally with the small reviewer comment from pr-plus-reviewer.


🧭 Next Steps — alternative fix proposed (try-fix-3)

Automated review — alternative fix proposed

The expert-reviewer evaluation compared the PR fix against automatically generated candidates and selected try-fix-3 as the strongest fix.

Why: try-fix-3 is the only candidate with passing validation and directly fixes the supplied skipped-gate failure by detecting Microsoft.Maui.IntegrationTests files as Run-IntegrationTests work. The PR and pr-plus-reviewer toolkit tests are directionally sound, but they remain lower-ranked because the gate did not discover them.

Please consider applying the candidate diff below (or use it as guidance). Once you push an update, this workflow will re-trigger and re-evaluate.

Candidate diff (try-fix-3)
--- a/.github/scripts/shared/Detect-TestsInDiff.ps1
+++ b/.github/scripts/shared/Detect-TestsInDiff.ps1
@@ -225,6 +225,31 @@
     $baseName = [System.IO.Path]::GetFileNameWithoutExtension($file) -replace '\.(iOS|Android|Windows|MacCatalyst)$', ''
     if ($baseName -in $IgnoredFileNames) { continue }
 
+    if ($file -match '^src/TestUtils/src/Microsoft\.Maui\.IntegrationTests/.+Tests\.cs$') {
+        $fullPath = if ($RepoRootForRead) { Join-Path $RepoRootForRead $file } else { $file }
+        $content = if (Test-Path $fullPath) { Get-Content $fullPath -Raw -ErrorAction SilentlyContinue } else { "" }
+        $categories = [regex]::Matches(
+            $content,
+            '\[Trait\(\s*"Category"\s*,\s*"([^"]+)"\s*\)\]'
+        ) | ForEach-Object { $_.Groups[1].Value } | Select-Object -Unique
+
+        foreach ($category in $categories) {
+            $groupKey = "IntegrationTest:${category}:$file"
+            $testGroups[$groupKey] = @{
+                Type = "IntegrationTest"
+                TestName = "Integration tests ($category)"
+                Filter = "Category=$category"
+                Project = $null
+                ProjectPath = "src/TestUtils/src/Microsoft.Maui.IntegrationTests/Microsoft.Maui.IntegrationTests.csproj"
+                Runner = "Run-IntegrationTests"
+                NeedsPlatform = ($category -in @("RunOnAndroid", "RunOniOS"))
+                Files = @($file)
+            }
+        }
+
+        continue
+    }
+
     foreach ($rule in $TestTypeRules) {
         if ($file -match $rule.PathPattern) {
             $testType = $rule.Type
@@ -474,6 +499,7 @@
         "DeviceTest"   { "📱" }
         "UnitTest"     { "🧪" }
         "XamlUnitTest" { "📄" }
+        "IntegrationTest" { "🧩" }
     }
 
     Write-Host "  $icon $i. [$($test.Type)] $($test.TestName) $platformNote" -ForegroundColor White

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jul 14, 2026

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

🔍 AI-generated review (multi-model pipeline: Opus 4.8 · GPT-5.5 · Gemini 3.1 Pro), on behalf of @kubaflo.

Multi-model review — PR #34051 (draft) · third-party toolkit integration tests

Reviewed src/TestUtils/src/Microsoft.Maui.IntegrationTests/ToolkitTests.cs (+433) at head f860a7ab. Three models reviewed independently; findings below are the cross-pollinated consensus, and I verified the headline issue directly against the current template + FileUtilities.

Independent assessment

New integration coverage that scaffolds a maui template, injects CommunityToolkit.Maui / Syncfusion.Maui.Toolkit (Build category) and runs an Android smoke test per toolkit (RunOnAndroid via XHarness). The intent — catch regressions against widely-used community packages as MAUI ships — is valuable and the structure is sound.

Premises that checked out clean (so they don't get re-raised): both CommunityToolkitMauiPackageVersion and SyncfusionMauiToolkitPackageVersion do exist in eng/Versions.props (so GetPackageVersion won't throw); XHarness.RunAndroid(..., -1, ...) is correct (AndroidTemplateTests.cs:121 does the same); BuildProps => new() returns a fresh list (no shared-state leak); the template's toolkit PackageReferences are behind #if IncludeSampleContent (default false) so there's no duplicate ref; msbuildWarningsAsErrors:true is the house convention for template Build tests.

Findings

❌ Error — xmlns:x anchor was removed from the template on main (#33834); both Android Run tests will throw after rebase/merge

AddCommunityToolkitControl (line 301) and AddSyncfusionToolkitControl (line 355) do:

FileUtilities.ReplaceInFile(mainPageFile,
    "xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"", ...);

FileUtilities.ReplaceInFile throws InvalidOperationException when the anchor is absent (FileUtilities.cs:26-27) — it is not a no-op. Commit 06a19c10 "Enable implicit xmlns declarations by default (#33834)", already merged into base main, removed the xmlns:x declaration from the maui-mobile template. I verified the current template MainPage.xaml on main is now just <ContentPage x:Class="MauiApp._1.MainPage"> — no xmlns:x. The PR branch (f860a7ab) predates #33834 so it passes there, but integration tests run dotnet new maui against the locally-built template, so once this rebases onto main, RunCommunityToolkitOnAndroid and RunSyncfusionToolkitOnAndroid throw at the inject step. (MauiBot's review did not catch this.) Fix: anchor on a string still present — e.g. x:Class="MauiApp._1.MainPage" or the <VerticalStackLayout open tag. The second ReplaceInFile on </VerticalStackLayout> in the same helpers is fine.

⚠️ Warning — Syncfusion version is sourced two different ways; Versions.props values are stale vs. what the template ships

BuildWithSyncfusionToolkit (line 55) and RunSyncfusionToolkitOnAndroid (line 243) read GetCurrentTemplateSyncfusionToolkitPackageVersion() → 1.0.8, but BuildWithMultipleToolkits (line 78) reads GetPackageVersion("SyncfusionMauiToolkitPackageVersion") → 1.0.4, so Syncfusion is exercised at two versions across the suite. Both Versions.props properties (SyncfusionMauiToolkitPackageVersion=1.0.4, CommunityToolkitMauiPackageVersion=11.1.1) are consumed only by update-cgmanifest.ps1, not the build, and are stale vs. the template (Syncfusion 1.0.8 / CommunityToolkit 12.3.0). Net effect: CommunityToolkit is always tested at 11.1.1 and never at the shipping 12.3.0. (Flagged by Opus and Gemini.) Standardize on one source — preferably the template versions.

💡 Suggestion — TFM asymmetry: CommunityToolkit only on DotNetPrevious (net10), Syncfusion only on DotNetCurrent (net11)

Neither toolkit is covered on both TFMs, and regression value is highest against DotNetCurrent, so CommunityToolkit/net11 compatibility is untested. Pinning CommunityToolkit.Maui 11.1.1 (net8/net9 assets) to net10 relies on NuGet nearest-TFM fallback. Confirm the asymmetry is intentional and add a one-line comment explaining the version/TFM pairing; ideally add a DotNetCurrent CommunityToolkit case. (Opus + Gemini.)

💡 Suggestion — stale doc comment

The XML summaries at lines 19 & 63 say "a .NET 9 MAUI app", but the tests target DotNetPrevious = net10.0. Update the comments. (Gemini.)

💡 Suggestion — duplicated helpers (DRY)

RegisterCommunityToolkit, RegisterSyncfusionToolkit, GetCurrentTemplateSyncfusionToolkitPackageVersion (lines 136 & 399), GetPackageVersion, and StripNonAndroidTfms/AddInstrumentation are duplicated across ToolkitTests, AndroidToolkitTests, and AndroidTemplateTests. No functional impact — consider hoisting into BaseBuildTest/a shared utility. (Opus + Gemini.)

ℹ Note — CI network isolation (CFSClean)

Gemini flagged possible nuget.org 401/timeout under CFSClean. This is likely OK, not a blocker: Syncfusion.Maui.Toolkit is already a template dependency (so it restores today), both packages resolve via the dotnet-public dnceng mirror in NuGet.config, and there's precedent for external refs (WindowsTemplateTest.cs:207 uses Microsoft.Identity.Client). Worth confirming in a real CI run before going non-draft.

Model verdicts

Model Verdict
Opus 4.8 NEEDS_CHANGES (found the anchor error)
Gemini 3.1 Pro NEEDS_DISCUSSION (version asymmetry + CFSClean)
GPT-5.5 LGTM (no findings — missed the anchor issue)

Verdict: 🟠 NEEDS_CHANGES — confidence: high

The xmlns:x anchor (lines 301 & 355) is a real, verified post-merge breakage of both Android Run tests and should be fixed before this leaves draft; the Syncfusion version-source inconsistency is the next most important. Everything else is polish. This is a draft, so posting as a comment rather than a blocking request.

ℹ Automated multi-model review (Opus 4.8 · GPT-5.5 · Gemini 3.1 Pro). Advisory — a human maintainer makes the final call.

var mainPageFile = Path.Combine(projectDir, "MainPage.xaml");

FileUtilities.ReplaceInFile(mainPageFile,
"xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"",

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.

🔍 AI-generated inline comment, on behalf of @kubaflo.

❌ This anchor no longer exists in the template on main — both Android Run tests break after rebase.

FileUtilities.ReplaceInFile throws InvalidOperationException when the search string is absent (FileUtilities.cs:26-27), it's not a no-op. Commit 06a19c10 (#33834, "Enable implicit xmlns declarations by default"), already merged into base main, removed xmlns:x from the maui-mobile template — the current MainPage.xaml is now just <ContentPage x:Class="MauiApp._1.MainPage">. This PR branch predates #33834 so it passes here, but integration tests scaffold from the locally-built template, so after rebase RunCommunityToolkitOnAndroid throws at this line.

Fix: anchor on a string still present, e.g. x:Class="MauiApp._1.MainPage" or the <VerticalStackLayout open tag.

⚠️ AddSyncfusionToolkitControl (line 355) has the identical anchor and needs the same fix.

@MauiBot MauiBot closed this Jul 21, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants