Open FichteFoll opened 2 years ago
Hotfix start works only for production or one of the support branches, and hotfix finish acts differently if hotfix was started from support branch. How finish goal will look if hotfix was started from the tag?
Good question. The successful Git branching model does not consider hotfix releases for older minor releases at all and only allows creating hotfix branches from master
. That becomes a problem when your latest version is 2.1.0 but you need to provide a fix for the previous major version 1.10.1. The target hotfix version would be 1.10.2 but the model does not consider this case.
For a different toolchain (npm), we simply start a hotfix branch from the 1.10.1 tag and when finishing up the hotfix, we do not merge the hotfix automatically and instead leave that decision and action to the developer. The advantage of that is that you can easily resolve merge conflicts that an automatic merge would not be able to (and for older releases we always have those due to our in-repo changelog) and you'd also need to manually determine whether the fix needs to be upstreamed to one or multiple later minor/major branches, e.g. whether 2.0.x also needs a hotfix with the same change.
@FichteFoll So, no hotfix finish goal for hotfix branches started from a tag? Do you need this plugin at all to create branch from a tag? Seems that is all you get from hotfix start goal, right?
The plugin is also responsible for updating the version in pom.xml
, but that is indeed the only thing we need it for when doing hotfixes.
In our workflow, we do not maintain support branches but instead just tag releases when they are out (and then build a release from them). Unfortunately, starting a hotfix branch from a tag that does not have a branch does not work and the plugin refuses to complete the goal because it only expects a branch name in this field.
I would actually go ahead and suggest to rename
fromBranch
to or add an additionalfromRef
parameter that would accept any git ref, including a commit SHA-1, because that way you can use this goal inside CI and have it start a hotfix branch from any specific commit.