This is Part 3 of the PowerToys Experience series. Read Part 2 here.
When I opened my first contribution to Microsoft PowerToys, I quickly learned that shipping a working C# feature locally is the easy part. The real grind is surviving maintainer code reviews, fixing flaky remote CI pipelines, and keeping your branch clean against fast-moving upstream merges.
The Trap of Flaky UI Automation
When I submitted PR #49460 for "Paste as Rich Text", my initial instinct was to write an end-to-end UI automation test using WinAppDriver. It felt thorough, but in practice, UI automation in a monorepo with hundreds of concurrent test suites is an operational hazard. My initial test had 35-second static delays, which I temporarily refactored to a 200ms polling loop.
However, core maintainer @MuyuanMS pushed back with the ground truth of enterprise CI: UI automation tests in this repository are notoriously flaky and cause recurring false alarms across the Azure Pipelines matrix. The directive was clear: delete the UI automation test entirely.
The Systems Architect Takeaway: Amateur engineers defend their flaky tests. Senior architects take immediate ownership, kill brittle test automation, and replace it with deterministic unit verification.
Engineering Deterministic Verification in MSTest
I followed the maintainer's directive without hesitation. I removed the brittle WinAppDriver test and built targeted, deterministic unit tests in RichTextHelperTests.cs using MSTest. These tests execute in milliseconds, isolating and validating:
- Accurate
CF_HTMLfragment headers (start/end HTML, start/end fragment offsets). - Edge-case handling for empty or malformed clipboard strings.
- HTML table and bold formatting compiled via
Markdig.Signedwithout memory leaks.
Surviving 448 Upstream Commits
While the PR was under review, upstream PowerToys moved aggressively—merging Microsoft's on-device Phi Silica AI model and adding new actions to Advanced Paste. I had to rebase across 448 commits of upstream drift, manually resolving merge conflicts in settings view models and maintaining an untangled, linear git commit history (mergeable: true).
Real architectural authority isn't measured by a clean local build on your personal laptop. It's measured by your ability to navigate strict peer reviews from senior Microsoft engineers, secure telemetry sign-offs, and keep a complex enterprise PR alive through hundreds of upstream changes.
Review the full technical PR thread and maintainer discussion here: microsoft/PowerToys PR #49460.