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-6529 - ProjectBuild.build(projectsList, ...) ignores request.isResolveDependencies() #193

Merged
merged 1 commit into from Dec 26, 2018

Conversation

mickaelistria
Copy link
Contributor

@mickaelistria mickaelistria commented Nov 27, 2018

This adds a (failing) unit test showcasing that ProjectBuilder.build(List projects, boolean, ProjectBuildingRequest) doesn't honor ProjectBuildingRequest.isResolveDependencies().
And then it adds a fix that turns the test green.

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] - Fixes bug in ApproximateQuantiles,
    where you replace MNG-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in 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.

@mickaelistria mickaelistria changed the title MNG-6529 - JUnit Test showcasing the bug MNG-6529 - ProjectBuild.build(projectsList, ...) ignores request.isResolveDependency() Nov 27, 2018
@slachiewicz
Copy link
Member

Build ok https://builds.apache.org/view/M-R/view/Maven/job/maven-box/job/maven/job/MNG-6529/

@mickaelistria
Copy link
Contributor Author

@slachiewicz Is there anything else I should do to influence this to get in 3.6.1 (and even a 3.5.4 if possible)?

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

Awesome work.
Can you add the test as I am suggesting?

@@ -30,7 +32,8 @@
public class ProjectBuilderTest
extends AbstractCoreMavenComponentTestCase
{
protected String getProjectsDirectory()
@Override
protected String getProjectsDirectory()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: remove spaces

MavenSession mavenSession = createMavenSession( null );
ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
configuration.setRepositorySession( mavenSession.getRepositorySession() );
configuration.setResolveDependencies(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a test in which this is false and assert that resolution actually does not happen ?

@mickaelistria
Copy link
Contributor Author

Do you prefer an extra commit or should I squash them all in a single one?

@rfscholte
Copy link
Contributor

squash please

@hboutemy
Copy link
Member

hboutemy commented Dec 9, 2018

notice I updated the code in the branch
and I liked the 2 commits: one for failing test then the fix...

@mickaelistria
Copy link
Contributor Author

Squashed, whitespace issue fixed, extra test added for request.isResolveDependency() == false.

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

+1
Looks good to me

@@ -84,4 +87,39 @@ public void testVersionlessManagedDependency()
// this is expected
}
}

public void testResolveDependencies() throws Exception {
Copy link
Member

Choose a reason for hiding this comment

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

please format unit tests with common style: this will improve maintenance

@hboutemy
Copy link
Member

notice that the commit message should use the right method name: isResolveDependencies(), instead of isResolvedDependency()

@hboutemy hboutemy changed the title MNG-6529 - ProjectBuild.build(projectsList, ...) ignores request.isResolveDependency() MNG-6529 - ProjectBuild.build(projectsList, ...) ignores request.isResolveDependencies() Dec 17, 2018
@mickaelistria
Copy link
Contributor Author

@hboutemy Thanks, I updated the change according to your comments (I could have missed some style stuff though).

@hboutemy
Copy link
Member

sorry, I completely overlooked your answer
MNG-6529 branch on official maven.git repo updated, waiting for the Jenkins job to finish, then I'll get the consensus to merge on master
Thank you and Merry Christmas

@asfgit asfgit merged commit 732e7de into apache:master Dec 26, 2018
pzygielo pushed a commit to pzygielo/maven that referenced this pull request Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants