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

Disable enforcing branch-protection for admins #674

Merged

Conversation

plowin
Copy link
Contributor

@plowin plowin commented Aug 22, 2023

  • This disables the following branch-protection rule for the repos haproxy-boshrelease and pcap-release

    Do not allow bypassing the above settings
    The above settings will apply to administrators and custom roles with the “bypass branch protections” permission

  • As we have mandatory tests, this setting prevents our bot CFN-CI to push a PR to the main branches. Instead, we get this error when trying to push via the job shipit
    remote: error: GH006: Protected branch update failed for refs/heads/master.        
    remote: error: 2 of 2 required status checks are expected.        
    To https://github.com/cloudfoundry/haproxy-boshrelease
     ! [remote rejected] HEAD -> master (protected branch hook declined)
    error: failed to push some refs to 'https://github.com/cloudfoundry/haproxy-boshrelease'
    failed with non-rebase error
    
  • Allowing this CI user to bypass PR creation is not sufficient
  • We suggest to soften these rules and avoid more manual work by piping the respective changes during a relase through a PR/review-process

This disables the following branch-protection rules for the repos `haproxy-boshrelease` and `pcap-release`
> Do not allow bypassing the above settings
> The above settings will apply to administrators and custom roles with the “bypass branch protections” permission
@plowin
Copy link
Contributor Author

plowin commented Aug 22, 2023

FYI @ameowlia as WG-lead

@stephanme
Copy link
Contributor

There is an option to bypass mandatory PR reviews and WG bots are exempted from reviews. There seems to be no option for bypassing status checks, probably because they are normally automatic and are supposed to be green. But you would need a PR (a branch) in addition to get status check results.

If you really need to bypass status checks, then disabling branch protection for admins might be your only option. The side effect is that WG leads and TOC members can commit directly to the main branch of your projects. In ARD WG this led once to unnecessary additional effort.

@plowin
Copy link
Contributor Author

plowin commented Aug 22, 2023

Correct, we would accept this risk and can also move back if needed.

Also, we have unit/acceptance tests for the master branch. I think we will catch accidents caused from unintended admin-merges.

@stephanme stephanme added the wg label Aug 22, 2023
@ameowlia ameowlia merged commit 1d93670 into cloudfoundry:main Aug 25, 2023
1 check passed
@ameowlia
Copy link
Member

🙏 I will do my best not to push to your branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants