Repository navigation
feat(winui-sync): Copy verbatim files without an agent - #26481
Conversation
An area can list files Uno keeps as verbatim copies of upstream files (mirror: { upstream, uno }). Like the Strings folder, they are replaced with upstream's version by the publish job, with no agent and no port:
- detection compares each copy with upstream (ignoring line endings, BOM and the Uno MUX Reference line) and selects the area on a difference, while code diffs never include mirrored files, so the agent does not run
- publish keeps the Uno file's MUX Reference line, BOM and line endings and replaces the rest, commits it as 'Copy <Title> from WinUI <version>', and the PR names the area's other Uno files to check by hand
- an area made only of mirrors needs no upstream sources; seed-area.ps1 takes -Mirror 'upstream=uno'
- seeding no longer fails when no header names a version (the normal state of a tracked area's XAML)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu2Uow7dC9EJ2fL3Hkw
The new publish test clones without autocrlf, so files publish does not touch stay unchanged on Windows. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu2Uow7dC9EJ2fL3Hkw
Generic.xaml is WinUI's generic.xaml verbatim, so it is now a mirror: syncs replace it with upstream's version (keeping its MUX Reference line) instead of having an agent port it. UnoGenericOverlay.xaml stays in the Uno sources, so sync PRs name it for a person to check. Verified on real data: detection reports the area up to date, a copy at 2.6.5 changes nothing, and a copy from 1.5.5 (6 differing lines) replaced the file with the header kept on line 2 and BOM and CRLF intact. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu2Uow7dC9EJ2fL3Hkw
There was a problem hiding this comment.
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.
|
Claude finished @MartinZikmund's task in 27s —— View job Review of #26481Verdict: ship after one fix. I found 1 medium issue (inline). I did not run the Pester suite. This is a static review. Reviewed: mirror manifest parsing, detection, Cross-cutting notes
|
|
This pull request is merged. |
| $copy = @(Invoke-Git $UnoRoot @('show', "${branchRef}:$($m.uno)") -AllowExitCodes 128) | ||
| if ((Get-LastGitExitCode) -ne 0) { continue } | ||
| $dest = Join-Path $mirrorRoot $m.uno | ||
| New-Item -ItemType Directory -Force -Path (Split-Path $dest) | Out-Null |
There was a problem hiding this comment.
The open-branch copy is rebuilt from git show text output (via Invoke-Git), which is lossy in two ways:
- PowerShell decodes native output with
[Console]::OutputEncoding, so non-ASCII characters inGeneric.xamlcan be mangled on hosts that aren't UTF-8. The result is a false "copied files changed". - The
-join "n" + "n"always appends a trailing newline. If upstream's file has none, the branch copy never compares equal, so the area is re-selected on every run.
Get the exact bytes instead, for example git -C $UnoRoot cat-file blob "${branchRef}:$($m.uno)" redirected to a file, or git archive as in Get-UpstreamFileBytes. Then feed them through ConvertFrom-FileBytes.
The new "open-branch copies" test only uses ASCII text with a trailing newline, so it doesn't cover either case.
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-26481/docs/index.html |
GitHub Issue: closes #26480
PR Type:
What changed? 🚀
Follow-up to #26474 and #26478. Uno.UI's
Generic.xamlis WinUI'sgeneric.xamlverbatim, so syncing it is a plain copy and replace, not a port. This adds that as a first-class sync mode and switches thegenericxamlarea to it.Mirrored files (
mirror: [{ upstream, uno }]inareas.json), handled like theStringsfolder:MUX Referenceline. A difference selects the area (statuscopied files changed). Mirrored files are never part of the code diff, so the port job (the agent) does not run for them.MUX Referenceline (same position), its BOM and its line endings. It commits that aschore(<id>): Copy <Title> from WinUI <version>and moves the baseline. The issue and PR get a Copied from upstream section that names the area's other Uno files for a person to check: forGeneric.xaml, that'sUnoGenericOverlay.xaml, whose GridView/FlipView copies may need to follow.upstream.sources.seed-area.ps1 -Mirror 'upstream path=uno path'.Fix found on real data: seeding failed with "Cannot bind argument to parameter 'References' because it is an empty array" when no header names a version. That is now the normal state of a tracked area's XAML, since #26474 dropped header versions. It works now, given
-Baseline.genericxamlis nowmirror: dxaml/xcp/dxaml/themes/generic.xaml → src/Uno.UI/UI/Xaml/Style/Generic/Generic.xaml, withUnoGenericOverlay.xamlas its Uno source. The baseline is unchanged (2.6.5).README and the
/winui-sync-onboardskill describe when to map a file as a mirror. The workflow YAML needs no change: the publish job already runs for every selected area, and mirrors are applied there unconditionally.PR Checklist ✅
Screenshots Compare Test Runresults.Other information ℹ️
Sync-AreaMirror(header line, BOM and line endings kept; missing upstream file throws and leaves the copy alone), a mirror-only publish with no agent artifact, and the seed cases. Each failed before the change.genericxamlup to date through the mirror comparison.generic.xamldiffers by 6 lines) into a scratch copy replaced the file: header kept on line 2, BOM and CRLF intact, the rest equal to upstream 1.5.5.generic.xaml.🤖 Generated with Claude Code
https://claude.ai/code/session_01TXMNu2Uow7dC9EJ2fL3Hkw