Skip to content

Refactor AzureDevOpsTestResultsPublisher into focused partial classes#8833

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/file-diet-refactor-azuredevopstestresultspublisher
Open

Refactor AzureDevOpsTestResultsPublisher into focused partial classes#8833
Copilot wants to merge 2 commits into
mainfrom
copilot/file-diet-refactor-azuredevopstestresultspublisher

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 4, 2026

AzureDevOpsTestResultsPublisher.cs had grown into a large mixed-responsibility file, making the live publishing flow harder to navigate and review. This change keeps the type and behavior intact while splitting the implementation into focused partials within the Azure DevOps report extension.

  • Split by responsibility

    • Kept the main AzureDevOpsTestResultsPublisher.cs file focused on lifecycle entry points, coordination state, constructors, and public/internal surface area.
    • Moved result construction and attachment shaping into AzureDevOpsTestResultsPublisher.ResultFactory.cs.
    • Moved batching, retry, and upload scheduling into AzureDevOpsTestResultsPublisher.Flush.cs.
    • Moved environment/config resolution and run-name helpers into AzureDevOpsTestResultsPublisher.Configuration.cs.
  • Preserved contract and behavior

    • Retained the same sealed type, now marked partial.
    • Kept method names, visibility, and call flow unchanged.
    • Scoped the refactor entirely to src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/.
  • Result

    • Each partial stays under 300 lines and maps cleanly to one concern, reducing navigation cost and merge pressure on the publisher implementation.
internal sealed partial class AzureDevOpsTestResultsPublisher
{
    public async Task ConsumeAsync(IDataProducer dataProducer, IData value, CancellationToken cancellationToken)
    {
        // lifecycle / coordination remains in the main partial
    }
}
internal sealed partial class AzureDevOpsTestResultsPublisher
{
    internal static AzureDevOpsTestCaseResultWithAttachments? CreateTestCaseResult(TestNode testNode, string automatedTestStorage)
    {
        // result shaping moved into ResultFactory.cs
    }
}

Copilot AI self-assigned this Jun 4, 2026
Copilot AI review requested due to automatic review settings June 4, 2026 19:41
Copilot AI review requested due to automatic review settings June 4, 2026 19:41
@Evangelink Evangelink marked this pull request as ready for review June 4, 2026 19:54
Copilot AI review requested due to automatic review settings June 4, 2026 19:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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.

Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor AzureDevOpsTestResultsPublisher into partial classes Refactor AzureDevOpsTestResultsPublisher into focused partial classes Jun 4, 2026
Copilot AI requested a review from Evangelink June 4, 2026 20:02
await _flushSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
try
{
while (_publishConfiguration is not null && CurrentRunId is not null)
await _flushSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
try
{
while (_publishConfiguration is not null && CurrentRunId is not null)
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 AzureDevOpsTestResultsPublisher.cs (828 lines) into focused partial classes

3 participants