Replies: 2 comments 3 replies
-
Hey @arabold, great to hear that, thanks. I can't really say without knowing what other rules you have in place, but I can share a few thoughts and especially experiences related to implementing the version from branch feature. As you are probably familiar, the version from branch feature allows you to take either the major or major+minor version from the branch name, and ignores any tags which do not match it, using only tags which start with the same major or major and minor version as the branch name ends with. This does sound a bit similar to what you are trying to do. I spent quite a long time before implementing this trying to figure out a way to do purely branch based versioning, but could not come up with a solution. I finally realized it was not possible, and the reason for this is that branches move. There is not a stable commit associated with a branch the way there is with tags, nor a way to determine what path a branch has taken. If you are able to include the version with the branch name (e.g. Keep in mind too, that this action is merely providing information, you are free to do whatever you want with it and there's nothing that says you can't call the increment the minor version, ignore or override any value you wish, run the action multiple times, etc. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback. I was thinking about possible solutions for the last 4 days, but I think my preferred feature would be to allow custom formatting of the version (tag). Currently the action uses a simple regular expression to find the latest tags. This expression is more or less hardcoded. If I use a prefix or a namespace, that is simply added to the regex to limit the search space. What I'm suggesting is the following:
With a logic like this we would get a lot more flexibility on how the version is formatted while potentially simplifying the options (remove tag prefix, namespace, namespace separator). Or, if we keep those params, the regex builder would simply need to support parsing them and this would be the default version format: |
Beta Was this translation helpful? Give feedback.
-
Hello! Let me first thank you for this action as it has been a tremendous help in the last half year we've been using it.
Our branching strategy, however, is somewhat special:
main
- this is the main branch which will automatically be deployed to our development environment. Any push in this version will increase the "MINOR" version number automatically, v1.1.0, v1.2.0, v1.3.0, etc.release/customer-a
- to release a version for a specific customer ("Customer A") we merge themain
branch into a dedicated release branch. For this branch we want to increment the "PATCH" version:v1.2.1
,v1.2.2
,v1.2.3
, etc. based on the original versionv1.2.0
that was in merged from themain
branch. However, incrementing the PATCH version isn't critical, but would be helpful.release/customer-b
- the same is true for a second customer. Only the patch version should increment.release/customer-c
- and the third one and so forth...For a single customer release branch this works perfectly fine. We create a git tag for every version we create. However, you can probably already see the issue:
customer-a
could have a versionv1.2.1
and the release forcustomer-b
could be based on the same version frommain
, also resulting in av1.2.1
. This will lead to a conflict in the git tag and an error.My first idea would be to use namespaces to solve this. Each customer would get its own namespace. But that leads to the versioning scheme being completely independent between customers, which we don't want either. I want to know that v1.2.x is deployed for both customer A and customer B. I don't wont completely independent version numbers.
True, this seems like a somewhat convoluted concept and maybe you're right... But it is what I'm stuck with right now. Any ideas or suggestions how this could be solved? If I could add some kind of identifier, i.e. the customer ID, to the tag name it would avoid conflicts. But if I simply use namespaces the version count starts with zero for each release branch/each customer, which is not desired.
Beta Was this translation helpful? Give feedback.
All reactions