[file-diet] Refactor AzureDevOpsSummaryReporter.Lifecycle.cs (537 lines) into focused files
Los mantenedores suelen responder en 1 día
@Evangelink ya está trabajando en esto.
Desde el 6/11/2026.
- #12235 de @copilot-swe-agent — fusionado
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Read AzureDevOpsSummaryReporter.Lifecycle.cs and the behavior-preserving-refactor skill at .github/skills/behavior-preserving-refactor/SKILL.md; inspect the existing AzureDevOpsSummaryReporter.*.cs partials and relevant tests. Move coherent method groups unchanged into focused partial files, checking project includes and consumers. Run focused builds and tests for affected consumers and compare behavior, including duplicate and malformed inputs; finish with each new file under 300 lines or report the remaining size and blocker.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Overview
The file src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsSummaryReporter.Lifecycle.cs has grown to 537 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.Lifecycle.cs - Size: 537 lines
- Language: C#
Structural Analysis
The file is a partial-class slice of internal sealed partial class AzureDevOpsSummaryReporter. From a bounded sample it contains:
OnTestSessionStartingAsync(~line 19): resets state and emits the "requires TF_BUILD" warning.ConsumeAsync(~line 62): consumesTestNodeUpdateMessage, collects timing/dependency metadata, and records rows.OnTestSessionFinishingAsync(~line 179): finalization and summary emission (~190 lines).ClearFlakyRows(~line 366) and trailing helpers for flaky-row/record handling.
Other AzureDevOpsSummaryReporter.*.cs partials (Markdown.*) already exist; this file is the largest remaining slice.
Refactoring Strategy
Proposed File Splits
Based on the bounded structural sample, investigate these provisional splits. Confirm their safety during implementation preflight before moving code:
-
AzureDevOpsSummaryReporter.Lifecycle.cs(kept)- Contents:
OnTestSessionStartingAsync,OnTestSessionFinishingAsync - Responsibility: session start/finish lifecycle
- Contents:
-
AzureDevOpsSummaryReporter.Consume.cs- Contents:
ConsumeAsyncand its local helpers (timing/dependency collection) - Responsibility: ingesting test node updates into rows
- Contents:
-
AzureDevOpsSummaryReporter.FlakyRows.cs(if needed)- Contents:
ClearFlakyRowsand related flaky/record bookkeeping helpers - Responsibility: flaky-row tracking and cleanup
- Contents:
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.
- New
.csfiles must be UTF-8 with BOM.
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 · ~25 AIC · ⌖ ~1 AIC · ⊞ 7.4K · ◷
- expires on Nov 7, 2026, 6:53 PM UTC
- Lenguaje dominante
- C#
- Estrellas
- 1.1k
- Forks
- 312
- Merge medio
- 10 h 13 min
- PR fusionados (30 d)
- 359
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/testfx
-
type/automation type/tech-debt
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
area/assertion needs/triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 42/100
Los mantenedores suelen responder en 1 día
-
type/automation type/test-gap
Dificultad 3/5 Medio día Aptitud para principiantes 15/100
Los mantenedores suelen responder en 1 día
-
The productive version of Microsoft.Testing.Extensions.HangDump must not reference to a preview version of Microsoft.Diagnostics.NETCore.ClientPosiblemente ocupada @Evangelink la tomó hace 11 días. Abiertoarea/dump external/other
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
microsoft/testfx#11981 · 6 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
type/automation type/tech-debt
Dificultad 5/5 Más de una semana Aptitud para principiantes 5/100
Los mantenedores suelen responder en 1 día
Todos los issues de microsoft/testfx
Issues similares
-
needs-triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 76/100
Azure/azure-sdk-for-net#64658 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
dotnet/aspnetcore#70370 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
NethermindEth/nethermind#15684 ·
Los mantenedores suelen responder en 1 día
-
area/ai-assistant squad/flyt
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Altinn/altinn-studio#21798 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
SubtitleEdit/subtitleedit#16699 ·
Los mantenedores suelen responder en 1 día