Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-8069] add failing projects if a project is banned from reactor #1435

Open
wants to merge 1 commit into
base: maven-3.9.x
Choose a base branch
from

Conversation

laeubi
Copy link

@laeubi laeubi commented Mar 6, 2024

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:

  • Make sure there is a JIRA issue 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.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MNG-XXX] SUMMARY,
    where you replace MNG-XXX and SUMMARY with the appropriate JIRA issue.
  • 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.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • 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 successfully.

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.

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.
@gnodet
Copy link
Contributor

gnodet commented Mar 11, 2024

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 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 ?

@laeubi
Copy link
Author

laeubi commented Mar 11, 2024

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,

@elharo elharo changed the title MNG-8069 - add failing projects if a project is banned from reactor [MNG-8069] add failing projects if a project is banned from reactor Mar 18, 2024
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...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't quite follow this comment, please rephrase

// 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are eligible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants