Skip to content

Configure GitHub repository to block merge commits #41774

Closed
Listed in
@tstellar

Description

@tstellar
Bugzilla Link 42429
Resolution FIXED
Resolved on Aug 12, 2019 08:03
Version unspecified
OS Linux
Blocks #38741
CC @AlexDenisov,@davezarzycki,@LebedevRI,@RKSimon

Extended Description

This will be implemented using status checks. Any commit that is pushed to github will be required to have the 'rebased' status check pass.

Activity

tstellar

tstellar commented on Jun 27, 2019

@tstellar
CollaboratorAuthor

assigned to @tstellar

AlexDenisov

AlexDenisov commented on Jul 2, 2019

@AlexDenisov
Member

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.

tstellar

tstellar commented on Jul 2, 2019

@tstellar
CollaboratorAuthor

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.

tstellar

tstellar commented on Jul 10, 2019

@tstellar
CollaboratorAuthor

Status checks are enabled in the github repository now, and all commits are required to pass the 'rebased' check.

davezarzycki

davezarzycki commented on Jul 12, 2019

@davezarzycki
Member

Why does this require the "Status Checks" feature of GitHub?

Does unchecking GitHub's "Allow merge commits" not work? What happens?

davezarzycki

davezarzycki commented on Jul 12, 2019

@davezarzycki
Member

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.

davezarzycki

davezarzycki commented on Aug 12, 2019

@davezarzycki
Member

Hi Tom –

git-llvm is client side, so how are merge commits actually blocked then?

tstellar

tstellar commented on Aug 12, 2019

@tstellar
CollaboratorAuthor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzilla

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @tstellar@davezarzycki@AlexDenisov

      Issue actions

        Configure GitHub repository to block merge commits · Issue #41774 · llvm/llvm-project