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

summarize semantic commit requirements #12665

Merged
merged 3 commits into from
May 2, 2018
Merged

summarize semantic commit requirements #12665

merged 3 commits into from
May 2, 2018

Conversation

zeke
Copy link
Contributor

@zeke zeke commented Apr 19, 2018

This PR represents a first step toward a "conventional commits" requirement on electron/electron.

Rather than requiring every single commit message to follow a convention, the approach here is to require at least one semantic commit message in the PR, or a semantic PR title.

We've been using the https://github.com/apps/semantic-pull-request probot app on electron/i18n for a few weeks, and it's worked well. If a PR is ready to go but doesn't yet meet the semantic requirements, a maintainer can change the PR title to get checks passing, then merge.

Feedback welcome!

TODO:

  • Document semantic commit requirements in CONTRIBUTING (so we can link to them)
  • Add example commit messages
  • Change "must" to something more polite.

@zeke zeke requested review from a team, jkleinsc, codebytere, ckerr and alexeykuzmin April 19, 2018 17:28
- refactor: A code change that neither fixes a bug nor adds a feature
- style: Changes that do not affect the meaning of the code (linting)

Here is a list of things that will help get your PR across the finish line:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like what's here, would also like to see a small examples section as that will go a long way to showing best practices

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that examples would be 💯

Copy link
Contributor

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I think this good, though as @ckerr mentioned, I think examples would be helpful.

- refactor: A code change that neither fixes a bug nor adds a feature
- style: Changes that do not affect the meaning of the code (linting)

Here is a list of things that will help get your PR across the finish line:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that examples would be 💯

@@ -12,9 +12,24 @@ newIssueWelcomeComment: |
newPRWelcomeComment: |
💖 Thanks for opening this pull request! 💖

![typing cat](https://user-images.githubusercontent.com/2289/36400158-2c7c589e-1584-11e8-81c7-bd34fd3c392b.gif)
We use [semantic commit messages](https://conventionalcommits.org/) to streamline the Electron release process. Before
your pull request can be merged, you must **update your pull request title**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of saying "you must update your pull request title", how about "please ensure that your pull request title...."

![typing cat](https://user-images.githubusercontent.com/2289/36400158-2c7c589e-1584-11e8-81c7-bd34fd3c392b.gif)
We use [semantic commit messages](https://conventionalcommits.org/) to streamline the Electron release process. Before
your pull request can be merged, you must **update your pull request title**
to start with a semantic prefix, OR prefix at least one of your commit messages.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From an automation perspective it would be much easier to just use PR titles vs commit messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Can you elaborate?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zeke I was wrong. I was thinking the automatic process only queries PRs, but it actually queries all the commits, so yeah, commits or PR titles are both good.

@codebytere
Copy link
Member

I'd agree that examples would be awesome, but i think it might be easier for brevity of comment to add the examples to contribution docs somewhere and link to them?

@zeke
Copy link
Contributor Author

zeke commented Apr 19, 2018

add the examples to contribution docs somewhere and link to them

Yessss. Definitely want to have this documented so we can link to it as needed, especially because the message here only applies to first-timers, not the hundreds of people who have already landed PRs on electron. 👍

Started a TODO list up top ☝️

@zeke zeke requested a review from a team April 20, 2018 18:30
@zeke
Copy link
Contributor Author

zeke commented Apr 20, 2018

I made some updates based on all the feedback. This is ready for 👀 again.

@zeke zeke changed the title [WIP] summarize semantic commit requirements summarize semantic commit requirements Apr 20, 2018
Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest updates looks great, with the examples you added i think this is ready to go 🚀

@alexeykuzmin
Copy link
Contributor

I like new examples in the present tense much more than the old ones in the past tense.

New:

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method

Old:

Examples:

  • updated osx build documentation for new sdk
  • fixed typos in atom_api_menu.h

Copy link
Contributor

@alexeykuzmin alexeykuzmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The first line should:
  • contain a short description of the change (preferably 50 characters or less,
    and no more than 72 characters)
    ...
  1. Wrap all other lines at 72 columns.

Are we going to drop line width requirement?
I guess a lot of people work with git in a console, and long commit messages just create a mess.
So I think the requirement should be kept and probably even enforced by a pre-commit hooks and CI checks (bots can work too).

@zeke
Copy link
Contributor Author

zeke commented Apr 30, 2018

@alexeykuzmin I restored the line-width info. 👍

Copy link
Member

@ckerr ckerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this change as-is.

Since this does change the team's workflow, and since not everyone was at the Monday morning kickoff meeting, I'm going to ping #core asking for people to weigh in before merging.

@ckerr ckerr merged commit 1957eb9 into master May 2, 2018
@ckerr ckerr deleted the semantic-first-pr branch May 2, 2018 14:47
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 this pull request may close these issues.

6 participants