Skip to content

fix(winui-sync): Leave mirrored files out of the code diff - #26484

Merged
MartinZikmund merged 2 commits into
masterfrom
dev/mazi/winui-sync-mirror-exclude
Nov 14, 2026
Merged

MartinZikmund merged 2 commits into
masterfrom
dev/mazi/winui-sync-mirror-exclude

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue: closes #26483

PR Type:

  • 🤖 Project automation

What changed? 🚀

Follow-up to #26481. A mirrored file can sit inside one of the area's upstream source folders: a MUX control's verbatim theme XAML lives in controls/dev/<Name>. The area's tree diff excluded only the Strings folder, so such a file was handled twice. The workflow copied it, and the port agent was also handed its diff as code to port. That diff drives two things:

  • Detection: an upstream change to only the mirrored file selected the area as a code change, so the agent ran for nothing.
  • Agent prompt: the agent got a diff for a file it is told not to edit, and the copy then overwrote whatever it did.

Get-AreaTreeDiffs now leaves mirrored files out the same way it leaves out Strings:

  • A mirrored file under a source or test folder becomes an :(exclude) pathspec on that folder's diff.
  • A listed source file that is itself mirrored is dropped from the comparisons.

Detection and the agent's diff commands both read from that function, so they change together. The README notes that a mirror may sit inside a source folder.

PR Checklist ✅

Other information ℹ️

  • Runtime (tooling): 132 Pester tests pass. Three are new:

    • A change to only the mirrored file is a mirror change, not a code change, whether the area lists the folder or the individual files.
    • A change elsewhere in the folder is still a code change.
    • The agent's diff command carries ':(exclude)Foo.xaml' next to ':(exclude)Strings'.

    Both new tests failed before the fix (codeChanged was true, and the exclude was missing).

  • Runtime (real data, local): a scratch area mirroring controls/dev/SplitButton/SplitButton.xaml, with a 1.8.4 baseline, detected against 2.6.5:

    Module Code diff given to the agent
    master 3 files changed, 33 insertions, 14 deletions, including SplitButton.xaml
    This PR 2 files changed, 9 insertions, 3 deletions: SplitButton.vcxitems and SplitButton_themeresources.xaml
  • Tracked areas: no area in areas.json has a mirror inside a source folder yet, so no current detection result changes. This unblocks mapping verbatim MUX theme XAML as mirrors, which ProgressRing and PipsPager onboarding both ran into.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TXMNtzW3o9yaCzcTjhsgHm

MartinZikmund and others added 2 commits November 14, 2026 20:50
A mirrored file inside an upstream source folder was diffed as code too,
so the agent was asked to port a file the sync copies anyway. Exclude
mirrored paths the way the Strings folder is (fixes #26483).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNtzW3o9yaCzcTjhsgHm
@MartinZikmund MartinZikmund self-assigned this Nov 14, 2026
Copilot AI balanced review requested due to automatic review settings November 14, 2026 19:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@github-actions github-actions Bot added area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation labels Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 14s —— View job


Review of #26484

Verdict: ship. I found no blocking issues, and I posted no inline comments.

Severity Count
Blocking 0
Minor 1

I read the WinUISync.psm1 and README diffs. I did not run the Pester suite; the 132 passing tests are the PR author's report.

What I checked

  • Root cause. The fix is in Get-AreaTreeDiffs, which both detection and the agent's diff commands read from. It is not a guard added on one side, so the two paths can't drift apart.
  • Nested excludes. The exclude pathspec is computed relative to each folder. @($strings) + $mirrored | Where-Object { $_ -and ... } handles a null strings and an empty mirror list. This covers mirrors under both source and test folders.
  • Listed mirrored files. A mirrored file listed directly under sources or tests is dropped from the comparisons. Both the folder and individual-file cases have tests, and the PR says the new tests failed before the fix.
  • Scope. Exclusion applies only to Kind -eq 'tree'. Blob entries are dropped earlier through the $mirrored -notcontains filter, so there is no gap.

Minor

  • The new README sentence runs past the wrapping used by the rest of the paragraph. This is cosmetic.

Cross-cutting notes

  • No area in areas.json has a nested mirror yet, so the fix changes no current detection result. The scratch-area numbers in the PR description are the only real-data evidence.
  • The PR has no Strings-specific change, and the existing Strings exclude behaves the same.

@mergify

mergify Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

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

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WinUI Port Sync: leave mirrored files out of the code diff

2 participants