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

Adapt checks to fit repo's merge strategy #11

Closed
zeke opened this issue May 25, 2018 · 2 comments
Closed

Adapt checks to fit repo's merge strategy #11

zeke opened this issue May 25, 2018 · 2 comments

Comments

@zeke
Copy link
Owner

zeke commented May 25, 2018

GitHub PR can be merged in three ways. Let's call them merge, squash, and rebase.

image

This bot should check the repo's merge button configuration and change its behavior accordingly:

  • If merge or rebase, then a semantic PR title is not adequate, as it won't become a commit message. In this case, at least one semantic commit is required in the PR.
  • If squash, then a semantic PR title is required, as any semantic commits in the PR will be squashed.
@zeke
Copy link
Owner Author

zeke commented Jul 11, 2018

Further info:

https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button API can be used to explicitly set the merge_method to squash. This would work if the bot was merging the PRs.
Humans could summon the bot to merge by either adding a label (e.g. merge) or with a comment (e.g. /merge). Note that in the case of using a comment, the bot would have to check that the commenter actually has permission to merge the PR.

Also, an edge case for squash commits (via @francisfuzz):

I was reminded of something I learned about how we treat squash merges recently and would like to share it here in the case it hasn’t been considered by the Electron team.

Squashing a pull request with one commit would use that commit’s message, but squashing a pull request with more than one commit will use the pull request’s title for the commit message.

@zeke
Copy link
Owner Author

zeke commented Jul 26, 2018

This issue was mostly resolved by #19; the unresolved part is now #17

@zeke zeke closed this as completed Jul 26, 2018
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

No branches or pull requests

1 participant