LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 42429 - Configure GitHub repository to block merge commits
Summary: Configure GitHub repository to block merge commits
Status: RESOLVED FIXED
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: unspecified
Hardware: PC Linux
: P enhancement
Assignee: Tom Stellard
URL:
Keywords:
Depends on:
Blocks: github
  Show dependency tree
 
Reported: 2019-06-27 14:48 PDT by Tom Stellard
Modified: 2019-08-12 08:03 PDT (History)
6 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Stellard 2019-06-27 14:48:51 PDT
This will be implemented using status checks.  Any commit that is pushed to github will be required to have the 'rebased' status check pass.
Comment 1 AlexDenisov 2019-07-02 06:47:21 PDT
Hi Tom, I am a bit out of context since I did not closely follow the Github related discussions, but I have a question.

As far as I understand, the status check is only possible within a pull request, i.e. there is nothing that will stop me from pushing a merge commit directly to the master.

Does it mean that LLVM will follow PR-only policy on Github and forbid direct pushes to the master branch?

I would appreciate if you can share a bit more information.

Thank you,
Alex.
Comment 2 Tom Stellard 2019-07-02 08:25:44 PDT
You can enforce status checks on commits that are pushed directly to the github repository.  The plan is to update the git-llvm script to check for merge commits before pushing and to 'pass' the status check via the github API.  We are not going to start using GitHub pull requests, at least not in the near future.
Comment 3 Tom Stellard 2019-07-10 08:40:37 PDT
Status checks are enabled in the github repository now, and all commits are required to pass the 'rebased' check.
Comment 4 David Zarzycki 2019-07-12 05:51:40 PDT
Why does this require the "Status Checks" feature of GitHub?

Does unchecking GitHub's "Allow merge commits" not work? What happens?
Comment 5 David Zarzycki 2019-07-12 06:38:30 PDT
(In reply to David Zarzycki from comment #4)
> Why does this require the "Status Checks" feature of GitHub?
> 
> Does unchecking GitHub's "Allow merge commits" not work? What happens?

Never mind. That feature only changes their web interface, not all branches in a project.
Comment 6 David Zarzycki 2019-08-12 01:52:44 PDT
Hi Tom –

`git-llvm` is client side, so how are merge commits actually blocked then?
Comment 7 Tom Stellard 2019-08-12 08:03:58 PDT
(In reply to David Zarzycki from comment #6)
> Hi Tom –
> 
> `git-llvm` is client side, so how are merge commits actually blocked then?

The plan is to use GitHub's status check feature[1] to block merge commits.  We have created a 'rebased' status check and the git-llvm script will be updated to 1) check for a merge commit before pushing and the 2) 'Pass' the status check for the commit before pushing.

Using the status checks will force people to use the git-llvm script, so we can ensure that people are running the client-side checks e committing.

The goal is to prevent people from accidental merge commits and to prevent people who don't know the policy from doing merge commits.


[1] https://help.github.com/en/articles/about-status-checks