-
Notifications
You must be signed in to change notification settings - Fork 50
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
Fix: Issue with the next development version logic. #67
base: master
Are you sure you want to change the base?
Conversation
@doublefx |
arrf, you are right, I don't mind about the credit but mind about that Signed-off :-) |
The |
Should be ok now. |
https://github.com/jfrog/teamcity-artifactory-plugin/commit/e3fa30d0694d9da9e6a78b1b995d6a0ddd9efba2.patch you sure? :) |
The next development version is computed by increment of one, for either the buildNumber when present or the patch version even when those one are set to zero. The current logic does not allow us to use the patch version for hotfixes only. For example, given a current development version 6.144.0-SNAPSHOT, if the logic is to increment the patch version, at release time, the plugin will propose 6.144.1-SNAPSHOT but I need 6.145.0-SNAPSHOT and I will have to manually update the next development version manually and that at every single release. Now, if we change the logic to increment only when it is not zero, I only need to change the next development version when a major change is required, the rest of the time the desired version part will be incremented automatically. The new logic would propose by default, given a strategy: release version ==> next development version : UNKNOWN : 6.0.0 ==> 6.0.1-SNAPSHOT UNKNOWN : 6.1.0 ==> 6.1.1-SNAPSHOT UNKNOWN : 6.0.1 ==> 6.0.2-SNAPSHOT UNKNOWN : 6.1.0-0 ==> 6.1.1-SNAPSHOT UNKNOWN : 6.1.0-22 ==> 6.1.0-23-SNAPSHOT UNKNOWN : 6.1 ==> 6.1.1-SNAPSHOT UNKNOWN : 6 ==> 6.0.1-SNAPSHOT DEFAULT : 6.0.0 ==> 6.0.1-SNAPSHOT DEFAULT : 6.1.0 ==> 6.1.1-SNAPSHOT DEFAULT : 6.0.1 ==> 6.0.2-SNAPSHOT DEFAULT : 6.1.0-0 ==> 6.1.1-SNAPSHOT DEFAULT : 6.1.0-22 ==> 6.1.0-23-SNAPSHOT DEFAULT : 6.1 ==> 6.1.1-SNAPSHOT DEFAULT : 6 ==> 6.0.1-SNAPSHOT IGNORE_ZEROS : 6.0.0 ==> 7.0.0-SNAPSHOT IGNORE_ZEROS : 6.1.0 ==> 6.2.0-SNAPSHOT IGNORE_ZEROS : 6.0.1 ==> 6.0.2-SNAPSHOT IGNORE_ZEROS : 6.1.0-0 ==> 6.2.0-SNAPSHOT IGNORE_ZEROS : 6.1.0-22 ==> 6.1.0-23-SNAPSHOT IGNORE_ZEROS : 6.1 ==> 6.2.0-SNAPSHOT IGNORE_ZEROS : 6 ==> 7.0.0-SNAPSHOT Everything works almost as before except for when the lowest version part is zero.
Can you please check this new patch? |
you can always check yourself :) just click the commit and add Looks alright to me 😆 |
Good one, I did not know the trick, thanks. |
@doublefx, I think that introducing the concept of multiple strategies (DEFAULT, IGNORE_ZEROS and UNKNOWN) can cause some confusion. I'm not sure how easy it will be to explain each strategy and this will probably not satisfy all possible versioning requirements. I suggest going for a simpler approach. Let me know what you think:
Examples:
|
@doublefx, |
The next development version is computed by increment of one, for either the buildNumber when present or the patch version even when those one are set to zero.
The current logic does not allow us to use the patch version for hotfixes only.
For example, given a current development version 6.144.0-SNAPSHOT, if the logic is to increment the patch version, at release time, the plugin will propose 6.144.1-SNAPSHOT but I need 6.145.0-SNAPSHOT and I will have to manually update the next development version manually and that at every single release.
Now, if we change the logic to increment only when it is not zero, I only need to change the next development version when a major change is required, the rest of the time the desired version part will be incremented automatically.
A config parameter "org.jfrog.artifactory.releaseManagement.nextDevelopmentVersionStrategy" that can be set either in the build configuration and / or project configuration, so the nextDevelopmentVersionStrategy can use for only specific projects and / or builds.
When not set, set to "default" or set to unknown, the default nextDevelopmentVersionStrategy is used, when set to "ignore_zeros", it will apply that specific nextDevelopmentVersionStrategy.
The new logic would propose by default, given a strategy: release version ==> next development version :
UNKNOWN : 6.0.0 ==> 6.0.1-SNAPSHOT
UNKNOWN : 6.1.0 ==> 6.1.1-SNAPSHOT
UNKNOWN : 6.0.1 ==> 6.0.2-SNAPSHOT
UNKNOWN : 6.1.0-0 ==> 6.1.1-SNAPSHOT
UNKNOWN : 6.1.0-22 ==> 6.1.0-23-SNAPSHOT
UNKNOWN : 6.1 ==> 6.1.1-SNAPSHOT
UNKNOWN : 6 ==> 6.0.1-SNAPSHOT
DEFAULT : 6.0.0 ==> 6.0.1-SNAPSHOT
DEFAULT : 6.1.0 ==> 6.1.1-SNAPSHOT
DEFAULT : 6.0.1 ==> 6.0.2-SNAPSHOT
DEFAULT : 6.1.0-0 ==> 6.1.1-SNAPSHOT
DEFAULT : 6.1.0-22 ==> 6.1.0-23-SNAPSHOT
DEFAULT : 6.1 ==> 6.1.1-SNAPSHOT
DEFAULT : 6 ==> 6.0.1-SNAPSHOT
IGNORE_ZEROS : 6.0.0 ==> 7.0.0-SNAPSHOT
IGNORE_ZEROS : 6.1.0 ==> 6.2.0-SNAPSHOT
IGNORE_ZEROS : 6.0.1 ==> 6.0.2-SNAPSHOT
IGNORE_ZEROS : 6.1.0-0 ==> 6.2.0-SNAPSHOT
IGNORE_ZEROS : 6.1.0-22 ==> 6.1.0-23-SNAPSHOT
IGNORE_ZEROS : 6.1 ==> 6.2.0-SNAPSHOT
IGNORE_ZEROS : 6 ==> 7.0.0-SNAPSHOT
Everything works almost as before except for when the lowest version part is zero.