feat/v2-logging: Name outcome and situation on every summary log line#21
Merged
vedanthvdev merged 1 commit intomasterfrom Apr 22, 2026
Merged
feat/v2-logging: Name outcome and situation on every summary log line#21vedanthvdev merged 1 commit intomasterfrom
vedanthvdev merged 1 commit intomasterfrom
Conversation
Every `affectedTest` run previously printed one of two summary lines
— a runAll variant that named the escalation reason, or a non-runAll
variant that listed counts — and a separate side-line for SKIPPED
outcomes. Operators had to grep across both forms and infer the
outcome from context, and SKIPPED runs carried the outcome name
("SKIPPED") only in a follow-up log that used different vocabulary
from the main summary.
This change rewrites `renderSummary` to produce one unified shape:
`Affected Tests: <OUTCOME> (<SITUATION>) — <details>`, with three
branches for SELECTED, FULL_SUITE, and SKIPPED. The outcome and
situation are first-class fields on every run so CI dashboards can
bucket runs with a single grep (`^Affected Tests: (SELECTED|FULL_SUITE|SKIPPED)`)
and the reader always sees which of the six situations the engine
resolved to. Every pre-v2 phrase ("running full suite",
"runAllIfNoMatches=true", "runAllOnNonJavaChange=true",
"no affected tests discovered") still appears verbatim in the reason
segment so existing greps keep working. A new `describeSkipReason`
helper mirrors `describeEscalation` to give each SKIPPED situation a
distinct phrase (e.g. "every changed file matched ignorePaths" vs
"every changed file sat under out-of-scope dirs"), and the now-
redundant "Skipping test execution (…)" follow-up line is removed
since the summary already carries that information. The README grows
a Summary log format section with samples for all three branches, and
the log-format test suite gains coverage for the new prefix on every
branch, each SKIPPED reason phrase, and the DISCOVERY_SUCCESS guard
in `describeSkipReason`.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the last open Phase 1 follow-up from
docs/DESIGN-v2.md§0 — the summary log format now names the outcome (SELECTED/FULL_SUITE/SKIPPED) and the situation on every run, so CI dashboards and operators can bucket runs without parsing the tail of the line.Before
Two summary shapes, no outcome name on the SELECTED branch, and SKIPPED was a follow-up line with different vocabulary.
After
One unified shape —
Affected Tests: <OUTCOME> (<SITUATION>) — <details>— across all three branches.What changed
AffectedTestTask.renderSummaryrewritten to three explicit branches (runAll / skipped / selected), each prefixed with<OUTCOME> (<SITUATION>) —.describeSkipReason(Situation)helper mirrors the existingdescribeEscalationso every SKIPPED situation has a distinct phrase:EMPTY_DIFF→ no changed files detectedALL_FILES_IGNORED→ every changed file matched ignorePathsALL_FILES_OUT_OF_SCOPE→ every changed file sat under out-of-scope dirsUNMAPPED_FILE→ onUnmappedFile=SKIPPED — non-Java or unmapped file in diffDISCOVERY_EMPTY→ no affected tests discoveredDISCOVERY_SUCCESS→ throws (engine contract violation)"Skipping test execution ({}: {})."side-line was duplicating what the new summary now carries, so it's gone. The defensive "No affected tests to run. Skipping test execution." fallback is also silenced — the engine should already route that throughDISCOVERY_EMPTY/SKIPPED, and the summary line above covers it.README.mdgrows a Summary log format section with concrete samples for all three branches and a note on which pre-v2 phrases are preserved.Backward compatibility
Every pre-v2 CI-grep phrase still appears verbatim in the reason segment:
running full suite✓runAllIfNoMatches=true✓runAllOnNonJavaChange=true✓no affected tests discovered✓no changed files✓production class(es)/test class(es)/changed file(s)✓This change is purely additive on the log string — it prefixes every line with
OUTCOME (SITUATION) —and expands the SKIPPED branch from a follow-up line into the summary. No existing grep should break.Tests
AffectedTestTaskLogFormatTestgains four new cases:summaryPrefixNamesOutcomeAndSituationOnEveryBranch— pins the new prefix for SELECTED / FULL_SUITE / SKIPPED.skippedBranchNamesReasonPhraseForEachSituation— iterates every non-DISCOVERY_SUCCESS situation and asserts the matching phrase is present.describeSkipReasonRejectsDiscoverySuccess/describeSkipReasonRejectsNull— enforce the engine contract at the helper level.formatPlaceholderCountMatchesArgsLength…guard is generalised to cover all three branches so the SLF4J placeholder/arg contract is validated for the new SKIPPED format too.Test plan
./gradlew check(core + gradletest+functionalTest+validatePlugins) passes locally.running full suite+runAllOnNonJavaChange=true) still matches.