Repository navigation
Use MAUI line info in compiled XAML - #38625
simonrozsival wants to merge 2 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Use a MAUI-owned line-info abstraction for source-generated and XamlC service providers while retaining runtime XML adapters and legacy API compatibility. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2199465 to
32f5536
Compare
Use the sealed XamlLineInfo value directly as the generated and runtime service instead of introducing a separate interface. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
|
|
||
| writer.WriteLine($"{serviceProviderVariableName}.Add(typeof(global::Microsoft.Maui.Controls.Xaml.XamlLineInfo), new global::Microsoft.Maui.Controls.Xaml.XamlLineInfo({xmlLineInfo.LineNumber}, {xmlLineInfo.LinePosition}));"); | ||
| } | ||
| if (node is IXmlLineInfo legacyXmlLineInfo |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
IXmlLineInfoProvider compatibility is now gated behind !createAllServices, so compiled XAML markup extensions without [RequireService(typeof(IXmlLineInfoProvider))] no longer receive that service even though runtime loader still provides it. Concrete scenario: an existing custom markup extension compiled via SourceGen/XamlC calls serviceProvider.GetService(typeof(IXmlLineInfoProvider)) (without RequireService) and now gets null only in compiled paths, creating runtime/SourceGen/XamlC service-provider parity break. The same restriction appears in Build.Tasks/NodeILExtensions.cs for XamlC emission.
This comment has been minimized.
This comment has been minimized.
|
Note 🔍
|
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
| writer.WriteLine($"{serviceProviderVariableName}.Add(typeof(global::Microsoft.Maui.Controls.Xaml.XamlLineInfo), new global::Microsoft.Maui.Controls.Xaml.XamlLineInfo({xmlLineInfo.LineNumber}, {xmlLineInfo.LinePosition}));"); | ||
| } | ||
| if (node is IXmlLineInfo legacyXmlLineInfo | ||
| && !createAllServices |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
[major] XAML & Bindings — Legacy IXmlLineInfoProvider compatibility is now gated behind !createAllServices, so compiled paths can omit this service for existing markup extensions that call GetService(typeof(IXmlLineInfoProvider)) without declaring [RequireService]. Concrete failure: SourceGen/XamlC service-provider parity regresses versus runtime loader for those extensions. Same gating pattern is also present in src/Controls/src/Build.Tasks/NodeILExtensions.cs.
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@simonrozsival — new AI review results are available based on commit
64c52fd.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ✅ PASSED
Platform: ANDROID · Base: main · Merge base: 49b62062
✅ Verified (new API / feature) — this PR adds new API and a test that references it in the same project, so reverting the fix un-compiles the test: there is no valid "fails without the fix" baseline to establish (a compile-coupled baseline). The gate instead verified the fix by a clean build + pass with the fix, so this is a real PASS rather than a non-committal INCONCLUSIVE.
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
🧪 SimpleValueTargetProviderTests SimpleValueTargetProviderTests |
✅ FAIL — 98s | ✅ PASS — 73s |
🧪 SourceGenXamlCodeBehindTests SourceGenXamlCodeBehindTests |
✅ FAIL — 18s | ✅ PASS — 16s |
🧪 StaticResourceInMarkup StaticResourceInMarkup |
✅ FAIL — 15s | ✅ PASS — 16s |
📄 LoaderTests LoaderTests |
🛠️ BUILD ERROR | ✅ PASS — 76s |
📄 Tests Tests |
🛠️ BUILD ERROR | ✅ PASS — 173s |
🔴 Without fix — 🧪 SimpleValueTargetProviderTests: FAIL ✅ · 98s
Error-relevant lines (filtered from the build log):
at Microsoft.Maui.Controls.SourceGen.UnitTests.SimpleValueTargetProviderTests.SimpleValueTargetProvider_NonBindableProperty_WorksCorrectly() in /_/src/Controls/tests/SourceGen.UnitTests/InitializeComponent/SimpleValueTargetProviderTests.cs:line 315
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
at Microsoft.Maui.Controls.SourceGen.UnitTests.SimpleValueTargetProviderTests.SimpleValueTargetProvider_BindableProperty_MissingGlobalPrefix() in /_/src/Controls/tests/SourceGen.UnitTests/InitializeComponent/SimpleValueTargetProviderTests.cs:line 158
🟢 With fix — 🧪 SimpleValueTargetProviderTests: PASS ✅ · 73s
Determining projects to restore...
All projects are up-to-date for restore.
Test run for /home/vsts/work/1/s/artifacts/bin/SourceGen.UnitTests/Debug/net10.0/Microsoft.Maui.Controls.SourceGen.UnitTests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.2 (x64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.13)
[xUnit.net 00:00:00.13] Discovering: Microsoft.Maui.Controls.SourceGen.UnitTests
[xUnit.net 00:00:00.23] Discovered: Microsoft.Maui.Controls.SourceGen.UnitTests
[xUnit.net 00:00:00.23] Starting: Microsoft.Maui.Controls.SourceGen.UnitTests
[xUnit.net 00:00:02.35] Finished: Microsoft.Maui.Controls.SourceGen.UnitTests
Passed Microsoft.Maui.Controls.SourceGen.UnitTests.SimpleValueTargetProviderTests.SimpleValueTargetProvider_NonBindableProperty_WorksCorrectly [2 s]
Passed Microsoft.Maui.Controls.SourceGen.UnitTests.SimpleValueTargetProviderTests.SimpleValueTargetProvider_BindableProperty_MissingGlobalPrefix [37 ms]
Test Run Successful.
Total tests: 2
Passed: 2
Total time: 3.0665 Seconds
🔴 Without fix — 🧪 SourceGenXamlCodeBehindTests: FAIL ✅ · 18s
Error-relevant lines (filtered from the build log):
[xUnit.net 00:00:05.48] (16,66): error CS0246: The type or namespace name 'XamlLineInfo' could not be found (are you missing a using directive or an assembly reference?)
[xUnit.net 00:00:05.48] (16,19): error CS0246: The type or namespace name 'XamlLineInfo' could not be found (are you missing a using directive or an assembly reference?)
(16,66): error CS0246: The type or namespace name 'XamlLineInfo' could not be found (are you missing a using directive or an assembly reference?)
(16,19): error CS0246: The type or namespace name 'XamlLineInfo' could not be found (are you missing a using directive or an assembly reference?)
at Microsoft.Maui.Controls.Xaml.UnitTests.SourceGen.SourceGenXamlCodeBehindTests.GeneratedLineInfoDoesNotReferenceSystemXmlReaderWriter() in /_/src/Controls/tests/SourceGen.UnitTests/SourceGenXamlCodeBehindTests.cs:line 87
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
🟢 With fix — 🧪 SourceGenXamlCodeBehindTests: PASS ✅ · 16s
(no coded error found; showing last 1200 chars)
XamlCodeBehindTests.TestCodeBehindGenerator_DuplicateNames [75 ms]
[xUnit.net 00:00:05.56] Finished: Microsoft.Maui.Controls.SourceGen.UnitTests
Passed Microsoft.Maui.Controls.Xaml.UnitTests.SourceGen.SourceGenXamlCodeBehindTests.TestCodeBehindGenerator_GlobalNamespace [53 ms]
Passed Microsoft.Maui.Controls.Xaml.UnitTests.SourceGen.SourceGenXamlCodeBehindTests.TestCodeBehindGenerator_ImplementationChangeDoesNotTriggerRegeneration [41 ms]
Passed Microsoft.Maui.Controls.Xaml.UnitTests.SourceGen.SourceGenXamlCodeBehindTests.TestCodeBehindGenerator_NotXaml [15 ms]
Passed Microsoft.Maui.Controls.Xaml.UnitTests.SourceGen.SourceGenXamlCodeBehindTests.TestCodeBehindGenerator_ModifiedXaml [41 ms]
Passed Microsoft.Maui.Controls.Xaml.UnitTests.SourceGen.SourceGenXamlCodeBehindTests.TestCodeBehindGenerator_OnPlatform_Android [65 ms]
Passed Microsoft.Maui.Controls.Xaml.UnitTests.SourceGen.SourceGenXamlCodeBehindTests.TestCodeBehindGenerator_InternalsVisibleTo [64 ms]
Passed Microsoft.Maui.Controls.Xaml.UnitTests.SourceGen.SourceGenXamlCodeBehindTests.TestCodeBehindGenerator_ReferenceAdded [39 ms]
Test Run Successful.
Total tests: 18
Passed: 18
Total time: 6.5453 Seconds
🔴 Without fix — 🧪 StaticResourceInMarkup: FAIL ✅ · 15s
Error-relevant lines (filtered from the build log):
at Microsoft.Maui.Controls.SourceGen.UnitTests.StaticResourceInMarkup.ColorResourceAsStaticResourceInMarkupExtension_ShouldNotProduceCS0030Error() in /_/src/Controls/tests/SourceGen.UnitTests/StaticResourceInMarkup.cs:line 186
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
🟢 With fix — 🧪 StaticResourceInMarkup: PASS ✅ · 16s
Determining projects to restore...
All projects are up-to-date for restore.
Test run for /home/vsts/work/1/s/artifacts/bin/SourceGen.UnitTests/Debug/net10.0/Microsoft.Maui.Controls.SourceGen.UnitTests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.2 (x64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.13)
[xUnit.net 00:00:00.13] Discovering: Microsoft.Maui.Controls.SourceGen.UnitTests
[xUnit.net 00:00:00.27] Discovered: Microsoft.Maui.Controls.SourceGen.UnitTests
[xUnit.net 00:00:00.28] Starting: Microsoft.Maui.Controls.SourceGen.UnitTests
[xUnit.net 00:00:04.80] Finished: Microsoft.Maui.Controls.SourceGen.UnitTests
Passed Microsoft.Maui.Controls.SourceGen.UnitTests.StaticResourceInMarkup.ColorResourceAsStaticResourceInMarkupExtension_ShouldNotProduceCS0030Error [4 s]
Test Run Successful.
Total tests: 1
Passed: 1
Total time: 5.9747 Seconds
🔴 Without fix — 📄 LoaderTests: 🛠️ BUILD ERROR · 55s
Error-relevant lines (filtered from the build log):
/home/vsts/work/1/s/src/Controls/tests/Xaml.UnitTests/ServiceProviderTests.xaml.cs(46,25): error CS0246: The type or namespace name 'XamlLineInfo' could not be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj]
🟢 With fix — 📄 LoaderTests: PASS ✅ · 76s
(no coded error found; showing last 1200 chars)
arseEnum [< 1 ms]
Passed AddChildrenToCollectionContentProperty [< 1 ms]
Passed UseResourcesOutsideOfBinding [3 ms]
Passed TestBindingPath [20 ms]
Passed TestUnknownType [1 ms]
Passed TestSetValueToBindableProperty [< 1 ms]
Passed TestBindOnAttachedBP [2 ms]
Passed TestAttachedBP [< 1 ms]
Passed TestSetBindingToBindableProperty [< 1 ms]
Passed ThrowOnMissingXamlResource [26 ms]
Passed TestRootName [< 1 ms]
Passed TestBoolValue [1 ms]
Passed TestAttachedBPWithDifferentNS [< 1 ms]
Passed TestCollectionContentPropertiesWithSingleElement [1 ms]
Passed TestFailingEvent [< 1 ms]
Passed TestResourceDoesRequireKey [< 1 ms]
Passed RuntimeLoaderPreservesLineInformation [< 1 ms]
Passed TestFindByXName [< 1 ms]
Passed TestBindingModeAndConverter [9 ms]
Passed TestEventWithCustomEventArgs [< 1 ms]
Passed TestEmptyTemplate [1 ms]
[xUnit.net 00:00:03.97] Finished: Microsoft.Maui.Controls.Xaml.UnitTests
Passed TestResources [1 ms]
Passed TestSetBindingToNonBindablePropertyShouldThrow [2 ms]
Passed CreateNewChildrenCollection [1 ms]
Passed FindResourceByName [< 1 ms]
Test Run Successful.
Total tests: 40
Passed: 40
Total time: 4.5610 Seconds
🔴 Without fix — 📄 Tests: 🛠️ BUILD ERROR · 33s
Error-relevant lines (filtered from the build log):
/home/vsts/work/1/s/src/Controls/tests/Xaml.UnitTests/ServiceProviderTests.xaml.cs(46,25): error CS0246: The type or namespace name 'XamlLineInfo' could not be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj]
🟢 With fix — 📄 Tests: PASS ✅ · 173s
(no coded error found; showing last 1200 chars)
sMeaningfullException(inflator: SourceGen) [7 ms]
Passed xStaticThrowsMeaningfullException(inflator: XamlC) [227 ms]
Passed xStaticThrowsMeaningfullException(inflator: Runtime) [2 ms]
Passed DynamicResourceOnBO(inflator: XamlC) [1 ms]
Passed DynamicResourceOnBO(inflator: SourceGen) [3 ms]
Passed DynamicResourceOnBO(inflator: Runtime) [8 ms]
Passed VerifyCorrectTypesUsed(inflator: SourceGen) [3 ms]
Passed VerifyCorrectTypesUsed(inflator: Runtime) [5 ms]
Passed VerifyCorrectTypesUsed(inflator: XamlC) [234 ms]
Passed VerifyCorrectTypesUsed(inflator: SourceGen) [2 ms]
Passed VerifyCorrectTypesUsed(inflator: XamlC) [273 ms]
Passed VerifyCorrectTypesUsed(inflator: Runtime) [4 ms]
[xUnit.net 00:02:37.29] Finished: Microsoft.Maui.Controls.Xaml.UnitTests
Passed VerifyCorrectTypesUsed(inflator: SourceGen) [2 ms]
Passed VerifyCorrectTypesUsed(inflator: XamlC) [296 ms]
Passed VerifyCorrectTypesUsed(inflator: Runtime) [7 ms]
Passed ShouldPass(inflator: SourceGen) [< 1 ms]
Passed ShouldPass(inflator: XamlC) [< 1 ms]
Passed ShouldPass(inflator: Runtime) [1 ms]
Test Run Successful.
Total tests: 2021
Passed: 2013
Skipped: 8
Total time: 2.6359 Minutes
⚠️ Failure Details
- 🛠️ LoaderTests without fix: build failed before tests could run
/home/vsts/work/1/s/src/Controls/tests/Xaml.UnitTests/ServiceProviderTests.xaml.cs(46,25): error CS0246: The type or namespace name 'XamlLineInfo' could not be found (are you missing a using directive...
- 🛠️ Tests without fix: build failed before tests could run
/home/vsts/work/1/s/src/Controls/tests/Xaml.UnitTests/ServiceProviderTests.xaml.cs(46,25): error CS0246: The type or namespace name 'XamlLineInfo' could not be found (are you missing a using directive...
📁 Fix files reverted (28 files)
src/Controls/src/Build.Tasks/ExpandMarkupsVisitor.cssrc/Controls/src/Build.Tasks/NodeILExtensions.cssrc/Controls/src/Core/BindablePropertyConverter.cssrc/Controls/src/Core/Interactivity/PropertyCondition.cssrc/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txtsrc/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txtsrc/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txtsrc/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txtsrc/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txtsrc/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txtsrc/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txtsrc/Controls/src/Core/Setter.cssrc/Controls/src/Core/Xaml/ValueConverterProvider.cssrc/Controls/src/Core/XamlParseException.cssrc/Controls/src/SourceGen/Controls.SourceGen.csprojsrc/Controls/src/SourceGen/ServiceProviderExtensions.cssrc/Controls/src/SourceGen/Visitors/ExpandMarkupsVisitor.cssrc/Controls/src/Xaml/ExpandMarkupsVisitor.cssrc/Controls/src/Xaml/MarkupExtensions/AppThemeBindingExtension.cssrc/Controls/src/Xaml/MarkupExtensions/DataTemplateExtension.cssrc/Controls/src/Xaml/MarkupExtensions/DynamicResourceExtension.cssrc/Controls/src/Xaml/MarkupExtensions/OnIdiomExtension.cssrc/Controls/src/Xaml/MarkupExtensions/OnPlatformExtension.cssrc/Controls/src/Xaml/MarkupExtensions/StaticResourceExtension.cssrc/Controls/src/Xaml/MarkupExtensions/StyleSheetExtension.cssrc/Controls/src/Xaml/MarkupExtensions/TypeExtension.cssrc/Controls/src/Xaml/XamlLoader.cssrc/Controls/src/Xaml/XamlServiceProvider.cs
New files (not reverted):
src/Controls/src/Core/XamlLineInfo.cssrc/Controls/src/Xaml/XamlLineInfoExtensions.cs
📋 Pre-Flight — Context & Validation
PR #38625 Pre-Flight
Context
- Title: Use MAUI line info in compiled XAML
- State: Open draft PR targeting
main - Local review ref:
pr-review-38625at783fa54db1(origin/mainmerge base49b6206253) - Platform: Android
- Gate: PASSED. The gate already verified that the detected tests fail/build-fail without the fix and pass with it; do not rerun gate verification.
- Regression cross-reference: No overlap with recently labeled bug-fix PRs was detected.
Problem
Source-generated and XamlC InitializeComponent methods currently emit XmlLineInfoProvider(System.Xml.IXmlLineInfo), which gives otherwise compiled XAML applications a direct System.Xml.ReaderWriter assembly reference. The fix must remove that generated-app reference while preserving line/position diagnostics and compatibility for extensions that explicitly request IXmlLineInfoProvider.
Existing PR approach
The PR adds public sealed Microsoft.Maui.Controls.Xaml.XamlLineInfo, emits that MAUI-owned concrete service from SourceGen and XamlC, maps runtime XML-reader information into it, and adapts back to IXmlLineInfo inside the XAML assembly when compatibility APIs need it. It updates markup extensions and exception construction to consume the new service, retains explicit legacy-provider generation, and adds public API entries.
The diff contains 36 files (354 additions, 67 deletions), centered on:
src/Controls/src/Core/XamlLineInfo.cssrc/Controls/src/Core/XamlParseException.cssrc/Controls/src/Build.Tasks/NodeILExtensions.cssrc/Controls/src/SourceGen/ServiceProviderExtensions.cssrc/Controls/src/Xaml/XamlServiceProvider.cs- line-info consumers under
src/Controls/src/{Core,Xaml,Build.Tasks,SourceGen} - PublicAPI files for every Controls target
- targeted SourceGen and XAML unit tests
Known concern
A prior inline review identified a concrete compatibility risk: both compiled emitters gate legacy IXmlLineInfoProvider behind !createAllServices. Existing custom markup extensions that query that service without declaring [RequireService] can therefore receive it at runtime but not in compiled SourceGen/XamlC paths. Any candidate should either preserve service-provider parity without rooting System.Xml.ReaderWriter in normal generated apps or explicitly explain why that compatibility cannot coexist with the size/reference requirement.
Allowed targeted tests
Do not run the gate or any full suite. One candidate test pass (and at most one focused correction/retest) may run only these narrow tests:
dotnet test src/Controls/tests/SourceGen.UnitTests/Controls.SourceGen.UnitTests.csproj --filter "FullyQualifiedName~GeneratedLineInfoDoesNotReferenceSystemXmlReaderWriter|FullyQualifiedName~LegacyXmlLineInfoServiceStillGeneratesCompatibilityProvider|FullyQualifiedName~SimpleValueTargetProviderTests|FullyQualifiedName~StaticResourceInMarkup"
dotnet test src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj --filter "FullyQualifiedName~RuntimeLoaderPreservesLineInformation|FullyQualifiedName~ServiceProviderTests"The primary behavioral requirement is covered by GeneratedLineInfoDoesNotReferenceSystemXmlReaderWriter. The remaining named filters are mandatory regressions for explicit legacy compatibility, generated-service output, runtime diagnostics, and existing SourceGen output.
Execution boundaries
- Produce at most two candidates, sequentially.
- Each attempt must invoke
try-fixonce, perform one implementation/test pass and at most one focused correction/retest, persist all required attempt artifacts, and restore only withpwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore. - The baseline-state allow-list is authoritative. If
.github/.baseline-state.jsonis absent or itsNewFilesarray is non-empty, mark the candidateBlockedbefore editing and still restore. - Do not modify or overwrite
gate/content.md. - Do not spawn a separate expert-review agent; use the skill's inline self-review only.
🔬 Code Review — Deep Analysis
Expert PR Evaluation (Initial)
Code-only assessment (independence-first)
- The change introduces a MAUI-owned
XamlLineInfotype and rewires compiled XAML (SourceGen + XamlC) and runtime parser paths to prefer this service overIXmlLineInfoProviderto avoid rootingSystem.Xml.ReaderWriterin generated app assemblies. XamlParseExceptionnow stores/returnsXamlLineInfoand adapts back toIXmlLineInfoonly whenXmlInfois requested.- Markup extensions and converters were updated to request
XamlLineInfothroughIServiceProvider. - Tests were added for:
- no
System.Xml.ReaderWriterassembly reference in generated output, - compatibility generation when
[RequireService(typeof(IXmlLineInfoProvider))]is explicitly declared, - runtime line info preservation.
- no
Findings
- 1 actionable inline finding written (see
inline-findings.json):- Legacy compatibility regression risk from gating
IXmlLineInfoProviderregistration behind!createAllServicesin compiled emitters (SourceGen/ServiceProviderExtensions.cs, mirrored inBuild.Tasks/NodeILExtensions.cs).
- Legacy compatibility regression risk from gating
Verdict / confidence
- Verdict: NEEDS_CHANGES
- Confidence: low
Rationale:
- A concrete compatibility failure mode remains for existing markup extensions that query
IXmlLineInfoProviderwithout declaring[RequireService]: runtime path still provides it, compiled paths can now omit it. - Prior review already flagged the same issue and current diff still contains the restrictive guard.
- CI required-check state could not be authoritatively established via
gh pr checks --requiredin this environment (unauthenticated CLI), so confidence remains capped low.
Evidence checked
- Authoritative local diff vs merge-base
origin/main(49b62062536b4a2b957d965f76035eb56806615c). - Full contents of all 36 changed files reviewed.
- Regression artifact pack:
pre-flight/content.mdregression-check/content.md,regression-check/risks.json,regression-check/result.txt(CLEAN).
- PR narrative/review surfaces retrieved anonymously via GitHub REST:
- pull metadata
- reviews
- inline comments
- issue comments
- Prior inline ❌/
⚠️ finding from MauiBot on this exact compatibility risk remains applicable.
Actionable refinement
- Preserve no-
System.Xml.ReaderWritergoal for normal generated apps and restore service-provider parity by ensuring compiled paths still provideIXmlLineInfoProviderfor legacy consumers that do not declare[RequireService](or provide an equivalent compatibility path with explicit behavioral justification and migration guidance).
🛠️ Try-Fix — Analysis & Comparison
STEP 5a Try-Fix Aggregate
Candidate 1 — gpt-5.3-codex
- Result: Blocked
- Approach: No implementation approach was executed; the child rejected the artifact-writing requirements before invoking
try-fix. - Prior approach avoided: No candidate was produced, so the PR's public
XamlLineInfoservice mechanism was not repeated or evaluated. - Mechanism-level difference: None.
- Files changed: None.
- Tests: Not run.
- Self-review: Not run (
findings_count: 0). - Diff: Empty.
- Failure analysis: The child executor refused the skill's mandatory persistent artifact workflow. It stopped before baseline establishment, code modification, testing, or restoration. The worktree was not changed by the attempt.
Full narrative: CustomAgentLogsTmp/PRState/38625/PRAgent/try-fix-1/content.md.
Candidate 2 — Baseline safety boundary
- Result: Blocked
- Approach: No alternative mechanism was designed or implemented. Baseline establishment reported two PR-added production files in
.github/.baseline-state.jsonNewFiles, so the mandatory safety boundary stopped Candidate 2 before editing. - Prior approach avoided: The PR's public sealed
XamlLineInfoservice, generated concrete-service emission, in-assembly XML adaptation, and explicit-RequireServicelegacy-provider emission were not repeated or merely relocated. Candidate 1 supplied only executor-blocker evidence and no mechanism, code, or tests, so there was no Candidate 1 approach to repeat. - Mechanism-level difference: None was produced; Candidate 2 stopped at the baseline safety gate rather than claiming an untested alternative. It provides no mechanism-level evidence regarding runtime/compiled
IXmlLineInfoProviderparity. - Files changed: None.
- Tests: Not run. The two exact allowed targeted commands were recorded in Candidate 2's narrative and
attempt-1/test-output.log; the already-passed gate was not rerun. - Self-review: Performed inline against the empty candidate diff; 0 findings (
findings_count: 0). - Diff: Explicitly empty.
- Failure analysis: Baseline establishment reverted 28 tracked files but identified
src/Controls/src/Core/XamlLineInfo.csandsrc/Controls/src/Xaml/XamlLineInfoExtensions.csasNewFiles. The workflow forbids editing in that state because added production files are not safely restorable. This is a baseline-safety blocker, not a failed alternative mechanism. - Artifacts:
CustomAgentLogsTmp/PRState/38625/PRAgent/try-fix/attempt-1/ - Restore: Step 9 ran exactly
pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restoreand completed withRestored: True.
Full narrative: CustomAgentLogsTmp/PRState/38625/PRAgent/try-fix-2/content.md.
- Summary verification: Candidate 2 narrative exists at the path above; Candidate 1 remains preserved.
🏁 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Winner: pr — the raw submitted PR is the only implemented candidate with passing regression evidence, but it is not ready for approval because the expert reviewer found an unresolved compiled/runtime compatibility regression.
Comparative ranking
| Rank | Candidate | Implementation | Regression evidence | Expert/correctness assessment |
|---|---|---|---|---|
| 1 | pr |
Complete MAUI-owned XamlLineInfo implementation across Runtime, XamlC, and SourceGen. |
PASS. Trusted Gate passed: tests fail/build-fail without the change and pass with it; regression cross-reference is CLEAN. | NEEDS_CHANGES. Unattributed legacy extensions that previously obtained IXmlLineInfoProvider from the compiled createAllServices path now receive no service, while Runtime still supplies it. |
| 2 | pr-plus-reviewer |
Adds a compatibility helper in the XAML assembly, emits it only for createAllServices, and adds a three-inflator regression fixture. |
FAIL/BLOCKED. Diff check passed, but the required XAML command failed at build with candidate-induced XC0103; the exact SourceGen command targeted a nonexistent project path; the required build-task rebuild was blocked by missing assets and .NET Framework 4.7.2 references. |
Better addresses the expert finding in principle, but cannot outrank a passing candidate because no candidate tests executed and trim/size preservation remains unverified. |
| 3 | try-fix-2 |
None; stopped at the baseline safety boundary because two PR-added production files appeared in NewFiles. |
BLOCKED. No tests run and diff is empty. | Provides no alternative mechanism or evidence. |
| 4 | try-fix-1 |
None; executor refused the required artifact workflow before invoking try-fix. |
BLOCKED. No tests or self-review run and diff is empty. | Provides no alternative mechanism or evidence. |
Why pr wins but still requires changes
The raw PR successfully removes the generated-app System.Xml.ReaderWriter reference, preserves line diagnostics through XamlLineInfo, retains explicit [RequireService(typeof(IXmlLineInfoProvider))] compatibility, and is the only candidate backed by passing tests. Both STEP 5a candidates are empty and blocked. The reviewer-enhanced candidate must rank below the raw PR because its candidate-induced XAML compile failure prevented the required regression tests from running.
The winning candidate is nevertheless not approvable. Before this PR, unattributed extensions used createAllServices, which included IXmlLineInfoProvider; the submitted emitters now deliberately exclude that service for the same path. The expert review and an existing prior inline review both identify this concrete behavior change. The PR should either preserve that compatibility without re-rooting XML for normal attributed compiled XAML, or explicitly establish and validate the unattributed path as an intentional breaking contract change. No reviewed candidate currently proves both compatibility and the Android size objective.
Evidence and constraints
- Gate: ✅ PASSED; not rerun.
- Regression cross-reference: CLEAN.
- Expert inline findings: one major finding in
inline-findings.json. - Expert verdict:
NEEDS_CHANGES, confidence low because required CI status was unavailable. pr-plus-reviewerreceived exactly one consolidated patch and each prescribed validation command was invoked once; no repair/retest loop or full suite was run.- Complete candidate artifacts are under
pr-plus-reviewer/, includingreviewer.patch,candidate.patch, focused logs, andcontent.md.
📱 UI Tests — Button,Label,Layout
Detected UI test categories: Button,Label,Layout
✅ Deep UI tests — 422 passed, 0 failed, 7 skipped across 3 categories on platform-pool agent (replaces in-process counts above).
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
Button |
104/106 (2 skipped) ✓ | — |
Label |
123/125 (2 skipped) ✓ | — |
Layout |
195/198 (3 skipped) ✓ | — |
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs) |
🧭 Next Steps — review latest findings
No alternative fix was selected for this run. Review the session findings and CI results before merging.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@simonrozsival, is this draft PR ready for review? If it still needs work, please leave it as a draft; otherwise, please mark it ready for review. |
|
Note 🔍
|
This comment has been minimized.
This comment has been minimized.
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Description of Change <!-- Enter description of the fix in this section --> Add `/review gate` as an explicit existing-test-only mode without replacing or shortening the existing hosted `/review` process. Bare `/review`, its platform/branch options, and dispatches that omit the new flag continue to select the full review. `/review tests` and `/review performance` remain independent. The gate retains the existing selected unit, XAML, device, and UI verifier, including failure-only verification for test-only changes, bounded native selection, retry handling, and skipped/inconclusive outcomes. It does not generate missing tests or run expert code review, Try-Fix, deep-category UI sweeps, or Copilot inference. These exclusions apply only to gate mode; hosted `/review` and local full-review tools retain their existing phases. Publish a commit-pinned, bounded report with a closed **Gate analysis** section. The original expandable layout from #38807 is refined to match [the user-selected test-failure-analysis comment](#37572 (comment)): an author/commit quote, flat-square result/platform/commit badges, and readable result tables grouped by test type. At the user's request, omit the Scope badge/text, Follow-up accordion, and report/artifact-link footer. Only recognized diagnostic fields are rendered; raw execution-log excerpts remain escaped in their own collapsed section rather than displaying a raw Markdown document. Posting runs on a fresh agent and only maintains gate signals and publisher-owned gate comments; it does not approve PRs or edit their titles/descriptions. The trigger and scheduled recovery recognize both commands and preserve the selected mode after permission and source-comment revalidation. Previously removed existing full-review coverage is restored unchanged; no new pipeline/configuration tests are added. Live validation exposed two selection defects: a closed nested Picker helper was mistaken for its test fixture, and a nested XAML `Test` fixture became an assembly-wide filter. Resolve containing class scopes using the existing C# declaration scanner, and group nested XAML fixtures by their page. Build errors and no-match results remain visibly unverified in both detailed evidence and the console summary. Keep the verifier's existing passing policy, but make the publication explicit that unmatched/inconclusive groups are not successful execution evidence. A publication canary exposed an unnecessary repository-label metadata PATCH returning HTTP 404. The gate now assigns the existing gate labels without editing repository-wide descriptions/colors. Required assignment failures explicitly fail publication instead of being ignored. The final live publication completed without that warning. **Additive routing at production source `3e96214dacd9c65b3e99b0f23801e197722d0fc3`:** | Request | Selected pipeline | | --- | --- | | `/review` or normal/default dispatch | Existing full review, Deep UI, final AI Summary, cleanup, and telemetry | | `/review gate` or `gate_only=true` | Setup/Gate, fresh gate-only publication, and cleanup | | `/review tests` / `/review performance` | Their unchanged independent workflows | `eng/pipelines/ci-copilot.yml` keeps the original full stages inline and defaults `GateOnly` to **false**. Its explicit true branch selects `pr-review-gate.yml` at compile time, so gate runs contain no full-review/inference, Deep UI, or token-aggregation jobs. The parent passes the shared 150-minute Gate task limit as a typed template parameter; an actual Azure compiler preview exposed that the extracted stage template cannot read the parent's static timeout directly. No new Azure definition, secret, permission, or OIDC trust is required. **Current validation:** - `actionlint .github/workflows/review-trigger.yml .github/workflows/review-trigger-recovery.yml` - passed. Both Azure YAML files parse, all four changed production PowerShell scripts and 48 compile-time-expanded embedded PowerShell blocks parse, and `git diff --check` passes. - Azure Runs API `previewRun=true` on definition 27723 with the production branch and exact SHA above - **nine successful compiler previews**: omitted mode, explicit false on Android/iOS/Catalyst/Windows, and explicit true on all four platforms. Omitted mode expands identically to false. Full mode retains all five original stages; gate mode includes only `Gate`, `PostGate`, and `CleanupReviewLock`, with a 150-minute credential-free Gate task. - `Invoke-Pester -Path @('.github/scripts/ReviewTrigger.Tests.ps1', '.github/scripts/Recover-MissedReviewCommands.Tests.ps1', '.github/scripts/Review-PR.Tests.ps1', '.github/scripts/CopilotPipeline.Tests.ps1', '.github/scripts/shared/Prepare-UITestFailureAnalysis.Tests.ps1', '.github/scripts/Post-AISummaryComment.Tests.ps1') -Output Minimal -PassThru` - **246 passed, two unchanged model-pin assertions failed** against the independent, untouched `Review-Tests.ps1`. The restored existing suites and implicated product files match the original/current main versions; these unrelated assertions are not changed to manufacture a green result. - [Remote additive canary 15652574](https://devdiv.visualstudio.com/0bdbc590-a062-4c3f-b0f6-9383f67865ee/_build/results?buildId=15652574), queued by [the existing trusted-main dispatcher](https://github.com/dotnet/maui/actions/runs/38237622825), **succeeded** on this draft PR. Only Gate, fresh PostGate, and Cleanup jobs ran; all three succeeded. The no-MAUI-tests control truthfully reported **SKIPPED**, not native test execution. Its 7,062-byte GateLogs artifact contains regular allowlisted diagnostics. The new [MauiBot report](#39189 (comment)) has three badges and a closed Gate analysis with no Scope, Follow-up, or footer; its reviewed head and protected baseline are pinned. Actual GitHub state confirms no gate pass/fail or full-review signals and a released lock. Distinct hosted worker IDs confirm fresh-agent publication. Direct queue access was denied; the already-authorized dispatcher was used without changing credentials or trust. - This pre-merge canary uses isolated source `783a98445b269b3e9e30fef82e98d898ada3a74f` on `kubaflo-gate-only-additive-canary-3e96214`. It differs from production only in the declared `GateOnly` default, temporarily true because the old main dispatcher cannot pass the new input. Its actual Azure-expanded stages are identical to production with explicit true. The production PR remains at the SHA above with default **false**. - `Get-CIStatus.ps1 -PRNumber 39189 -Repository dotnet/maui -MaxJobs 100 -MaxFailureLines 20 -NoCache` - completed and refreshed after the canary; [normal maui-pr build 1631878](https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1631878) is still in progress for raw source `3e96214dacd9c65b3e99b0f23801e197722d0fc3` and merge source `74b9a40864ccb43a4079c8bb5d50fd20d53ea0ef`. The latest snapshot has six succeeded jobs, 20 pending/running, and no failures. Pending CI is not passing CI. <details> <summary>Earlier source-specific Gate execution, ten-PR canaries, and compact-comment validation</summary> The evidence below is preserved at its original execution/presentation sources. It does not claim that the ten earlier canaries ran at the newest additive source. **End-to-end execution validation at source `8e639d714ae303b62b537596cf488a476393bdc1`:** - Final publisher PowerShell parsing and `git diff --cached --check` passed. Earlier changed PowerShell/embedded Azure Bash and PowerShell syntax checks, YAML parsing, and `actionlint .github/workflows/review-trigger.yml .github/workflows/review-trigger-recovery.yml` passed; the follow-ups do not alter those YAML files. - `Invoke-Pester -Path @('.github/scripts/shared/Update-AgentLabels.Tests.ps1', '.github/scripts/shared/Detect-TestsInDiff.Tests.ps1', '.github/skills/verify-tests-fail-without-fix/scripts/Verify-TestsFail.Tests.ps1') -Output Minimal -PassThru` — 176 passed, zero failed. The actual console summary renderer was exercised with build-error, unmatched-filter, and environment-error records; none appeared as expected assertion failures. The final live log also correctly displays `BUILD ERR` rather than a successful runtime failure. - Azure Runs API previews succeeded for Android, iOS, Catalyst, and Windows, with only Gate, PostGate, and lock cleanup jobs. The Android `RunGate` task expands to 150 minutes. Those YAML configurations are unchanged by the publisher follow-ups. - The full detector against the exact #39175 test files selects only `UnitTest:PickerTests` and `XamlUnitTest:Maui30644`, merging the XAML page and code-behind rather than selecting a closed helper or broad `Test` filter. - The [hosted PowerShell suite at that source](https://github.com/dotnet/maui/actions/runs/37511816441) matches the existing workflow-equivalent selection: 2,456 passed and three unchanged model-policy assertions failed against the independent `/review tests` implementation/workflow files. Those unrelated model pins are not changed here. The retained local full-review publisher's 75 existing regressions pass. - [Skill validation at that source](https://github.com/dotnet/maui/actions/runs/37511811901): static validation passed, but the evaluation artifact exits 1 with 12 protocol and 18 capability session-construction errors (`Session filesystem path escapes root`), zero evaluation turns, and zero tokens. The unchanged hermeticity harness separately fails while materializing missing sparse-checkout blobs (`Could not reset index file to revision 'HEAD'`). A green execution job is not a passing skill evaluation. - [First live Picker/XAML canary on #39175](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15583760): `Maui30644` reproduced the issue and passed all three cases with the fix, but the incorrect Picker filter matched no tests. The corrections above address that selection. #39175 merged before publication; the publisher correctly refused the closed target and cleanup released its lock. - [Second Android canary on #37572](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15584958) completed the Gate, fresh publication, and cleanup, but exposed the repository-label metadata warning corrected above. Its owned report was superseded by the final canary. - [Final Android canary on #37572](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15585863), dispatched through [trusted `main`](https://github.com/dotnet/maui/actions/runs/37511805027), **succeeded at the exact source SHA above**. The selected `AnimationTests` baseline cannot compile without the fix's internal `HasTweener` API; all seven cases pass with the fix. This exercises the verifier's existing compile-coupled mode, not runtime FAIL-to-PASS reproduction. - The final fresh agent published [the gate report](#37572 (comment)), applied the appropriate gate signal without repository-label metadata edits, and minimized the previous owned report as outdated. Actual GitHub state confirmed the old report minimized, the new report visible, the tested head unchanged, and the in-progress lock absent. Cleanup succeeded. No new full-review tracking/outcome labels or PR metadata edits are claimed. **Comment-presentation follow-up at source `4d85e1f9307a83aba11c4603603876de8dcb121c`:** - Publisher PowerShell parsing and `git diff --cached --check` passed. The existing targeted label, detector, verifier, and local full-review publisher suites passed: **251 tests, zero failures**. No new pipeline/configuration tests were added. - `Post-PRGate.ps1 -DryRun` used the exact final-canary diagnostic transcript and immutable commit/run identities. The actual GitHub Markdown API rendered four badges, a real before/after results table, closed Gate analysis and Follow-up sections, and separately escaped execution logs. The existing failure-only report writer was also exercised with all four test types; skipped/no-report and merge-blocked previews do not claim execution or a with-fix result. - At the user's request, a separately guarded maintainer edit reformatted **the same existing MauiBot comment**, rather than running the publisher under a different identity or posting a duplicate. The live comment's `body_html` read-back confirms the new rendering. MauiBot attribution, the original verdict/run, both tested commits, the PR head, and every label are unchanged. This is a presentation-only edit of existing evidence, **not a new Azure verification run**. **Requested ten-PR canary batch — all ten outcomes verified:** All ten original runs were dispatched from trusted `main` with the custom `pipeline_ref` at source `4d85e1f9307a83aba11c4603603876de8dcb121c`. Original identities remain preserved separately from corrective attempts. Corrective unit-selection/publication runs used `78bb5d3a3bc6da91357b5b116542d77bcc283449`; final Windows helper validation used `d4397eaa8b855209c963ea8aad201508c3d45c05`; the additional Windows bootstrap control used source `ecd602ef48662a2a59f083d9db8fc5bdfb83fd45`. The batch is not represented as ten runs at the newest source. | PR | Platform | Verified outcome | Actual evidence | | --- | --- | --- | --- | | [#37319](#37319 (comment)) | Android | FAILED | [15596739](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15596739): with-fix unit execution has 53 passes and two genuine stroke-transition assertion failures. The independent UI case fails without the fix and passes with it, but does not conceal the unit failures. Unit baseline is compile-coupled to the new API. | | [#38441](#38441 (comment)) | Catalyst | PASSED | [15596747](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15596747): selected CollectionView height-update device case fails without the fix and passes with it. | | [#38625](#38625 (comment)) | Android | PASSED | [15596742](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15596742): 64 selected with-fix unit/SourceGen/XAML cases pass across five groups; baseline compilation is coupled to the new API. | | [#39013](#39013 (comment)) | Android | PASSED | [15596744](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15596744): the selected CurrentItem-after-removal UI case runs and fails without the fix, then runs and passes with it. | | [#38883](#38883 (comment)) | Catalyst, corrective host | FAILED | [15597032](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15597032): corrected `SkiaSharpSvgToolsTests` selects 16 cases, including both PR-added SVG tests. All pass without the fix, on confirmation, and with it. The selected unit tests do not reproduce this packaging change; this is not a with-fix test failure. | | [#39213](#39213 (comment)) | Android; Windows control | SKIPPED | Original corrective Android control [15597033](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15597033) and Windows bootstrap control [15597596](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15597596) both select no tests. No successful test execution or passing signal claimed. | | [#37690](#37690 (comment)) | iOS, corrective run | INCONCLUSIVE | [15597037](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15597037): all 23 selected unit cases pass with the fix; baseline cannot compile against the new cache API. Scoped device execution produces no fresh XHarness XML, so overall verification stays inconclusive. | | [#38843](#38843 (comment)) | iOS, corrective run | INCONCLUSIVE | [15597038](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15597038): test-only ScrollView verification produces no fresh device result. No with-fix execution is claimed. | | [#39185](#39185 (comment)) | Android | FAILED | [15596745](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15596745): selected `BindingPath_Parsed` passes without the fix, both confirmations, and with the fix. Fresh method-scoped XML contains one passing result; a different failure in the broader class cannot count as reproduction of this selected test. Actual inflight baseline is `262d95940f646b601093b36db4e27c691670d753`. | | [#39179](#39179 (comment)) | Windows, final helper run | PASSED, failure-only | [15597455](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15597455): ten actual HybridWebView UI cases, nine passing and one expected baseline failure (`VerifyHybridWebViewWithShadow`, 6.11% screenshot difference). Shared parser classifies the real results without the former missing-helper exception. No with-fix run is claimed. | For all ten outcomes, bounded artifact export, fresh MauiBot publication, actual stored HTML, reviewed head, appropriate gate signals, and lock cleanup are verified. At these execution sources, reports rendered four badges and closed Gate analysis/Follow-up accordions; test-group tables were rendered when evidence existed, while the no-tests control truthfully had no test table. The user-requested in-place simplification below now removes Scope and Follow-up from those same reports. Available excerpts remain escaped and detailed execution evidence stays in bounded artifacts. Replaced owned reports are independently confirmed minimized as outdated. Intentional FAILED verdicts remain red even when publication and cleanup succeed. Missing iOS result files are unverified execution, not demonstrated flakes or proof that the target PR is wrong. A passing gate is not full coverage, a code review, or merge readiness. #39179's old Windows attempts at sources before `d4397` could not parse failure-only results because the snapshot-size helper was declared after that branch exited. The older corrective [15597112](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15597112) published and cleaned up successfully but did **not** validate the helper fix. Final [15597455](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15597455) validates the exact helper source and retains the 156,762-byte `test-failure-HybridWebViewFeatureTests.log`. Its author advanced the raw reviewed head from `63621b4f8254b5a4112b1dbac3e676633544ca52` to `0d16b9cc87ef5640e176a2666e02c269ebdd6ce7` before final dispatch; those identities remain separate. Final reviewed/live head is unchanged, only the passing gate signal is present, and the lock is absent. The final build is `partiallySucceeded` because of its initial WSL preparation warning; protected-base recovery, actual Gate, export, fresh publication, and cleanup succeeded. Native Windows provisioning at source `ecd602ef` is separately verified below. **Canary-exposed corrections:** - Source `78bb5d3a3bc6da91357b5b116542d77bcc283449`: explicitly exit successfully after checked publication so an accepted optional label-removal 404 cannot leak a native exit code into PowerShell@2. Required API errors still throw. Bound/truncate allowlisted optional transcripts rather than rejecting all GateLogs when a transcript is oversized. Select the containing unit fixture instead of broad nested `Resize` (597 cases became the intended 16). Corrective SKIPPED, intentional FAILED, and INCONCLUSIVE publications and cleanup complete successfully. - Source `d4397eaa8b855209c963ea8aad201508c3d45c05`: move the unchanged snapshot-size parser helper before shared parsing and both verification modes; retain bounded `test-failure*.log` diagnostics. Updated related documentation. PowerShell parsing of both changed scripts and `git diff --check` passed. `Invoke-Pester -Path @('.github/skills/verify-tests-fail-without-fix/scripts/Verify-TestsFail.Tests.ps1', '.github/scripts/shared/Export-ExpectedPRAgentArtifact.Tests.ps1', '.github/scripts/shared/Copy-BoundedDiagnosticFile.Tests.ps1', '.github/scripts/shared/Import-ExpectedPRAgentArtifact.Tests.ps1') -Output Minimal -PassThru` — **141 passed**, zero failed/skipped/inconclusive/not-run. No new pipeline/configuration tests were written. Actual Windows failure-only parser/log-export/publication verification passed in [15597455](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15597455). - Source `ecd602ef48662a2a59f083d9db8fc5bdfb83fd45`: select a native PowerShell child for the Windows MSBuild-task watchdog instead of system `bash` that selected unconfigured WSL on Windows-2022. Retain the existing Unix command, wall-clock bound, output sanitization, exit-code propagation, and retry markers. YAML parsing, all eight embedded PowerShell blocks, the Windows child command, and `git diff --check` passed; no pipeline tests were added. The additional [Windows bootstrap control 15597596](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=15597596), on already-selected no-tests PR #39213 at unchanged head `1021c9a53afc990312bd6be5cea48dd56205c96f`, **completed successfully at this exact source**. MSBuild tasks actually built on the first attempt in 3m10s, with zero errors and no WSL/retry failure. Its bounded report is SKIPPED; fresh MauiBot [6038579070](#39213 (comment)) rendering, absence of pass/fail signals, prior-owned minimization, export, publication, and cleanup are verified. No native tests are claimed for this control; it is not a substitute for the separate Windows helper execution. **User-requested compact presentation at source `e41058bb0798ed6dddabcb1fda339d532bf2f145`:** - Remove the Follow-up accordion and its unused next-action logic, the Scope badge/text, and the report/artifact-link footer. Keep Result/Platform/Commit badges, Gate analysis, nuanced verdicts, test tables, escaped excerpts, and pinned head/baseline identities. Update both relevant report-format documentation sections. Publication ownership, ordering, labels, minimization, and artifact limits are unchanged. - Publisher PowerShell AST parsing and `git diff --cached --check` passed. Production `Post-PRGate.ps1 -DryRun` and actual GitHub Markdown rendering passed using retained evidence for full-mode PASSED (#38441), compile-coupled PASSED (#38625), failure-only PASSED (#39179), FAILED (#37319), SKIPPED (#39213), and INCONCLUSIVE (#37690). Each has three badges and closed Gate analysis without Scope, Follow-up, or the footer; test tables and escaped log contents remain unchanged. No new pipeline tests or native verification reruns were added. - All ten report URLs above were updated **in place** with separately guarded maintainer edits after freshly checking each comment's exact body, update timestamp, owner, ID, and run marker. The publisher was not run under the maintainer's identity. Actual stored `body_html` read-back verifies the same MauiBot comment IDs and unchanged verdicts, commit identities, test tables, and log text. These are presentation-only edits of existing evidence, not new Azure Gate runs or new comments. </details> The additive correction, remote canary verification, earlier ten-PR verification, and compact comment presentation are complete and pushed. This PR remains **draft** while normal CI finishes; no merge readiness is claimed. The earlier model-policy and skill-harness failures are preserved above as source-specific evidence, not silently repaired or described as green. After this PR merges, `/review` continues the full process and `/review gate` selects only existing-test verification. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> N/A - requested additive gate-only review and report-presentation changes; #38807 is the initial report-layout reference, not an issue fixed by this PR. <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| /// <param name="innerException">The inner exception.</param> | ||
| public XamlParseException(string message, IXmlLineInfo xmlInfo, Exception innerException = null) | ||
| : base(FormatMessage(message, xmlInfo), innerException) | ||
| : this(message, xmlInfo == null ? null : new XamlLineInfo(xmlInfo.LineNumber, xmlInfo.LinePosition), innerException) |
There was a problem hiding this comment.
[moderate] Logic and Correctness Verification - Preserve xmlInfo.HasLineInfo() when converting the existing XML constructor's input. new XamlParseException("error", new XmlLineInfo()) previously produced error, but now produces Position 0:0. error: the two-integer XamlLineInfo constructor always marks coordinates as available. Consequently XamlInfo.HasLineInfo() is true while the retained XmlInfo.HasLineInfo() is false. The missing-embedded-resource path in XamlLoader.Load already supplies this empty XML object. Use an empty XamlLineInfo when the input has no line information, and add a no-information assertion alongside the positive-coordinate coverage.
| { | ||
| if (serviceProvider.GetService(typeof(IXmlLineInfoProvider)) is IXmlLineInfoProvider lineInfoProvider) | ||
| xmlLineInfo = lineInfoProvider.XmlLineInfo; | ||
| if (serviceProvider.GetService(typeof(XamlLineInfo)) is XamlLineInfo lineInfo) |
There was a problem hiding this comment.
[moderate] Backward Compatibility and Migration - Explicitly annotated legacy extensions lose type-resolution error locations. An extension declaring [RequireService([typeof(IXamlTypeResolver), typeof(IXmlLineInfoProvider)])] still receives those services from SourceGen/XamlC, but not XamlLineInfo. Calling the resolver's Resolve("local:MissingType", serviceProvider) now ignores the available legacy provider and passes null coordinates to the parser, so the resulting XamlParseException.XmlInfo is null and its message loses the markup's line/column. Runtime loading still registers both services. Fall back to the legacy provider when the concrete service is absent; this can remain inside the XAML assembly without restoring XML references to ordinary generated code. The new legacy-generation test only checks emitted provider construction, not resolver diagnostic coordinates.
PR Test Gate
🧪 Gate analysis — click to expand❌ Failed. The selected tests did not meet the expected outcomes. Inspect the evidence before changing the test or fix. 🧪 Unit tests
📄 XAML unit tests
Execution log excerptsWithout fix With fix Without fix With fix PR head: 64c52fd3. Without-fix baseline: 3a7d7287. |
<!-- copilot-assessment:v1 --> ### Agent assessment Self-reported assessment, not an independent review. Assessed revision: `00596564db5aeb9113a365c064f0506e4183be42` | Dimension | Assessment | Rationale | |---|---|---| | Change confidence | 9/10 | ↑ Full SourceGen suite passed with 938 tests and 71 skipped.<br>↑ Full XAML suite passed with 1,656 tests and 3 skipped.<br>↑ Generated consumer PE metadata test confirms no `System.Xml.ReaderWriter` assembly reference.<br>↓ Controlled app/package size publishing was not run. | | Diagnosis confidence | 9.5/10 | ↑ SourceGen emitted `IXmlLineInfoProvider` and `XmlLineInfo`, directly introducing the facade reference.<br>↑ Generated source and PE assertions cover both legacy and new service declarations. | | Evidence fit | 9.5/10 | ↑ The generated-consumer reference check targets the reported assembly-reference problem.<br>↑ Runtime tests cover both service directions and preserve `HasLineInfo=false`.<br>↓ Package size remains unmeasured. | <!-- /copilot-assessment --> <!-- 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! ### Target Branch - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). This is a .NET 12/current-main replacement, so the selected base is `main`. ### Description of Change This is a fresh SourceGen/runtime-only replacement for #38625. It intentionally excludes the obsolete XamlC, Build.Tasks, and netstandard architecture from that older PR. - Adds a MAUI-owned `XamlLineInfo` value type that carries an explicit `HasLineInfo` state. - Makes SourceGen register `XamlLineInfo` even when a legacy markup extension declares `IXmlLineInfoProvider`, and removes `XmlLineInfo`/`IXmlLineInfoProvider` emission from generated XAML. - Adds bidirectional compatibility in `XamlServiceProvider`, including custom `IServiceProvider` consumers, while retaining the existing XML APIs and `XmlInfo` property. - Adds `XamlParseException.XamlInfo` and preserves false line-info values through exception, clone, and provider conversions instead of turning them into `0:0` with line info enabled. - Uses the new line-info type for the current SourceGen CSS/stylesheet path and migrates current MAUI markup extensions to request it. - Adds SourceGen assembly-reference coverage and runtime exception/provider compatibility tests. #### Validation - `dotnet test src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj -f net12.0 -p:MauiPlatforms= -p:PublicApiType=Validate --no-restore --output Minimal` — 938 passed, 71 skipped, 0 failed. - `dotnet artifacts/bin/Controls.Xaml.UnitTests/Debug/net12.0/Microsoft.Maui.Controls.Xaml.UnitTests.dll --long-running 10 --timeout 15m --output Minimal` — 1,656 passed, 3 skipped, 0 failed after a successful `-p:PublicApiType=Validate` build. - Focused SourceGen provider/reference tests — 41 passed, 0 failed. - Focused runtime compatibility/service tests — 5 passed, 0 failed. - Generated consumer PE metadata contains no `System.Xml.ReaderWriter` assembly reference. - Controlled app/package size publishing was not measured because a reproducible publish baseline was not available in this environment. ### Issues Fixed Supersedes #38625. The older PR is intentionally left open for now. ### Let AI finish this PR - [ ] **Let the MAUI agent address review feedback and fix remaining issues on this PR.** Maintainers still decide whether it is merged. For PRs from forks, keep "Allow edits by maintainers" on so the agent can push to your branch; otherwise it opens a follow-up PR that keeps your commits. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
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 of Change
Source-generated and XamlC
InitializeComponentmethods currently constructXmlLineInfoProvider(System.Xml.IXmlLineInfo). That emitted signature gives otherwise compiled XAML apps a directSystem.Xml.ReaderWriterreference.This change adds a single sealed MAUI-owned
XamlLineInfovalue type and registers that concrete type as the line-info service emitted by SourceGen and XamlC. RuntimeLoadFromXamlmaps real XML reader line information intoXamlLineInfoinside the trimmable XAML assembly.Existing XML line-info APIs remain available for compatibility.
XamlParseException.XamlInfoexposes the concrete MAUI value without adding the XML facade to app code, while the existingXmlInfoproperty and XML constructor remain unchanged.Legacy markup extensions that explicitly require
IXmlLineInfoProviderretain the compatibility provider. The normal compiled/source-generated path does not reference that XML service.Size validation
The measurement environment applied #38613, #38615, and #38616 separately to create the realistic prerequisite baseline; those changes are not included in this PR.
Controlled .NET 11 Android arm64 Release sample-content publish,
PublishReadyToRun=false, partial trim:System.Xml.ReaderWriter.dllSystem.Private.Xml.dllThe linked app, Controls, and XAML assemblies contain no
System.Xml.ReaderWriterassembly-name reference.Runtime
LoadFromXamlline diagnostics are covered throughXamlParseException.XamlInfo.System.Private.Xmlremains independently rooted by Mono.Android/AndroidX XML reader APIs and Syncfusion sample-content style initialization.Compatibility note
Extensions should declare
[RequireService]for services they consume. Explicit legacyIXmlLineInfoProviderrequests remain supported; new code should request the concreteXamlLineInfoservice.Issues Fixed
Related to #38613