In failed build limit reactor summary to only failed modules#12330
In failed build limit reactor summary to only failed modules#12330slawekjaranowski wants to merge 1 commit into
Conversation
When build fail in multimodule project we need scroll many lines to see whats is wrong based on: apache#11977
gnodet
left a comment
There was a problem hiding this comment.
Review Summary
This PR implements a useful UX improvement: in failed multi-module builds, the reactor summary is condensed to show only the failed modules with ... ellipsis markers replacing successful/skipped modules. The formatBuildTime extraction is a nice refactoring that eliminates code duplication, and the changes are correctly applied to both the compat and impl copies.
However, the ellipsis logic has a gap in the multi-failure scenario.
Issue: missing ellipsis between non-adjacent failures
In a --fail-at-end build with modules M1(root,success), M2(fail), M3(success), M4(success), M5(fail), M6(skipped), M7(skipped):
The ... separator is only printed when project.isExecutionRoot() is true inside the shouldSkip block. Since only M1 is the execution root, the output would be:
...
M2 .................. FAILURE [1.234 s]
M5 .................. FAILURE [0.567 s]
...
Modules M3 and M4 (which succeeded between the two failures) are silently dropped with no visual separator. A more informative output would be:
...
M2 .................. FAILURE [1.234 s]
...
M5 .................. FAILURE [0.567 s]
...
Suggested fix: Replace the isExecutionRoot() guard with a "was previous module skipped?" tracking variable:
boolean lastWasSkipped = false;
for (MavenProject project : projects) {
// ... determine shouldSkip ...
if (shouldSkip) {
lastWasSkipped = true;
continue;
}
if (lastWasSkipped) {
logger.info("...");
lastWasSkipped = false;
}
// ... print module line ...
}
if (lastWasSkipped) {
logger.info("...");
}This applies to both the impl and compat copies.
Minor notes
- No test covers the multi-failure (
--fail-at-end) scenario — adding one would validate the ellipsis placement between non-adjacent failures - New test methods use
publicwhile existing tests use package-private (JUnit 5 convention in this codebase)
Overall the feature is valuable — the ellipsis logic just needs refinement for multi-failure correctness.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
Reviewed 3 more PRs: - apache#11743: COMMENT (superseded by apache#12369) - apache#12330: COMMENT (ellipsis gap in multi-failure scenario) - apache#12446: COMMENT (deadlock fix LGTM, own PR can't APPROVE) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Can we make this visual change configuarable? |
When build fail in multimodule project we need scroll many lines to see whats is wrong
based on: #11977
Following this checklist to help us incorporate your
contribution quickly and easily:
Note that commits might be squashed by a maintainer on merge.
This may not always be possible but is a best-practice.
mvn verifyto make sure basic checks pass.A more thorough check will be performed on your pull request automatically.
If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.