Skip to content
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

version is not working properly on prerelease #149

Open
kaankoken opened this issue Sep 25, 2023 · 6 comments
Open

version is not working properly on prerelease #149

kaankoken opened this issue Sep 25, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@kaankoken
Copy link

kaankoken commented Sep 25, 2023

Describe the bug

I think version is not bump prerelease versions correctly & does not display the correct current version as well.

To Reproduce

  1. I have started the tag with v0.2.2.
  2. I commit a some changes that does not in the convention.
  3. Then, I used convco to get next prerelease:
echo "version=$(convco version --bump --prerelease rc)" >> "$GITHUB_OUTPUT"
# version  `v0.2.2-rc.1`
  1. I tag the commit with the given new prelease tag. Also, I run version
# Current version is not correct, should be v0.2.2-rc.1
convco version # v0.2.2
  1. I add a commit fix: test
  2. I run the command again on step 3
# version `v0.2.3-rc.1`
  1. I repeated step-3 & step-4 with a new commit fix: test1
# Result again is same
# version `v0.2.3-rc.1`

Also run the. version again.

# Current version is still not correct, should be v0.2.3-rc.1
convco version # v0.2.2

Expected behavior
I was excepting to bump a version as v0.2.2-rc.2, v0.2.2-rc.3 not as a new version & not bumping at all.
Also current version should change as well.

System (please complete the following information):

  • OS: MacOS, Ubuntu
  • Version: 13.4.1, 22.04

Additional context
image

@kaankoken kaankoken added the bug Something isn't working label Sep 25, 2023
@hdevalke
Copy link
Collaborator

I have to test this out.

I think there is a bug that when there is a tag v0.2.2 the bump pre-release should always be 0.2.3-rc.1 or 0.3.0-rc1.

I am not sure what should be the behavior if there are no fix/feat or breaking changes.

@kaankoken
Copy link
Author

Is there a way to add/introduce custom config so that parse other commits used as patch/minor/major?

@hdevalke
Copy link
Collaborator

Additional types are not mandated by the Conventional Commits specification, and have no implicit effect in Semantic Versioning (unless they include a BREAKING CHANGE)

Not implemented as not in the spec.

@hdevalke
Copy link
Collaborator

hdevalke commented Oct 14, 2023

Sorry to answer late, but i don't have much free time.
I see indeed that it does not do what is expected.

#!/bin/env sh
set -x
rm -rf .git
convco version
git init .
convco version
git commit --allow-empty -m 'hotfix: correct ..'
convco version
git tag v0.2.2
convco version
git commit --allow-empty -m 'chore: release'
git commit --allow-empty -m 'perf: use precompiled binary'
convco version --bump --prerelease rc

The last output is indeed 0.2.2-rc.1 where this should be 0.2.3-rc.1 as 0.2.2 has already been released.
I will debug further and try to fix it

@hdevalke
Copy link
Collaborator

I think that in this case the issue is that there is no commit that increments the version by convention.
Maybe in this case, there should exit with an error, or it should bump to the next patch release?

@hdevalke
Copy link
Collaborator

For point 7 I cannot reproduce.
Which version of convco do you use @kaankoken ?

#!/bin/env sh
set -x
rm -rf .git
convco version
git init .
convco version
git commit --allow-empty -m 'hotfix: correct ..'
convco version
git tag v0.2.2
convco version
git commit --allow-empty -m 'chore: release'
git commit --allow-empty -m 'perf: use precompiled binary'
convco version --bump --prerelease rc
git tag "v$(convco version --bump --prerelease rc)"
convco version
git commit --allow-empty -m 'fix: test'
convco version --bump --prerelease rc
git tag "v$(convco version --bump --prerelease rc)"
git commit --allow-empty -m 'fix: test'
convco version

The last command prints 0.2.3-rc.1 as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants