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

Configure GitHub repository to block merge commits #41774

Closed
tstellar opened this issue Jun 27, 2019 · 8 comments
Closed

Configure GitHub repository to block merge commits #41774

tstellar opened this issue Jun 27, 2019 · 8 comments
Assignees
Labels

Comments

@tstellar
Copy link
Collaborator

@tstellar tstellar commented Jun 27, 2019

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.

@tstellar
Copy link
Collaborator Author

@tstellar tstellar commented Jun 27, 2019

assigned to @tstellar

@AlexDenisov
Copy link
Member

@AlexDenisov AlexDenisov commented Jul 2, 2019

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
Copy link
Collaborator Author

@tstellar tstellar commented Jul 2, 2019

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
Copy link
Collaborator Author

@tstellar tstellar commented Jul 10, 2019

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

@davezarzycki
Copy link
Member

@davezarzycki davezarzycki commented Jul 12, 2019

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

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

@davezarzycki
Copy link
Member

@davezarzycki davezarzycki commented Jul 12, 2019

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
Copy link
Member

@davezarzycki davezarzycki commented Aug 12, 2019

Hi Tom –

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

@tstellar
Copy link
Collaborator Author

@tstellar tstellar commented Aug 12, 2019

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

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants