[BugReportTool] Fix report generation while PowerToys is running #51427

Merged
moooyo opened 10:04am on October 20, 2026 wanted to merge 2 commits into microsoft/powertoys main from
codex/investigate-bug-report-policy

Pull Request Overview

  • Opened on October 20, 2026
  • Status Merged
  • Commit count 2 with first commit October 20, 2026

Total Delta

0 Total Diff Delta

Open Days

Open 16 weekdays

Test Delta

0 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Fraction of total time Business days Phase
 
0.0 days Authoring 1 commit before pull request opened for review
 
0.4 days Awaiting first review
 
7.0 days Merge to deploy

Total time for pull request 7.4 business days from first commit authored to deploy

Author avatar

[BugReportTool] Fix report generation while PowerToys is running

Summary of the Pull Request

Generating a bug report while PowerToys is running fails with Failed to copy PowerToys folder because the Runner holds settings.json.cli-lock exclusively. Exclude that root synchronization file before copying settings so report generation can proceed. This fixes the regression introduced by #50507.

PR Checklist


  • [ ] Closes: No linked issue.

  • [ ] Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected

  • [ ] Tests: Added/updated and all pass

  • [ ] Localization: All end-user-facing strings can be localized

  • [ ] Dev docs: Added/updated

  • [ ] New binaries: Added on the required places



  • [ ] Documentation updated: If checked, please file a pull request on our docs repo and link it here: Not applicable.

Validation is manual; no automated test additions are included in this PR. There are no new user-facing strings, development documentation, binaries, packaging changes, or external documentation changes.

Detailed Description of the Pull Request / Additional comments

In tools/BugReportTool/BugReportTool/Main.cpp, create the report directory and copy each settings-root entry recursively, skipping settings.json.cli-lock with a case-insensitive filename comparison. The file is excluded before any copy attempts to open it. Other diagnostic files and nested directories are preserved, and unrelated copy errors retain the existing failure path.

Validation Steps Performed


  • Built BugReportTool in Release x64 using the repository build wrapper: exit code 0 for commit 27489cd9746830a3a196074bf47409b47a2f6242.

  • On local Windows, ran the installed 0.102.2883.0 report tool and then the PR executable against real PowerToys user data while the same installed Runner held the root CLI lock exclusively throughout. Each child used separate temporary and output directories; installed binaries were untouched. The baseline exited naturally with code 1, Failed to copy PowerToys folder, and no ZIP.

  • The PR executable exited naturally with code 0 and generated a 919,234-byte ZIP containing 641 entries. Verified parseable settings JSON, 43 nonempty nested Runner logs, nonempty GPO/Windows/monitor reports, and exclusion of the root settings.json.cli-lock. The full run took about 97 minutes because registry collection was slow on this host.

  • CI run 391437 passed all 10 checks. Release x64 and ARM64 builds completed with 0 errors and 0 warnings. The existing x64 native suite reported 11,066 passed, 21 skipped, and 0 failed; ARM64 tests were skipped.

Comments Threads Pending Resolution

Resolved Comment Threads

No resolved comments have been left on this PR.