Repository navigation
Split DotnetMuxerLocator into platform-focused modules - #11534
Merged
Amaury Levé (Evangelink) merged 4 commits intoSep 27, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
1 of 6 tasks
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor DotnetMuxerLocator.cs into focused modules
Split DotnetMuxerLocator into platform-focused modules
Sep 25, 2026
Amaury Levé (Evangelink)
marked this pull request as ready for review
September 27, 2026 11:47
Amaury Levé (Evangelink)
enabled auto-merge (squash)
September 27, 2026 11:48
Contributor
There was a problem hiding this comment.
Note
🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.
Review outcome: No actionable findings — this is a clean, behavior-preserving code-movement refactor.
Change classification
- Code organization only:
DotnetMuxerLocatorbecomesinternal sealed partial class, splitting its Windows PE-header parsing and macOS Mach-O parsing logic into two new files (DotnetMuxerLocator.Windows.cs,DotnetMuxerLocator.MacOs.cs) while the base file retains shared state, constructor, and orchestration logic (IsValidArchitectureMuxer). - No logic changes: Diffed the moved method bodies (
GetMuxerArchitectureByPEHeaderOnWin,GetMuxerArchitectureByMachoOnMac,ReadFourBytes,MacOsCpuTypeenum, Mach-O magic-number constants) line-by-line against the pre-refactor file — byte-identical apart from relocation.GetMuxerArchitectureByPEHeaderOnWinalso picked up astaticmodifier change only in the sense it was alreadystaticbefore the move (confirmed unchanged).
Confidence at a glance
🟢 Correctness & design — clean, verified equivalent
- Why it applies: Refactor touches core architecture-detection logic used by
IsValidArchitectureMuxer, which gates muxer selection. - Evidence:
IsValidArchitectureMuxer(unchanged, still in base file) callsGetMuxerArchitectureByPEHeaderOnWin(path, _resolutionLog)on Windows andGetMuxerArchitectureByMachoOnMac(path)on macOS/other — both call sites and signatures are identical to pre-refactor.partialmodifier correctly applied to all three files; nousingdirectives are missing (System.Buffers.Binarymoved intoDotnetMuxerLocator.MacOs.cswhere it's now used, dropped from the base file where it's no longer needed — correct). No namespace mismatch; all three files shareMicrosoft.Testing.Platform.MSBuild.Tasks. - Gap or disposition: Two pre-existing, non-blocking observations posted as inline NITs (macOS file casing
MacOsvs. conventionalMacOS, matches existingMacOsCpuTypeenum so is only a naming nit; and a pre-existing truncated-fileEndOfStreamExceptionrisk in the PE header reader, unchanged by this PR). - Action: None required for merge.
🟢 API & compatibility — clean
- Why it applies: Class changed from
sealed classtosealed partial class; need to confirm no accessibility change and no public API impact. - Evidence: All moved/retained members remain
internal/private/private staticexactly as before — no accessibility widened or narrowed. No project in this repo has aPublicAPI.Unshipped.txtforMicrosoft.Testing.Platform.MSBuild(confirmed via search), and none is needed since nothing here ispublic.partialon an otherwise single-assemblyinternal sealedclass has no ABI/multi-targeting implications; no#ifconditional compilation is needed since OS branching is done viaRuntimeInformation.IsOSPlatformat runtime, not compile-time — correctly, files are compiled for all TFMs regardless of OS. - Gap or disposition: None.
- Action: None required for merge.
🟢 Tests — clean, coverage preserved
- Why it applies: Behavior-only-moved code needs confirmation that existing tests still exercise it correctly post-split.
- Evidence:
test/UnitTests/Microsoft.Testing.Platform.MSBuild.UnitTests/DotnetMuxerLocatorTests.csinvokes the private static/instance methods viatypeof(DotnetMuxerLocator).GetMethod(methodName, BindingFlags.NonPublic | ...)reflection — this resolves correctly across partial-class file boundaries since reflection operates on the merged type, not the source file. No test changes were needed or made, consistent with a pure refactor. - Gap or disposition: None.
- Action: None required for merge.
⚪ Not applicable: Concurrency & lifecycle, Security & protocol, Performance, Localization, Analyzers, Build/dependencies & scripts (no .props/.targets/dependency changes).
Petr Pokorny (0101)
approved these changes
Sep 27, 2026
Amaury Levé (Evangelink)
deleted the
copilot/refactor-dotnetmuxerlocator
branch
September 27, 2026 13:30
This was referenced Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

DotnetMuxerLocator.cshad grown to 573 lines, combining discovery orchestration with platform-specific binary parsing.Core locator
Windows
DotnetMuxerLocator.Windows.cs.macOS
DotnetMuxerLocator.MacOs.cs.The implementation remains one logical type through partial class declarations: