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

How to increment major and minor version #56

Open
maksim-wezaam opened this issue Jul 21, 2023 · 5 comments
Open

How to increment major and minor version #56

maksim-wezaam opened this issue Jul 21, 2023 · 5 comments
Assignees
Labels

Comments

@maksim-wezaam
Copy link

Hey folk, I found your nice plugin and wanted to try it. After execution mvn ci-friendly-flatten:version using version 1.0.0 I noticed that it increments patch version to 1.0.1. I wonder how to increment major and minor versions. Checking the code I don't see it's possible to do (e.q. using a config)
https://github.com/outbrain/ci-friendly-flatten-maven-plugin/blob/e7d7b07ad9b059f834e3affa2e847dcf67bb247c/src/main/java/com/outbrain/ci/friendly/flatten/maven/plugin/VersionMojo.java#L120C18-L120C35

Thanks

@ayoukhananov
Copy link
Contributor

Hi @maksim-wezaam
Thanks for your question .
Currently its not supported we just increment the minor version .
The workaround for this is - create new commit with new tag of the required version .

There are two options:

  1. Support increment major and minor - which will require new flags to be provided
  2. Provide the new version you would like to move for example from 1.0.0 to new version 5.0.0 - in this case it would be much more flexible .

Looking forward to hear back...

@ayoukhananov ayoukhananov self-assigned this Jul 23, 2023
@maksim-wezaam
Copy link
Author

Hey @ayoukhananov, yeah I was thinking to have a param. I've tested it and created the MR #57, please check.

@ahadadi
Copy link
Collaborator

ahadadi commented Jul 25, 2023

@maksim-wezaam the most flexible solution is option 2 that @ayoukhananov suggested - provide the new version as a parameter (-DnewVersion=). Would that work for you?
If it would then I would prefer implementing that option.

@maksim-wezaam
Copy link
Author

That possible but in this case we have to manually detect the new version. It's ok for major versions because it's rare operation. Following to semantic versioning we should update MINOR version for a new feature and it's frequent operation. Having the param in the pom that I suggested we can define what we want to update and the plugin will do the job to automatically bump a desired version.
Of course we are humans and will forget to set it properly ))) To avoid that we were thinking to detect it from commit messages. I mean if we put a special keyword in a commit message then the plugin could parse it and define what to update. But again we are humans... Another way is to use branch names. If we use prefixes for branches like feature/ bugfix/ then it's easy to detect. I didn't check it yet if it's possible to implement.

@makcon
Copy link
Contributor

makcon commented Jul 26, 2023

I've integrated it into our pipeline, thanks!
Later, I will try to research how to detect a version based on the message or branch I mentioned above.

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

No branches or pull requests

4 participants