absolute-version / commit-and-tag-version

Fork of the excellent standard-version. Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org :trophy:
ISC License
360 stars 33 forks source link

Version bumping not working as expected #163

Open cfoster5 opened 3 weeks ago

cfoster5 commented 3 weeks ago

Description Version bumping is not working as expected

Current behavior I created a new repository with a project that uses Maven. I have followed the conventional commit format for all commits but am seeing minor version bumps for chores and docs commit types.

Expected behavior I would expect chores and docs commit types to bump the patch version, not the minor version.

Additional context Here is the git log for the repo:

e138c25 (HEAD -> feature/cicd) docs: Update readme
7537c2f chore(release): 1.1.0
a9afd3c chore(ci): Remove additional pipeline configs
c868e2f (origin/master, origin/feature/cicd, master) feat: Initial commit

I am using the following to preview the process: npx commit-and-tag-version --packageFiles pom.xml --bumpFiles pom.xml --dry-run. This gives the following output:

√ bumping version in pom.xml from 1.1.0 to 1.2.0
√ created CHANGELOG.md
√ outputting changes to CHANGELOG.md

---
## 1.2.0 (2024-07-02)

### Features

* Initial commit ([c868e2f](https://mycommit.com))
---

√ committing pom.xml and CHANGELOG.md
√ tagging release v1.2.0
i Run `git push --follow-tags origin feature/cicd` to publish
TimothyJones commented 3 weeks ago

What configuration do you have?

Do you have any other types of commits? Chores and docs shouldn’t affect the version at all, so I suspect it’s defaulting to minor (in the absence of other information)

cfoster5 commented 3 weeks ago

What configuration do you have?

Do you have any other types of commits? Chores and docs shouldn’t affect the version at all, so I suspect it’s defaulting to minor (in the absence of other information)

I'm finding if I skip tagging, the versioning is not working properly. But when using tagging, things work as expected. Are tags the primary reference when determining the next version, rather than the version listed in the packageFiles and bumpFiles?

TimothyJones commented 3 weeks ago

Yes, tags are the primary source for version information- skip tagging is only for if you are applying the tag in some other way

if this isn’t clear in the documentation, possibly it should be

cfoster5 commented 3 weeks ago

Yes, tags are the primary source for version information- skip tagging is only for if you are applying the tag in some other way

if this isn’t clear in the documentation, possibly it should be

Thanks so much for clarifying. My team is used to only tagging in a pre-release branch and bumping in a lower dev branch. Sounds like we will need to tag in the dev branch as well then.