Skip to content

feat(winui-sync): Allow file-level area paths - #26463

Merged
MartinZikmund merged 5 commits into
masterfrom
dev/mazi/winui-sync-file-paths
Nov 14, 2026
Merged

MartinZikmund merged 5 commits into
masterfrom
dev/mazi/winui-sync-file-paths

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: closes #26460

PR Type:

  • 🤖 Project automation

What changed? 🚀

The WinUI Port Sync tooling could only track whole upstream folders. Core controls such as Button, ButtonBase and ToggleButton are loose files in folders shared with hundreds of other types (dxaml/xcp/dxaml/lib has over 1,100 entries), so they could not be onboarded without every unrelated change counting as theirs.

  • An area's upstream.sources and upstream.tests can now name a single file as well as a folder. Folders behave as before.

  • A listed file that upstream adds or removes counts as a change, and the run summary says which.

  • The port agent's prompt gets one git diff (or git show for an added or removed file) per listed file.

  • A path that is a file at one commit and a folder at the other is rejected.

  • README.md and the /winui-sync-onboard skill describe when to list files instead of a folder.

  • Unrelated to file paths: each port is now capped at 3 USD (--max-budget-usd 3 on the agent step).

  • Also unrelated to file paths: when the port agent fails part-way (a crash or the spend cap), the files it had changed are no longer dropped. They are pushed to the sync branch behind a draft PR titled [port incomplete] ... that says not to merge. The baseline does not move, so the next run continues the port on that branch and clears the flag once it finishes. A failed agent that changed nothing, and a cancelled one, are still not published.

Trade-off: with file-level paths, a new upstream file is not picked up until someone adds it to the area. Strings paths are still folders only.

No area is added here; areas.json is unchanged. Onboarding the button controls follows once this is merged.

PR Checklist ✅

Other information ℹ️

  • Runtime (tooling): 110 Pester tests pass (build/winui-sync/tests/run.ps1). The new ones failed before their change.
  • Runtime (real clone, local): seeded a file-level area for Button, ButtonBase and ToggleButton into a temporary copy of the manifest and ran detect.ps1 against winui3/release/2.6.5. It reported three changed files, 5 lines each way in total, from a 1.4.2 baseline.
  • Not verified: a workflow run with a file-level area, since none is onboarded yet.
  • Not verified: the spend cap and the incomplete-draft path in a workflow run. That path assumes the action fails its step when the cap is reached. The flag exists in the Claude Code CLI; no port so far has come near the cap (the largest cost 0.64 USD).
  • The seed script does not read a tag that sits on the line after // MUX Reference (as in ButtonBase.mux.cs). That is existing behaviour and is left alone here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TXMNu2Uow7dC9EJ2fL3Hkw

MartinZikmund and others added 2 commits November 14, 2026 08:05
Core controls live in upstream folders shared with hundreds of other types, so an area can now list individual files in upstream sources and tests. A listed file that upstream adds or removes counts as a change.

Closes #26460

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu2Uow7dC9EJ2fL3Hkw
Copilot AI balanced review requested due to automatic review settings November 14, 2026 07:05

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 21s —— View job


Review of #26463: file-level area paths for WinUI sync

Verdict: ship. I found no blocking issues. I have no inline findings: 0 critical, 0 major, 0 minor.

I read the diff by inspection only. I did not run the Pester suite or detect.ps1, so the test results below are the ones reported in the PR description.

What I checked

  • Path resolution: Resolve-UpstreamEntry keeps the src/ fallback. The ^\d+ (tree|blob) match skips submodule (commit) entries, so those still read as an unresolved path.
  • Folder vs file: the mismatch check only throws when the path exists on both sides with different kinds. An added or removed path takes its kind from whichever side has it, and a folder that is missing on one side still diffs against the empty tree as before.
  • Change detection: Get-AreaSyncState handles an added or removed file before the git diff --quiet call, so a $null spec never reaches git.
  • Strings exclusion: it applies only to folders. A file path can never match the "$path/" prefix, so the exclusion is simply skipped for files, which is the right outcome.
  • Port agent prompt: Expand-SyncPrompt emits git diff for a changed file and git show for an added or removed one. git diff <sha>:<file> <sha>:<file> is valid for two blobs.
  • Tests and docs: the nine new Pester tests cover the new paths. The README, the onboarding skill and prompt.md wording all agree with the behavior.

Cross-cutting notes (non-blocking)

  • Silent misses: as the PR says, a new upstream file in a shared folder is never picked up for a file-level area. You could add a periodic "unlisted sibling" report later if misses become a worry.
  • Existing seed limitation: the seed script's // MUX Reference tag handling, which the PR leaves alone, is unchanged.
  • Workflow run: this is not yet exercised end to end, as the PR notes, since no area uses file paths yet. The first onboarding PR will be the real test.

@mergify

mergify Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

Copilot AI balanced review requested due to automatic review settings November 14, 2026 07:06

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 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

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


Review of #26463: file-level area paths for WinUI sync

Verdict: ship. 0 critical, 0 major, 0 minor. I posted no inline comments.

I reviewed the diff against origin/master by inspection. I did not run the Pester suite or detect.ps1. The test results are the ones reported in the PR description.

Checked

  • Resolve-UpstreamEntry: it keeps the src/ fallback. The tree|blob match skips submodule entries.
  • Get-AreaTreeDiffs: a file/folder mismatch between the two commits throws. A path missing on one side takes its kind from the other side. A folder keeps the empty-tree fallback and a file uses $null.
  • Get-AreaSyncState: an added or removed file is handled before git diff --quiet, so a $null spec never reaches git.
  • Expand-SyncPrompt: it emits git show for an added or removed file and git diff otherwise. Both match the --allowedTools entries in the workflow, git -C .winui-upstream diff:* and show:*.
  • Docs and tests: the README, prompt.md and the skill wording agree with the behavior. The new Pester tests cover the added, removed and mismatch cases.
  • Workflow: the --max-budget-usd 3 line comes from the earlier commit in this PR, ci(winui-sync): Cap each port at 3 USD. The diff shows nothing else wrong with it.

Non-blocking notes

  • Unlisted new files: a new upstream file in a shared folder is not picked up for a file-level area until someone lists it. This is the trade-off the PR already states. A periodic "unlisted sibling" report could cover it later.
  • End-to-end run: the workflow has not run against a file-level area yet. The first onboarding PR will be that test.

MartinZikmund and others added 2 commits November 14, 2026 08:14
When the port agent fails part-way (a crash or the spend cap), the files
it changed were dropped. They are now pushed to the sync branch behind a
draft PR titled "[port incomplete]" that says not to merge. The baseline
stays where it was, so the next run continues the port on that branch.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNtzAfj5NwgUdt5mstWu
Copilot AI balanced review requested due to automatic review settings November 14, 2026 07:14

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 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

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


Review of #26463: file-level area paths for WinUI sync

Verdict: ship, with one description fix. I found 0 critical, 0 major and 1 minor issue, and posted no inline comments.

I read the diff against origin/master by inspection only. I did not run the Pester suite or detect.ps1.

Minor: the PR description no longer matches the code.

  • The description says a port that hits the 3 USD cap "fails and nothing is published for that area."
  • The two newer commits, feat(winui-sync): Publish unfinished ports as drafts and its tests, change that. Publish-SyncArea now publishes a failed agent's partial patch as a [port incomplete] PR, and the baseline does not move. This happens only when the status is agent failure and the patch is non-empty.
  • Please update the "What changed?" section to describe the draft behavior, and mention it in the README if it isn't there yet. Reviewers will otherwise expect a silent failure.

Cross-cutting notes (non-blocking)

  • Publish path: the incomplete branch skips Set-AreaBaseline and does not count anything as skipped, so the next run redoes the full range. That is consistent. The branch holds unbuilt code, so the "Do not merge" PR text matters. I did not check that New-GitHubPr opens it as a draft. Please confirm that.
  • File-level paths: the logic is unchanged from the earlier reviews. The same end-to-end gap applies, because no area uses file paths yet.

@MartinZikmund
MartinZikmund merged commit 7ad5511 into master Nov 14, 2026
21 of 32 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/winui-sync-file-paths branch November 14, 2026 07:23
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

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: allow file-level area paths

3 participants