Skip to content

Add GitHub Actions summary section selection - #10697

Merged
Amaury Levé (Evangelink) merged 3 commits into
mainfrom
dev/amauryleve/github-summary-sections
Aug 25, 2026
Merged

Amaury Levé (Evangelink) merged 3 commits into
mainfrom
dev/amauryleve/github-summary-sections

Conversation

@Evangelink

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

Copy link
Copy Markdown
Member

Summary

  • add --report-gh-step-summary-sections with composable test-results, slow-tests, coverage, and all values
  • preserve the full summary by default and apply selection to direct and aggregated markdown
  • persist selections in summary fragments, union mixed module requests, and keep legacy fragments at full output
  • update localized resources, help/info expectations, package docs, glossary, API baselines, and focused tests

--report-gh-step-summary on|off remains the emission-policy option. The new selector independently controls rendered content, so future sections can be added additively without changing the emission-policy option.

Validation

  • focused extension unit-project build with binlog
  • Microsoft.Testing.Extensions.UnitTests (net9.0): 1,188 total, 0 failed
  • .\\build.cmd -pack -bl
  • focused HelpInfoAllExtensionsTests and GitHubActionsReportTests: 24 total, 0 failed

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 24, 2026 14:19
@github-actions

This comment has been minimized.

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

Review Summary

This PR adds a --report-gh-step-summary-sections CLI option to independently select which sections (test-results, slow-tests, or all) are included in the GitHub Actions step summary. The implementation is well-structured and thoroughly tested.

Verdict Table

# Dimension Result
1 Algorithmic Correctness ✅ Clean
2 Threading & Concurrency ✅ N/A — _sections is readonly, set in ctor
3 Security & IPC Contract Safety ✅ N/A
4 Public API & Binary Compatibility ✅ All internal; InternalAPI.Unshipped.txt updated
5 Performance & Allocations ✅ Clean — not a hot path
6 Cross-TFM Compatibility ✅ N/A
7 Resource & IDisposable Management ✅ N/A
8 Defensive Coding at Boundaries ✅ Validation done in command-line provider
9 Error Handling & Diagnostics ✅ Clean — localized error messages
10 Naming & Readability ✅ Clean
11 Test Quality ✅ Comprehensive tests covering parsing, validation, round-trip, aggregation, and section filtering
12 Localization ✅ New resources added, xlf regenerated
13 Documentation ✅ Glossary, PACKAGE.md, and --help expectations updated
14 Configuration & Build ✅ N/A
15 Backward Compatibility ✅ Legacy modules without the field gracefully default to All
16 Extensibility ✅ N/A
17 Logging & Observability ✅ N/A
18 Code Duplication ✅ Clean
19 Scope Discipline ✅ Single-concern PR
20 CLI Options Guidelines ✅ Help/info tests updated; description ends with period
21 Dependency Management ✅ N/A
22 PowerShell & Script Hygiene ✅ N/A

Notes

  • The JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull) on CiRunSummaryModule.GitHubActionsStepSummarySections correctly ensures backward-compatible serialization — older consumers that don't know this property won't see it in the JSON.
  • GetAggregateSections correctly unions selections across modules and falls back to All when any module lacks the field (legacy payload), preserving full output for mixed old/new runs.
  • Test coverage is thorough: parsing edge cases (empty, unknown, case-insensitive, duplicate), section filtering in BuildMarkdown, aggregate union logic, and round-trip through fragment serialization.

No blocking issues found.

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.

Pull request overview

Adds configurable GitHub Actions job-summary sections while preserving full output by default and supporting aggregated runs.

Changes:

  • Adds parsing and validation for test-results, slow-tests, and all.
  • Applies selections to direct and aggregated summaries, including legacy fragment compatibility.
  • Updates tests, localization resources, API baselines, help, and documentation.
Show a summary per file
File Description
GitHubActionsSummaryReporterTests.cs Tests selected and aggregated sections.
GitHubActionsSlowTestReporterTests.cs Verifies notices remain independent.
GitHubActionsCommandLineProviderTests.cs Tests option parsing and validation.
CiRunSummaryAggregationTests.cs Tests fragment persistence and compatibility.
HelpInfoAllExtensionsTests.cs Updates help and info expectations.
CiRunSummaryAggregation.cs Persists section selections.
GitHubActionsResources.zh-Hant.xlf Adds localized resource entries.
GitHubActionsResources.zh-Hans.xlf Adds localized resource entries.
GitHubActionsResources.tr.xlf Adds localized resource entries.
GitHubActionsResources.ru.xlf Adds localized resource entries.
GitHubActionsResources.pt-BR.xlf Adds localized resource entries.
GitHubActionsResources.pl.xlf Adds localized resource entries.
GitHubActionsResources.ko.xlf Adds localized resource entries.
GitHubActionsResources.ja.xlf Adds localized resource entries.
GitHubActionsResources.it.xlf Adds localized resource entries.
GitHubActionsResources.fr.xlf Adds localized resource entries.
GitHubActionsResources.es.xlf Adds localized resource entries.
GitHubActionsResources.de.xlf Adds localized resource entries.
GitHubActionsResources.cs.xlf Adds localized resource entries.
GitHubActionsResources.resx Defines option and validation messages.
PACKAGE.md Documents summary selection.
InternalAPI.Unshipped.txt Updates internal API baseline.
GitHubActionsSummaryReporter.Markdown.cs Filters generated summary sections.
GitHubActionsSummaryReporter.cs Applies and persists selections.
GitHubActionsCommandLineProvider.cs Registers and validates the option.
GitHubActionsCommandLineOptions.cs Implements section flags and parsing.
docs/glossary.md Documents selection behavior.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 27/27 changed files
  • Comments generated: 1
  • Review effort level: Balanced

@Evangelink Amaury Levé (Evangelink) added the state/needs-review Awaiting review from the team. label Aug 24, 2026
@github-actions

This comment has been minimized.

@Evangelink
Amaury Levé (Evangelink) enabled auto-merge (squash) August 25, 2026 07:26
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 68b49221-e76a-4356-a5ac-5e839b04930c
Copilot AI review requested due to automatic review settings August 25, 2026 07:48
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 68b49221-e76a-4356-a5ac-5e839b04930c
@github-actions

Copy link
Copy Markdown
Contributor

🧵 Parallel-safety audit — PR #10697

Parallelization — audited both test assemblies touched by this PR:

Test assembly Scope Workers Analyzer coverage
Microsoft.Testing.Extensions.UnitTests MethodLevel ([assembly: Parallelize(Scope = ExecutionScope.MethodLevel, Workers = 0)] in Program.cs, unchanged by this PR) CPU count coverable once the parallel-safety analyzers ship (attribute-based opt-in)
Microsoft.Testing.Platform.Acceptance.IntegrationTests MethodLevel (same attribute in its own Program.cs, unchanged by this PR) CPU count coverable once the parallel-safety analyzers ship (attribute-based opt-in)

No .runsettings, testconfig.json, .csproj/.props/.targets, or [assembly: Parallelize]/[assembly: DoNotParallelize] changed in this PR — parallelization state is unchanged from before.

Findings: A (global-state) 0 · B (paths) 0 · C (declaration) 0 · D (over-serialization) 0 — by severity: Critical 0 · High 0 · Warning 0 · Info 0.

All five changed test files add only new [TestMethod]s and private helpers; none touch lifecycle members, [ResourceLock]/[DoNotParallelize] declarations, or shared mutable state:

  • CiRunSummaryAggregationTests.cs — two new tests each call a local CreateDirectory() helper that builds Path.Combine(Path.GetTempPath(), $"ci-summary-aggregation-{Guid.NewGuid():N}") and deletes it in a finally. Per-test unique GUID directory — no collision with concurrently-running tests, same pattern as the surrounding pre-existing tests.
  • GitHubActionsCommandLineProviderTests.cs — pure option-parsing/validation tests over local values; no shared or process-global state touched.
  • GitHubActionsSlowTestReporterTests.cs — one new test using the existing CreateReporter/CapturingOutputDevice test doubles; no shared state.
  • GitHubActionsSummaryReporterTests.cs — new tests call the pure BuildMarkdown/BuildAggregateMarkdown statics with locally-constructed records/modules; no I/O, no shared state.
  • HelpInfoAllExtensionsTests.cs — text-only update to expected --help/--info output strings for the new --report-gh-step-summary-sections option; no behavioral test-body change.

Nothing to flag for parallel-safety.

Advisory only — heuristic, non-blocking. Re-run with /parallel-audit. This audit answers "is it parallel-safe?"; for testability, smells, or flakiness see the detect-static-dependencies / test-smell-detection / test-anti-patterns analyses.

🤖 Automated content by GitHub Copilot. Generated by the Parallel-safety audit on PR (on open / sync) workflow. · auto · 58.7 AIC · ⌖ 3.62 AIC · ⊞ 24.8K · [◷]( · ◷)

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.

Review details

  • Files reviewed: 27/27 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Expert test review — PR #10697

GradeTestMutationNotesHow to improve
B (80–89) new GitHubActionsCommandLineProviderTests.
TryParseStepSummarySections_
IsCaseInsensitiveAndDuplicateSafe
3/4 killed Covers case-insensitivity and duplicate-safety, but doesn't assert invalidValue/hasEmptyValue stay unset on the mixed-comma branch. Add a case combining comma- and space-separated duplicates in one argument to kill the split-vs-trim boundary.
A (90–100) new CiRunSummaryAggregationTests.
GitHubFragment_
RoundTripsStepSummarySectionsAsync
4/4 killed Verifies persisted JSON field name, exact round-tripped values, and the parsed aggregate sections. —
A (90–100) new CiRunSummaryAggregationTests.
GitHubFragment_
LegacyPayloadWithoutStepSummarySections_
DefaultsToAllAsync
3/3 killed Confirms the field is absent from legacy JSON and that aggregation defaults to All. —
A (90–100) new GitHubActionsCommandLineProviderTests.
ValidateCommandLineOptionsAsync_
ReturnsValid_
WhenStepSummarySectionsIsUsedWithReportGhAsync
1/1 killed Exercises the valid-combination path for the new sub-option. —
A (90–100) new GitHubActionsCommandLineProviderTests.
ValidateOptionArgumentsAsync_
ReturnsValid_
ForStepSummarySectionsAsync
3/3 killed Data-driven coverage of valid single/combined/case-mixed values via pipe and comma separators. —
A (90–100) new GitHubActionsCommandLineProviderTests.
ValidateOptionArgumentsAsync_
ReturnsLocalizedError_
WhenStepSummarySectionsIsEmptyAsync
2/2 killed Confirms empty/whitespace/trailing-comma inputs produce the localized empty-sections error. —
A (90–100) new GitHubActionsCommandLineProviderTests.
ValidateOptionArgumentsAsync_
ReturnsLocalizedError_
WhenStepSummarySectionIsUnknownAsync
3/3 killed Verifies the exact invalid token is echoed back in the localized error message. —
A (90–100) new GitHubActionsCommandLineProviderTests.
TryParseStepSummarySections_
RejectsEmptySet
2/2 killed Confirms an empty argument list is rejected and reports hasEmptyValue. —
A (90–100) new GitHubActionsCommandLineProviderTests.
GetSections_
DefaultsToAll_
WhenOptionIsAbsent
1/1 killed Confirms the default-to-All behavior when the CLI option is unset. —
A (90–100) new GitHubActionsCommandLineProviderTests.
ToPersistedValues_
AllIncludesCoverage
1/1 killed Confirms the exact ordered set of persisted section names for All. —
A (90–100) new GitHubActionsSlowTestReporterTests.
ScanOnce_
StepSummarySelectionDoesNotSuppressNoticesAsync
2/2 killed Confirms slow-test notice emission is independent of the step-summary section selection. —
A (90–100) new GitHubActionsSummaryReporterTests.
BuildMarkdown_
TestResultsOnly_
OmitsSlowTestsSection
3/3 killed Positive and negative assertions confirm exact test-results table content and absence of the slow-tests block. —
A (90–100) new GitHubActionsSummaryReporterTests.
BuildMarkdown_
SlowTestsOnly_
OmitsTestResultsSection
4/4 killed Confirms slow-tests-only selection omits totals table, failures section, and exit-code callout. —
A (90–100) new GitHubActionsSummaryReporterTests.
BuildMarkdown_
DefaultSections_
IncludeTestResultsAndSlowTests
2/2 killed Confirms the default parameter value includes both sections. —
A (90–100) new GitHubActionsSummaryReporterTests.
BuildAggregateMarkdown_
UnionsSelectionsAcrossModules
3/3 killed Verifies per-module section selections union correctly at the aggregate level. —
A (90–100) new GitHubActionsSummaryReporterTests.
BuildAggregateMarkdown_
CoverageOnly_
OmitsOtherSections
2/2 killed Confirms coverage-only selection omits the test-results and slow-tests sections. —
A (90–100) new GitHubActionsSummaryReporterTests.
BuildAggregateMarkdown_
LegacyModuleWithoutSelection_
DefaultsToAll
2/2 killed Confirms a module with no persisted sections still defaults to showing both sections. —

This advisory comment was generated automatically. Grades are heuristic
and informational — they do not block merging. Suggestions on the Files
changed tab can be applied with one click. Re-run with
/review-tests.

🤖 Automated content by GitHub Copilot. Generated by the Test Reviewer on PR (on open / sync) workflow. · auto · 70.7 AIC · ⌖ 2.42 AIC · ⊞ 16.9K · [◷]( · ◷)

@Evangelink
Amaury Levé (Evangelink) merged commit 111e68f into main Aug 25, 2026
39 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/github-summary-sections branch August 25, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state/needs-review Awaiting review from the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants