-
Notifications
You must be signed in to change notification settings - Fork 10
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
Optionally increase patch version by 1 #72
Comments
Hey! Thanks for trying out the plugin!
The reason we do it is that we want to enable our customers to release concurrently (should they need to). Counting commits guarantees unique versions in the case of 2 PRs merged at the same time (assuming we're releasing every PR). Concrete use case: imagine that you're getting 2 PRs from Dependabot and you rapidly merge them one-by-one. To avoid explosion of commits, we added some magic to try to selectively count GH's "merge PRs". The result is that most of the time we are incrementing by one, even though there may be many commits in the PR. Proof: see the release notes: https://github.com/shipkit/shipkit-auto-version/tags, take a look at version Do you still want to pursue consistent single digit increment? Are you OK with the trade-off? Basically, I want to understand the problem statement better before we commit to this enhancement. Happy to see that you were able to put together a PR in a short time! |
Thanks for your quick feedback, @mockitoguy! :) Our use case differs substantially from Shipkits default because we don't like to release on each commit to main. We often work on the project (JUnit Pioneer) in bursts, which means a bunch of PRs get merged within a few hours. Releasing each of those commits feels pointless. Instead, we work on said bursts and once we're done for the night, we manually kick off a dedicated GitHub Action that uses Gradle/Shipkit to create a release (which, btw, is amazing - thank you for this project! 😍 ). Without sequential versioning, this currently leads to somewhat large jumps in patch versions, like 1.3.0 to 1.3.8 recently. Personally speaking, I find that somewhat confusing. Since this action never runs concurrently, sequential versions are fine, so I'm happy to accept the trade-off. |
Got it. I understand the use case now! I'll review the PR shortly. |
@nipafx, curious, why don't you set up GH action so that it releases when new release tag is pushed? |
That requires somebody to sit in front of a machine with Git to release. Wouldn't be a big problem but given the choice we liked the route via website. Why do you ask, would pushing a tag make a difference here? (I can try to answer it myself: The tag could define the version?) |
Not necessarily - the tag gets automatically created if you create GH release from the UI.
Yes. This gives full control of the version. Do you still prefer an explicit, manually triggered GH action? (if so, please justify because I'll keep asking ;-)) |
And Shipkit GitHub Release will then backfill that release with changelog, binaries, etc?
What would be the simplest way to get the tag as version into Shipkit?
Maybe not. I still think that it makes sense for Shipkit to not enforce a specific (and uncommon) versioning scheme, but if I can duck out, I'm no longer concerned about that. 😉 |
Not yet, but we want to build it (we need this for Mockito and friends). It should be fairly easy. Currently, shipkit-github-release fails when the tag is already present.
Here's a little Groovy hack:
Proper solution will be a part of shipkit-auto-version, ticket: #1
That's fair. Let me think about it a little more. |
If I understand this correctly, these are the options to get sequential versioning:
I may opt for the last one if you think sequential versioning isn't a good fit for Shipkit. In that case I have no need for |
Yeah, I feel that the use case is not strong enough. Feels like clicking GH action to release is a bit off the beaten path. I'd like shipkit-auto-version and shipkit-changelog provide simple, clean support for 2 strong use cases: A) needs #1 and shipkit/shipkit-changelog#97 @nipafx, do you want to take a look at shipkit/shipkit-changelog#97? |
I still mildly prefer kicking off a release builde over creating an empty release and waiting for it to be filled, so I think I'll go with my option 4. (If I didn't miss anything that should already work.) I don't think I will contribute to shipkit/shipkit-changelog#97, but if you're interested I'd like to make |
Interesting! I'm curious, why you prefer to have the release build? (love to understand our customers ;-)
No need, but thanks for asking! We'll take care of it in #1 and there is already a contributor who wants to look into it. |
Because that order just makes more sense to me. Want a release? Kick off a build that does the release. Input: code + version number / Output: artifacts + tag + GitHub release. |
Shipkit auto-versioning-plugin can detect the version to be released on its own, but it increases the patch versions by number of commits since recent release (hence 1.3.0 ~> 1.3.8), which is not what we want. A feature request for incremental increases was declined.[1] ## Options We hence need to define the version externally. The two main options are: 1. pushing a tag and detecting that from Gradle 2. defining it in the manual GitHub Action[2] and passing it to Gradle We didn't discuss preference as 1. does currently not work with Shipkit because the changelog plugin fails to fill in the GitHub release.[3] ## GitHub Action We went with 2., which requires a slight change to the build and a larger change to the documentation in `CONTRIBUTING.md`. ## `version.properties` file Contrary to what the documentation seems to suggest, the file `version.properties` and the `version` property are always needed, even if the property is specified on the command line. We hence keep the file. In the hope that we don't have to keep updating it, we set a bogus version, though. 🤞🏾 [1] shipkit/shipkit-auto-version#72 [2] https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ [3] shipkit/shipkit-changelog#97 Closes: #442 PR: #466
Shipkit auto-versioning-plugin can detect the version to be released on its own, but it increases the patch versions by number of commits since recent release (hence 1.3.0 ~> 1.3.8), which is not what we want. A feature request for incremental increases was declined.[1] ## Options We hence need to define the version externally. The two main options are: 1. pushing a tag and detecting that from Gradle 2. defining it in the manual GitHub Action[2] and passing it to Gradle We didn't discuss preference as 1. does currently not work with Shipkit because the changelog plugin fails to fill in the GitHub release.[3] ## GitHub Action We went with 2., which requires a slight change to the build and a larger change to the documentation in `CONTRIBUTING.md`. ## `version.properties` file Contrary to what the documentation seems to suggest, the file `version.properties` and the `version` property are always needed, even if the property is specified on the command line. We hence keep the file. In the hope that we don't have to keep updating it, we set a bogus version, though. 🤞🏾 [1] shipkit/shipkit-auto-version#72 [2] https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ [3] shipkit/shipkit-changelog#97 Closes: #442 PR: #466
At the moment, this plugin increases the patch number by number of commits, e.g. version 1.3.0 is followed by 1.3.8 if eight commits happened in between. Personally, I prefer for for the patch versions to be sequential, e.g. releasing 1.3.1 after 1.3.0. It would be great if Shipkit offered a configuration option to switch to that behavior.
The text was updated successfully, but these errors were encountered: