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

--pre-release does not work when using custom configuration #98

Closed
LouisRoselli opened this issue Aug 5, 2023 · 8 comments · Fixed by #103
Closed

--pre-release does not work when using custom configuration #98

LouisRoselli opened this issue Aug 5, 2023 · 8 comments · Fixed by #103

Comments

@LouisRoselli
Copy link

The "--pre-release" option does not work correctly when using a custom configuration that has section types defined that aren't "fix" or "feat". "--pre-release" only works for "fix" and "feat". When using other custom defined types normally (NOT using --pre-release), will change the revision number...which is fine for now. Hopefully we can in the future be able to specify in the config if this is a minor or revision change for a specific type. If you have a commit mix of "fix/feat" and your custom type, it works. It just doesn't work if the custom type is the only commit. See examples below.

Project version used for all examples: "3.0.0"

Example Config for ".versionize":

{
  "changelog": {
    "header": "Version Release Notes",
    "sections": [
        {
            "type": "feat",
            "section": "✨ Features",
            "hidden": false
        },
        {
            "type": "fix",
            "section": "🐛 Bug Fixes",
            "hidden": false
        },
        {
            "type": "ci",
            "section": "👷‍ Continuous Integration",
            "hidden": false
        }
    ]
  }
}

Example using --pre-release (Does NOT Work):

git commit -a -m "ci: performance improvements"
versionize --pre-release "alpha"

Semantic versioning conflict: the next version 3.0.0-alpha.0 would be lower than the current version 3.0.0. This can be caused by using a wrong pre-release label or release as version

Example not using --pre-release (WORKS):

git commit -a -m "ci: performance improvements"
versionize

√ bumping version from 3.0.0 to 3.0.1 in projects
√ updated CHANGELOG.md
√ committed changes in projects and CHANGELOG.md
√ tagged release as 3.0.1

Example using --pre-release (WORKS):

git commit -a -m "ci: performance improvements"
git commit -a -m "fix: Main page wouldn't load"
versionize --pre-release "alpha"

√ bumping version from 3.0.0 to 3.0.1-alpha.0 in projects
√ updated CHANGELOG.md
√ committed changes in projects and CHANGELOG.md
√ tagged release as 3.0.1-alpha.0
@cabauman
Copy link
Contributor

cabauman commented Aug 6, 2023

Hey @LouisRoselli, thanks for reporting. We'll look into a fix.

cabauman added a commit that referenced this issue Sep 16, 2023
insignificant commit didn't bump patch version

closes #98
cabauman added a commit that referenced this issue Sep 16, 2023
insignificant commit didn't bump patch version

closes #98
@LouisRoselli
Copy link
Author

LouisRoselli commented Sep 17, 2023

@cabauman, I appreciate the fast turn around on this, but the issue is still not fixed.

When running the following commands, I still get the same error in versionize 1.19.1:

versionize --ignore-insignificant-commits --pre-release "alpha"

OR

versionize --pre-release "alpha"

Result:

Semantic versioning conflict: the next version 1.0.0-alpha.0 would be lower than the current version 1.0.0. This can be caused by using a wrong pre-release label or release as version

See this sample repo as example: https://github.com/LouisRoselli/Versionize-Test

Screenshot 2023-09-17 at 3 54 05 PM

@cabauman
Copy link
Contributor

Alright, I'll take another look. The snippet that uses ignore-insignificant-commits is expected to fail, but not the other one.

@cabauman cabauman reopened this Sep 19, 2023
@cabauman
Copy link
Contributor

There are no tags in the repo you shared but I assume you have a v1.0.0 tag locally on that release commit?

@LouisRoselli
Copy link
Author

@cabauman sorry about that. I pushed the tags, and yes it's v1.0.0

@cabauman
Copy link
Contributor

Well, that's odd. I got the correct result.

Screenshot 2023-09-19 213313

@LouisRoselli
Copy link
Author

@cabauman I figured it out. A total rookie mistake on my part. It turns out I had Versionize installed globally with the --global option in "dotnet tools", and also locally by specifying it in the manifest file in the repo. The local version was on the newest, but the global installed on my machine was on an older version.

Sorry for the confusion, but this is working as expected. Thank You!!!!

@cabauman
Copy link
Contributor

Awesome! Thanks again for the bug report and the update. We didn't have a test case for that scenario, but we do now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants