-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
[QUESTION] - does not calculate next patch version #631
Comments
I feel like I'm running into a very similar issue. I'll try to recreate the repo because i'm working on a private one. I'm on a branch, testing this out. I'm trying to create the next pre-minor release , after create my first one. To create it the first time, I did:
Now, I had a tag:
My last commit had a
I would think that if I run the top command again, it should bump it, but doing a dry run, it never does:
I don't get if I'm missing a step somewhere to see get the the library to bump the tag. Am I supposed to manually create the tag, or does this handle it? |
I think what happened in my case is that when I pushed my feature branch, it pushed the tag as well. Then I created a PR from my feature branch to a new branch and merged that PR. I think I might have chosen an option to create a new merge PR or may have chosen to squish commits, but in the result the tag didn't point to the right commit and that's what was causing the issue. To fix it, I manually deleted the tag on the remote and re-created it pointing to the right commit. After that it was able to figure out right version. I feel like this repo needs to provide separate set of instructions on using this repo with git workflow. |
Thanks for replying back @DmitryEfimenko . I just started testing out NX and this plugin, so I haven't tried merging PRs. What I am doing is working on a "release candidate" branch, instead of "main". Our git workflow is:
So in my example above, just for testing, I'm treating the 'BDVP-3150-integrated-repo' branch as a 'release-candidate' branch. So that's why I want to make sure this plugin could handle creating the version and tag and pushing it out for us. It seems to work the first time and it creates the tag, but no matter what I try, the current tag isn't being picked up so then the next one isn't being created properly. Any help would be appreciated. Thanks again. |
Hi, semver was not designed to work with these types of git flows, we recommend running semver only on the main branch. The problem you are facing is the following: when merging the release-candidate branch into main, it creates a new commit on your main branch, but the tag created by semver points to the old commit (not the one resulting from the merge), so semver cannot reach the tag when you release again. To fix your issue you can write a script that find tags present on the release-candidate branch, and force update them to point to the main branch whenever you merge, so semver will detect them. |
thanks for the reply! The git workflow is a common practice. Do you think the functionality you described would be a good feature for this library? |
I used git flow before and I'm not a fan, I prefer having as less branches as possible. In fact, when we created semver, we followed the continuous integration pattern, that's why it is a bit opinionated on the branching model. Changing this would require introducing dirty hacks, and I'm not sure it's worth it. That says I know some users are facing this issue, and I'm planning to rewrite semver totally, it may be the occasion to rethink how things work so it can be easier to support different workflows. |
Thanks for the clarification @edbzn. |
I've read the description of the project and quite a bit of other issues to understand that the version is calculated based on tags. From what I can see I have the right tags in place. And I have one "docs" commit that's pending the release. However, it does not seem to be able to calculate next tag:
I saw that some people may have some difficulties depending on the git workflow. I'm running this command off of a feature branch. Not main. Not sure if it has anything to do with anything.
I also tried adding
releaseAs=patch
and--allowEmptyRelease=true
but there was no difference.Here's the repo where I'm running this in case you need to see the configuration.
I'm sure I'm doing something silly and missing something simple. But I spent a whole day trying to figure this one out. Any help is appreciated!
The text was updated successfully, but these errors were encountered: