-
Notifications
You must be signed in to change notification settings - Fork 19
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
Proposal for adding semantic-release
to Hubot 🤖
#6
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I'm excited to see this in action.
we use |
I would like to add to the todo list that we should release one last version manually |
Actually, one other thing I think we should change in this PR… update the README to remove Hubot 3.0. |
@bkeepers you mean to rename the |
@gr2m I'd just drop the 3.0. I can open another PR for it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really exciting, thanks for putting it together!
I added some line-item questions that I was hoping to have answered before approving & merging.
_drafts/semantic-release.md
Outdated
|
||
# Set up release workflow with `semantic-release` | ||
|
||
`semantic-release` makes releasing faster, simpler and safer. All of these are valuable if we want to increase public participation in the project and increase momentum and motivation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see there's links to semantic-release further down, but could you make sure there's a link the first time it's mentioned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_drafts/semantic-release.md
Outdated
|
||
## Motivation | ||
|
||
Releasing a package is always a bit of a Big Thing™: decisions have to be made about versioning, an error-prone manual release process has to be performed, and somebody has to actually do the work and take the responsibility if something goes wrong. So there are a few barriers to frequent releases, and many potential sources of error. Automating this process takes away all the uncertainty and hassle out of releasing, makes our version numbers more consistent and reliable, and increases release frequency and project momentum. It also does away with the concept of intentional, manual releases: whenever something lands in master and passes all the tests, `semantic-release` will package an npm release. If we do need to keep control of release timing for marketing reasons, `semantic-release` supports that too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also does away with the concept of intentional, manual releases: whenever something lands in master and passes all the tests,
semantic-release
will package an npm release
This is really cool. This is pretty close to how I worked previously when making changes, basically timeboxing a day to see how much I could merge and then release that with whatever semantically appropriate version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you want to release bug fixes / features from multiple PRs, you can merge them first into a release branch, and then merge that into master
.
_drafts/semantic-release.md
Outdated
An admin/owner [sets up](https://github.com/semantic-release/semantic-release#setup) [semantic-release](https://github.com/semantic-release/semantic-release) on `hubotio/hubot` using `semantic-release-cli setup`. Since we’ve already got tests and Travis set up, this shouldn’t require any additional steps. | ||
|
||
We should update `CONTRIBUTING.md`: | ||
- include more details about our [expected commit message format](https://github.com/semantic-release/semantic-release#default-commit-message-format), and why this is important |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this detail is worth discussing a bit. I am not familiar with this expected commit message formatting, but it seems like it would impact possible contributors, as well as maintainers. I know personally, I don't have a good habit of well formed commit messages 😅
What kind of learning curve do you think there is getting started with this? Are there tools or helpers with getting going with expected commit message format? Does it assume that pull requests are going to be rebased and squashed with the right format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use commitizen with another project that I use semantic-release with. It's a cli wizard (like npm init) to build commit messages in the standard format, which I gather is the convention used by the Angular team and widely adopted since.
https://github.com/commitizen/cz-cli
It's a global module, so I don't know how you'd encourage others to use it, but maybe that's good because you can just make a suggestion for those that need help, otherwise you're still free to write you're own.
The most opaque aspect for me is choosing the "scope". I find it hard to apply consistent semantics for my commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest we put the most common commit messages into our CONTRIBUTING.md
files. fix: ...
, feat: ...
and BREAKING CHANGE:
are the only three that really matter for semantic-release
as only they have impact on the calculated version and only these commit messages will be parsed for changes added to a GitHub release.
We have a short summary in Hoodie’s CONTRIBUTING.md file
Also link semantic-release-cli
@timkinnane's suggestion of https://github.com/commitizen/cz-cli to help with formatting the commit messages correctly. I suspect that I personally will struggle with getting this right to start 😅 One question I didn't see an answer to:
|
Merging is fine, but the commit messages should be cleaned up first, either by the people who started the PR or the people who reviewed it. A nice little project could be a service which sets a PR status based on its commit messages. It could set status to failure if one of the commits doesn’t follow the convention. And it could set the description to the version number it calculated based on the currently released version and the commit messages of a PR. I’d love that to exist :) I can help spec it out but don’t have the time myself to build it right now. |
The reason for not enabling squash and merge is that we tend to not work that way with internal projects, and I will say I have not done that on hubot. In particular, it preserves the original commit history, so it's easier to interact with other branches, cherry-picking, and merging other branches into it. If we are encouraging contributors or maintainers to be cleaning up commits before merging, then it is kind of functionally equivalent to allowing squash and merge, since it'd involve rewriting the history. Not saying no, but making sure this is clearly understood to be a change in how the project operates on pull requests. |
I think a best practise we can agree on is to keep pull requests as small as possible. When you do that, there won’t be a need of cherry-picking because things just get merged much faster and automatically released all the time. I do squash a lot in other projects, especially the ones that use semantic-release, it helps greatly with the workflow of accepting contributions because it’s a "Let me fix this for you" instead of "Read the CONTRIBUTING manual". If the cause problem of you only allowing merges internally is long-standing pull requests, than I’d invest into avoiding that, and I think semantic-release helps with it because it adds additional incentives to merge & release often, as it takes away a lot of the manual overhaed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gr2m thanks for the context! I am on board, but I'd like to see an item in the detailed description to update release documentation to mention release branches & commit cleanup a maintainer might need to do.
|
||
We should update `CONTRIBUTING.md`: | ||
- include more details about our [expected commit message format](https://github.com/semantic-release/semantic-release#default-commit-message-format), and why this is important | ||
- remove the instructions for manual releases and replace them with info about `semantic-release`, how it works and why we’re using it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of manual release documentation, might be worth talking about about the idea of a release branch to merge feature branches into, and also the work a maintainer might have to do to cleanup the commits of an incoming branch.
semantic-release
makes releasing faster, simpler and safer by automating the entire release workflow and removing human decision making from versioning. All of this is valuable if we want to increase public participation in the project and increase momentum and motivation.👉 Check out the proposal 👀
Steps to complete:
CONTRIBUTING.md
with commit message guidelines and new release processCHANGELOG.md
, in this release’s notes, link the file in the last tag that still has it, for future referenceMore details for these steps in the proposal.