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

Hotfix Finish support without parameter hotfixBranch #327

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

basmussen
Copy link

Implementation of ticket #326. This allows to close a hotfix branch in batch mode without specifying the parameter hotfixBranch, if only one hotfix branch is available.

@basmussen basmussen changed the title #326 - Hotfix Finish support without parameter hotfixBranch Hotfix Finish support without parameter hotfixBranch Jan 22, 2022
@@ -154,6 +154,31 @@ public void execute() throws MojoExecutionException, MojoFailureException {
throw new MojoFailureException("Hotfix branch with name '" + branch + "' doesn't exist. Cannot finish hotfix.");
}
hotfixBranchName = branch;
} else if (StringUtils.isBlank(hotfixVersion)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

DISCLAIMER: I'm not a maintainer, so feel free to ignore what I'm saying. 😉

This is basically the same block as in GitFlowReleaseFinishMojo.

I wonder if it makes sense / is possible to avoid the duplicated code by, e.g., having an intermediate layer like AbstractGitFlowFinishMojo, which encloses this functionality. (Although it looks like GitFlowFeatureFinishMojo couldn't benefit from it.)

Copy link

Choose a reason for hiding this comment

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

Abstraction via inheritance is an obvious improvement since you write less code, right? But in many cases inheritance becomes much more inconvenient to maintain, than just copy some code, that has potential to diverge a little in the future.

If any, I would prefer using composition over inheritance everywhere. At least you can interchange the solution with a very less effort.

Copy link
Contributor

Choose a reason for hiding this comment

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

Abstraction via inheritance is an obvious improvement since you write less code, right?

No, but thanks for ELI5. 😉

@levitin
Copy link

levitin commented Aug 4, 2023

@aleksandr-m: Any news on this issue? The solution is already there? Can you review and merge it?

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