feat: custom version increment strategies#903
Conversation
Allow for version incrementing strategies other than conventional commits. The first example is "always-patch" which completely ignores conventional commits and hard-codes a "patch" level version bump. This strategy is useful in cases where the "major" and "minor" numbers are set by conditions outside the package codebase but the "patch" number is still available for representing changes as a new version.
Codecov Report
@@ Coverage Diff @@
## master #903 +/- ##
===========================================
+ Coverage 77.80% 94.51% +16.70%
===========================================
Files 21 75 +54
Lines 2586 9931 +7345
Branches 194 1047 +853
===========================================
+ Hits 2012 9386 +7374
+ Misses 562 541 -21
+ Partials 12 4 -8
Continue to review full report at Codecov.
|
|
@bcoe and I discussed this possibility a while back: the basic problem is I have several packages that have their major/minor version numbers dictated by outside factors but we do want to increment the patch for any user facing change. We've been working around this with a lot of constant adding/removing/tweaking of While we'll still have to set a I'm open to a different approach if anyone has suggestions: it would be awesome to have some kind of mapping like the |
|
How do you feel about making this more generic? For Java, we have some special version bumping logic which is why we have 3 separate Java releasers (normal - follows conventional commits, bom - take the same bump as a dependency update, lts - follow a specific patch-only scheme). The workflow and the file updates are the same for all 3 of these releasers, just will slightly different rules for how to bump versions. To make it more generic, the interface would be something like: |
|
@chingor13 where would the I've taken a quick look through the java-bom and java-lts releasers and it looks like in each case they completely override Maybe we can meet and talk about how to introduce this feature so it works both for the Java releasers as well as others that still rely on the |
|
sorry, got distracted - been meaning to follow up out of band with @chingor13 to discuss a more generic solution for my needs + Java use cases. |
|
@joeldodge79 👍 will leave it to you and @chingor13 to discuss, let me know when/if my review is needed. |
|
I'd love to figure out how to unblock this work next quarter, perhaps we can have a catch up soonish? Apologies for leaving this to stagnate. |
|
@joeldodge79 okay, @chingor13 has landed his refactor that pulls versioning into its own class. I think it should be a good starting point for you to finally implement this functionality. |
|
The always-bump-patch versioning strategy is built-in to the new refactored version. You can mix and match any language strategy with a versioning strategy. Previously the always-bump-patch semantics were bundled with the |
|
@chingor13 awesome, thanks! could you point me to the code or examples of using |
|
@joeldodge79 okay if we bring this conversation to chat? I think the functionality is likely close to where you need it, and @chingor13 just needs to point you towards it. |
Allow for version incrementing strategies other than conventional
commits. The first example is "always-patch" which completely ignores
conventional commits and hard-codes a "patch" level version bump. This
strategy is useful in cases where the "major" and "minor" numbers are
set by conditions outside the package codebase but the "patch" number
is still available for representing changes as a new version.