[file-diet] Refactor AzureDevOpsSummaryReporter.Lifecycle.cs (537 lines) into focused files
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- C#
- Star
- 1.1k
- Fork
- 312
- Merge trung bình
- 10 giờ 39 phút
- Pull request đã merge (30 ngày)
- 349
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/testfx
-
needs/triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[aw] Detection RunsĐang mởagentic-workflows
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 1/100
microsoft/testfx#12224 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs/triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
microsoft/testfx#12205 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
type/automation type/test-gap
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 15/100
Maintainer thường phản hồi trong vòng 1 ngày
-
The productive version of Microsoft.Testing.Extensions.HangDump must not reference to a preview version of Microsoft.Diagnostics.NETCore.ClientCó thể đã có người làm @Evangelink đã nhận 10 ngày trước. Đang mởarea/dump external/other
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
microsoft/testfx#11981 · 6 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/testfx
Issue tương tự
-
needs attention untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3666 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
stryker-mutator/stryker-net#3974 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
JiaFeiMiao-K-Cat/DiscImageStudio#171 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DDOS VulnerbilityĐang mởS: Untriaged
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
DeltaV-Station/Delta-v#6711 ·
Maintainer thường phản hồi trong vòng 1 ngày