[file-diet] Refactor AzureDevOpsSummaryReporter.Markdown.cs (552 lines) into focused partials
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start with src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsSummaryReporter.Markdown.cs and the sibling partials AzureDevOpsSummaryReporter.cs and AzureDevOpsSummaryReporter.Lifecycle.cs, reading the method bodies before moving any code. Check the behavior-preserving-refactor skill for the equivalence checks, then split the proposed Aggregate, History and Formatting partials. Done means each new file is under 300 lines, the affected project builds, and the existing reporter tests pass.
Written by the indexing model from the issue text.
Description
Overview
The file src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsSummaryReporter.Markdown.cs has grown to 552 lines, making it harder to navigate and maintain. This task involves refactoring it into smaller, more focused files.
Current State
- File:
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsSummaryReporter.Markdown.cs - Size: 552 lines
- Language: C#
Structural Analysis
This file is one partial of internal sealed partial class AzureDevOpsSummaryReporter (the other partials live alongside it as AzureDevOpsSummaryReporter.cs and AzureDevOpsSummaryReporter.Lifecycle.cs). Based on the bounded sample (first 100 lines + method signature grep), it contains:
- Per-module markdown building (
BuildMarkdownoverloads, lines ~17-68): builds the Markdown summary for a single module/test run, including status strip and coverage/diagnostics sections. - Aggregate markdown building (
BuildAggregateMarkdown,AppendModuleDiagnostics,HasFailureDetails, lines ~70-293): builds the overall multi-module summary, including failure detail aggregation. - History/trend formatting (
AppendHistoryMarkdown,FormatHistoricalDuration,GetHistoricalFailureRate,GetDurationRatio, lines ~294-364 and ~439-454): renders historical test duration/failure-rate trend data. - Dependency listing (
AppendDependenciesMarkdown, lines ~365-404): renders the module dependency list. - Status strip / duration formatting (
FormatDuration,AppendStatusStrip, lines ~405-438): shared small formatting helpers for pass/fail/skip counts and durations. - Low-level text/markdown utility helpers (
GetQualifiedTestLabel,AppendBlockQuote,FormatTestName,AppendModuleIdentity,EscapeCell,HtmlEncode,HasDuplicateModuleIdentity, lines ~455-552): string escaping, label qualification, and identity formatting used across the other sections.
Refactoring Strategy
Proposed File Splits
Based on the bounded structural sample, investigate these proposed splits. Confirm their safety during implementation preflight before moving code (all remain partial members of AzureDevOpsSummaryReporter, consistent with the existing .Lifecycle.cs partial naming convention):
-
AzureDevOpsSummaryReporter.Markdown.Aggregate.cs- Contents:
BuildAggregateMarkdown,AppendModuleDiagnostics,HasFailureDetails - Responsibility: Building the overall/aggregate multi-module Markdown summary and failure-detail aggregation.
- Contents:
-
AzureDevOpsSummaryReporter.Markdown.History.cs- Contents:
AppendHistoryMarkdown,AppendDependenciesMarkdown,FormatHistoricalDuration,GetHistoricalFailureRate,GetDurationRatio - Responsibility: Rendering historical trend data (duration/failure-rate) and dependency lists.
- Contents:
-
AzureDevOpsSummaryReporter.Markdown.Formatting.cs(if needed)- Contents:
FormatDuration,AppendStatusStrip,GetQualifiedTestLabel,AppendBlockQuote,FormatTestName,AppendModuleIdentity,EscapeCell,HtmlEncode,HasDuplicateModuleIdentity - Responsibility: Shared low-level string/Markdown formatting and escaping utilities used by the other partials.
- Contents:
The original AzureDevOpsSummaryReporter.Markdown.cs would retain the per-module BuildMarkdown overloads as the primary entry point.
Implementation Guidelines
- Establish Equivalence: Follow
.github/skills/behavior-preserving-refactor/SKILL.md. Before editing, read the complete affected bodies, inventory baseline behavior and relevant tests, and identify distinguishing cases. - Preserve Selection and Evaluation: Keep iteration order, short-circuit evaluation, exact type selection, first/last-match semantics, defaults, exceptions, and side effects. Cover reachable duplicate and malformed inputs; similar-looking helpers are not automatically interchangeable.
- Trace All Consumers: Check partial declarations, source-linked consumers, owning/consuming project includes, target-framework guards, and tracked public/internal API surfaces. Keep names, accessibility, attributes, and native interop contracts unchanged.
- Move Before Modernizing: Move bodies unchanged first, one coherent responsibility at a time. Preserve allocation and performance behavior on hot paths; do not mix adjacent modernization or bug fixes into the split.
- Use Focused Checks: Run the smallest affected project/TFM builds and relevant tests before and after each coherent split. Add distinguishing equivalence cases where coverage is missing; a pure file move does not require the full solution. Report exact checks and outcomes, including unavailable checks.
- Surface Constraints: Measure resulting line counts. If a safe structural split cannot meet the size goal without changing semantics, report the remaining size and blocker rather than forcing behavior changes.
Acceptance Criteria
- Original file is split into focused modules
- Each new file is under 300 lines, or a concrete behavior-preservation blocker and remaining size are reported
- Baseline semantics, including reachable duplicate/malformed cases and evaluation order, are preserved by focused equivalence checks
- Relevant builds and tests pass for affected consumers/TFMs; exact checks and any validation gaps are reported
- Public and tracked internal API contracts, attributes, and conditional compilation are preserved
- Project includes, source links, and package layout still include the moved code for every affected consumer
Priority: Medium
Effort: Small
Expected Impact: Improved code navigability, easier testing, reduced merge conflicts
🤖 Automated content by GitHub Copilot. Generated by the Daily File Diet workflow. · copilot · auto · 43.9 AIC · ⌖ 5.2 AIC · ⊞ 13.1K · [◷]( · ◷)
- expires on Oct 18, 2026, 6:58 PM UTC
- Dominant language
- C#
- Stars
- 1k
- Forks
- 314
- Avg merge
- 9h 33m
- Merged PRs (30d)
- 427
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/testfx
-
Allow a trailing CancellationToken parameter on MSTest test methodsPossibly taken @Evangelink claimed this today. Openarea/mstest area/parameterized-tests needs/triage
Difficulty 4/5 3-5 days Newbie friendliness 22/100
Maintainers usually reply within 1 day
-
area/dump needs/triage
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
microsoft/testfx#11981 · 2 comments ·
Maintainers usually reply within 1 day
-
agentic-workflows type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
type/automation type/tech-debt
Difficulty 5/5 Over a week Newbie friendliness 5/100
Maintainers usually reply within 1 day
-
[msbuild-quality] MSBuild File Quality Report — 2026-10-15: missing FileWrites in CopyMSTestV2Resources targetsPossibly taken @YuliiaKovalova claimed this today. Openarea/mtp-msbuild type/automation type/tech-debt
microsoft/testfx#11937 · 1 comment · 1 reaction · 2 assignees ·
Maintainers usually reply within 1 day
All issues in microsoft/testfx
Similar issues
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
elastic/docs-builder#4495 ·
Maintainers usually reply within 1 day
-
ASP.NET Core container quickstart: `docker-run: debug` task sample is missing its closing braceOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
microsoft/vscode-docs#10499 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
🌶️ hot chocolate
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ChilliCream/graphql-platform#10567 ·
Maintainers usually reply within 1 day