Skip to content

Split TestHostBuilder host-mode logic into focused files - #12612

Merged
Amaury Levé (Evangelink) merged 2 commits into
mainfrom
copilot/refactor-testhostbuilder-modes
Nov 24, 2026
Merged

Amaury Levé (Evangelink) merged 2 commits into
mainfrom
copilot/refactor-testhostbuilder-modes

Conversation

@Evangelink

@Evangelink Amaury Levé (Evangelink) commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

TestHostBuilder.Modes.cs had grown to 550 lines, combining host selection, orchestration, invocation lifetime, and test-host construction. This change separates those responsibilities while preserving the existing method bodies and contracts.

  • Host selection — TestHostBuilder.Modes.cs
  • Orchestration and controllers — TestHostBuilder.Orchestration.cs
  • Invocation lifetime — TestHostBuilder.InvocationLifetime.cs
  • Server and console hosts — TestHostBuilder.TestHostMode.cs

Copilot AI balanced review requested due to automatic review settings November 24, 2026 19:00

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 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.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 19:19
@Evangelink Amaury Levé (Evangelink) changed the title [WIP] Refactor TestHostBuilder.Modes.cs into smaller files Split TestHostBuilder host-mode logic into focused files Nov 24, 2026

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.

🟢 Approval recommended

No active review issues remain for the refactor that separates host-building responsibilities into focused files.

No open issues 🎉

Review effort: Balanced

@Evangelink
Amaury Levé (Evangelink) marked this pull request as ready for review November 24, 2026 20:16
@github-actions github-actions Bot added the state/needs-review Awaiting review from the team. label Nov 24, 2026

@github-actions github-actions Bot 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.

Note

🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.

Result: no actionable findings.

Scope: a structural split of TestHostBuilder.Modes.cs into .InvocationLifetime.cs, .Orchestration.cs and .TestHostMode.cs, for 4 files total.

Evidence:

  • I ran git diff --color-moved with whitespace ignored. Every code line removed from Modes.cs reappears in one of the three new files. The only non-moved lines are the new file headers, usings, namespace and partial-class wrappers.
  • The new files carry the license header and a UTF-8 BOM, use file-scoped namespaces, and keep internal sealed partial class TestHostBuilder.
  • There is no public API or PublicAPI.*.txt impact, and no resource, localization or CLI-option changes.
  • The using directives left in Modes.cs appear to be the ones its remaining code needs. I could not confirm this by compiling.

Not verified:

  • I could not run a build here because the sandbox denied execution, so I did not confirm that the unused-using analyzers (IDE0005) are clean.
  • I did not run the unit tests. They exist in the repo and should cover this refactor.
  • I did not read the new files' contents beyond the diff comparison. I saw no behaviour change in the moved code, but I did not rule out subtle changes such as member accessibility or ordering by reading it line by line.

Test-value evidence: this is a behavior-preserving refactor. Executed before/after evidence is unavailable; CI green on the unchanged existing unit and acceptance tests is the expected proof.

@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 24, 2026
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 24, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 24, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. labels Nov 24, 2026
@Evangelink
Amaury Levé (Evangelink) merged commit df00862 into main Nov 24, 2026
41 of 48 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the copilot/refactor-testhostbuilder-modes branch November 24, 2026 22:16
@microsoft-github-policy-service microsoft-github-policy-service Bot removed the state/approved Proposal approved; ready for implementation. label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[file-diet] Refactor TestHostBuilder.Modes.cs (550 lines) into focused files

4 participants