You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "laeubi (via GitHub)" <gi...@apache.org> on 2024/03/06 14:35:45 UTC
[PR] MNG-8069 - add failing projects if a project is banned from reactor [maven]
laeubi opened a new pull request, #1435:
URL: https://github.com/apache/maven/pull/1435
Currently if a multimodule build fails (either fast or at the end), the user gets a message in the log that reads:
"This project has been banned from the build due to previous failures."
this is correct but does not give a hint what has failed and one needs to investigate the build logs to get more details.
This now instead shows as part of the message the actual project that make it impossible to build this one and is the reason for this project being banned.
Following this checklist to help us incorporate your
contribution quickly and easily:
- [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG-8069) filed
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
- [x] Each commit in the pull request should have a meaningful subject line and body.
- [x] Format the pull request title like `[MNG-XXX] SUMMARY`,
where you replace `MNG-XXX` and `SUMMARY` with the appropriate JIRA issue.
- [x] Also format the first line of the commit message like `[MNG-XXX] SUMMARY`.
Best practice is to use the JIRA issue title in both the pull request title and in the first line of the commit message.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
be performed on your pull request automatically.
- [ ] You have run the [Core IT][core-its] successfully.
If your pull request is about ~20 lines of code you don't need to sign an
[Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) 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](http://www.apache.org/licenses/LICENSE-2.0)
you have to acknowledge this by using the following check-box.
- [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
- [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
[core-its]: https://maven.apache.org/core-its/core-it-suite/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MNG-8069 - add failing projects if a project is banned from reactor [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #1435:
URL: https://github.com/apache/maven/pull/1435#issuecomment-1987790899
Wouldn't it be better to add the cause when the project is banned rather than trying to reconstruct it later ? I wonder if we should enhance the [`blacklist()` method](https://github.com/apache/maven/blob/0b3246381d12e69deef63888d0db274fb49c6697/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorBuildStatus.java#L49) to be given a cause...
Also, what about providing two slightly different messages, I think it's interesting to know if the project has been skipped because one project has failed (without the fail-at-end flag, do we actually need to display the failing projects for each skipped project, even unrelated ?) or it's actually an upstream project which caused the failure ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MNG-8069 - add failing projects if a project is banned from reactor [maven]
Posted by "laeubi (via GitHub)" <gi...@apache.org>.
laeubi commented on PR #1435:
URL: https://github.com/apache/maven/pull/1435#issuecomment-1987801822
The problem is that if you have a multimodule build (lets say 300 modules) and use multithreading (so build messages are interleaved), and one of the projects fail in the middle you have a huge logfile full of "banned" messages but you need to find out what/where it actually fails, so the message without any context is quite useless and even if you find the erroneous project its not very helpful. So I though showing it at tat time might be more useful.
Another approach would be to simply not display the message at all, and instead give a summary at the end of build, e.g. ```
The following projects where not build due to previous failures:
- a (depends on x that failed)
- b
- c (depends on b that was banned)
```
sadly currently this information is somehow spread across some places and I'm not sure why e.g. a listener was used instead of printing the message directly on `blacklist()` ...
regarding `fae`/`ff` I think we can add such message of course but I didn't wanted to complicate things for a first draft, if you think its usefull I think it is quite easy to add,
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MNG-8069] add failing projects if a project is banned from reactor [maven]
Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on code in PR #1435:
URL: https://github.com/apache/maven/pull/1435#discussion_r1527655423
##########
maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java:
##########
@@ -243,10 +246,44 @@ public void projectSkipped(ExecutionEvent event) {
if (logger.isInfoEnabled()) {
logger.info("");
infoLine('-');
+ MavenSession session = event.getSession();
+ MavenExecutionResult result = session.getResult();
+ ProjectDependencyGraph projectDependencyGraph = session.getProjectDependencyGraph();
+ List<MavenProject> upstreamProjects;
+ if (MavenExecutionRequest.REACTOR_FAIL_AT_END.equals(session.getReactorFailureBehavior())
+ && projectDependencyGraph != null) {
+
+ // the project is blacklisted only so one of its upstreams must have failed here...
+ upstreamProjects = projectDependencyGraph.getUpstreamProjects(event.getProject(), true);
+ } else {
+ // any other failure must have lead to this so any projects is eligible
Review Comment:
are eligible
##########
maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java:
##########
@@ -243,10 +246,44 @@ public void projectSkipped(ExecutionEvent event) {
if (logger.isInfoEnabled()) {
logger.info("");
infoLine('-');
+ MavenSession session = event.getSession();
+ MavenExecutionResult result = session.getResult();
+ ProjectDependencyGraph projectDependencyGraph = session.getProjectDependencyGraph();
+ List<MavenProject> upstreamProjects;
+ if (MavenExecutionRequest.REACTOR_FAIL_AT_END.equals(session.getReactorFailureBehavior())
+ && projectDependencyGraph != null) {
+
+ // the project is blacklisted only so one of its upstreams must have failed here...
Review Comment:
I can't quite follow this comment, please rephrase
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MNG-8069] add failing projects if a project is banned from reactor [maven]
Posted by "gnodet-bot (via GitHub)" <gi...@apache.org>.
gnodet-bot commented on code in PR #1435:
URL: https://github.com/apache/maven/pull/1435#discussion_r4181657282
##########
maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java:
##########
@@ -243,10 +246,44 @@ public void projectSkipped(ExecutionEvent event) {
if (logger.isInfoEnabled()) {
logger.info("");
infoLine('-');
+ MavenSession session = event.getSession();
+ MavenExecutionResult result = session.getResult();
+ ProjectDependencyGraph projectDependencyGraph = session.getProjectDependencyGraph();
+ List<MavenProject> upstreamProjects;
+ if (MavenExecutionRequest.REACTOR_FAIL_AT_END.equals(session.getReactorFailureBehavior())
+ && projectDependencyGraph != null) {
+
+ // the project is blacklisted only so one of its upstreams must have failed here...
+ upstreamProjects = projectDependencyGraph.getUpstreamProjects(event.getProject(), true);
+ } else {
+ // any other failure must have lead to this so any projects is eligible
+ upstreamProjects = session.getProjects();
+ }
+ // now collect all failing projects order by their ID
Review Comment:
📝 Nit: missing past participle — "order" → "ordered".
```suggestion
// now collect all failing projects ordered by their ID
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org