restechnica / semverbot

A CLI which automates semver versioning.
Mozilla Public License 2.0
133 stars 6 forks source link

Create a decent wiki page and gather FAQ from introductory Reddit post #18

Closed shiouen closed 2 years ago

shiouen commented 3 years ago

People have posted really good questions on an introductory Reddit post, to the extent that the readme should be cleared up or replaced with a decent wiki. The questions can be compiled into an FAQ.

sheldonhull commented 3 years ago

@shiouen you could enable github discussions if you want to avoid more issues being created? It's a nice way to move general discussions out of issues.

I am interested in leveraging the tool, but my initial run was a bit confusing as I tried to evaluate branch + conventional commit format messages, and it didn't seem to detect anything at that point.

Also, since I'm doing trunk based development, all the branches get deleted and squashed into main, so I was thinking that my usage of versioning with branches won't work, and versioning will have to be done by a CI job on main for this to make sense. Does that sound right?

I resorted to svu and a version yaml file to not rely on tagging, but am open to adjusting if it makes things easier. Just not sure how to tackle it with this tool yet. Will provide more context in a github discussion thread if needed or here, whatever works for you.

Note I'm coming from Azure DevOps as my primary tool, so pure GitHub tooling doesn't work for me.

shiouen commented 3 years ago

Hi @sheldonhull I enabled discussions!

I also work with trunk based development most of the time.

"versioning will have to be done by a CI job on main for this to make sense" Sounds right, doing it on dev branches would create duplicate versions when working with other developers.

"so I was thinking that my usage of versioning with branches won't work" It depends. The 'auto' mode falls back to 'git-commit' mode when 'git-branch' mode fails. If the message of a git merge contains anything that matches the semverbot detection config, it will still work. GitHub, Bitbucket and other major Git platforms add branch name information to the git commit message, enabling semverbot's 'git-commit' mode to pick up on branch names too, e.g., Merge pull request #14 from restechnica/fix/documentation, my semverbot config has fix/ in there and knows it's a fix!

Unless I am missing something, this should work for trunk based development. I suggest we have a look at it together, if you're up for that.

Edit: you mentioned Azure DevOps, which also adds the branch name as a git commit message, e.g., Merged PR 16: fix-some-fix. It does replace the '/' in branch names with '-'.

sheldonhull commented 3 years ago

Default message behavior in Azure DevOps for commits is Merged PR123: which I use with conventional commit. So I'd still have Merged PR1234 - feat: implement tacos so I think your tool would work fine for this. Moving remainder of question to discussions. Thanks!