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

Refactor MavenCli.populateRequest #351

Closed

Conversation

mthmulders
Copy link
Contributor

@mthmulders mthmulders commented May 24, 2020

While working on the resume feature (#342) I noticed that the MavenCli#populateRequest method is very long and a bit unstructured. It follows all types of patterns for parsing and processing command line arguments and populating the MavenExecutionRequest.

I've refactored this method step-by-step. Hence there are a lot of small(ish) commits but I hope this makes it easier to review the changes and verify they don't break anything. The method itself is not easily testable so I couldn't rely on that. Where possible I created a few unit tests.

There are some bits & pieces left:

  • The determineProjectActivation and determineProfileActivation methods are very much alike. We could merge them but it would lose quite some semantics, so I initially decided not to do so.
  • The determineLocalRepositoryPath only uses information from the MavenExecutionRequest itself. I wonder if we could move it into the DefaultMavenExecutionRequest, but I'm unsure where / how exactly.

Checklist

  • 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.

I have signed the Individual Contributor License Agreement, and my employer signed the Corporate Contributor License Agreement.

@mthmulders mthmulders marked this pull request as ready for review May 25, 2020 06:57
@rfscholte
Copy link
Contributor

Can't apply this patch anymore, please rebase

@mthmulders mthmulders force-pushed the refactor-mavencli-populaterequest branch from 1aa73fc to 8ac313e Compare July 16, 2020 19:22
@mthmulders
Copy link
Contributor Author

Can't apply this patch anymore, please rebase

Just rebased against current state of master branch.

@mthmulders mthmulders force-pushed the refactor-mavencli-populaterequest branch from 8ac313e to a2e36c3 Compare September 19, 2020 19:17
Copy link
Contributor

@MartinKanters MartinKanters left a comment

Choose a reason for hiding this comment

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

LGTM! @rfscholte were you done reviewing as well? I can merge it then tomorrow (or @mthmulders if he wants to)

@mthmulders
Copy link
Contributor Author

Merged in ac80f5c.

@mthmulders mthmulders closed this Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants