-
Notifications
You must be signed in to change notification settings - Fork 180
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
Branch protection not being applied #150
Comments
we should probably hide these details if true, but it looks like i had to set some properties that i wasn't trying to configure to could you try some variations of that to see if gets you working? if that does end up working, i would be interested in the combination that worked as well as those that didnt so that we can try to improve configuring these. |
You are right. It works if all top-level settings are included. Thanks for the tip. That's my current one: branches:
- name: master
# https://developer.github.com/v3/repos/branches/#update-branch-protection
# Branch Protection settings. Set to null to disable
protection:
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable.
required_pull_request_reviews:
# The number of approvals required. (1-6)
required_approving_review_count: 1
# Dismiss approved reviews automatically when a new commit is pushed.
dismiss_stale_reviews: true
required_status_checks: null
restrictions: null
enforce_admins: null I won't work if I set then to branches:
- name: master
# https://developer.github.com/v3/repos/branches/#update-branch-protection
# Branch Protection settings. Set to null to disable
protection:
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable.
required_pull_request_reviews:
# The number of approvals required. (1-6)
required_approving_review_count: 1
# Dismiss approved reviews automatically when a new commit is pushed.
dismiss_stale_reviews: true
required_status_checks: false
restrictions: false
enforce_admins: false |
glad it got you unblocked. thanks for following up with the extra info. that'll be a big help when we get a chance to improve that situation. if you'd be interested in sending a PR to improve this, thats always appreciated and i'd be happy to help where you might need it. |
We are now one huge release cycle involving many projects so I don't expect any bandwith before at least end November. Otherwise, I would be willing to help. On the other hand, with a workaround, it makes it less urgent as well. |
not a problem. i'll leave the issue open until someone can clean that up and so others can hopefully find the workaround in the mean time. |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? |
Sorry for the noisy reference, I was trying to make this work, but was not actually able to, even after trying all possible combinations. I ended up with the following, but still not working: branches:
- name: master
protection:
required_pull_request_reviews:
required_approving_review_count: 1
dismiss_stale_reviews: true
require_code_owner_reviews: true
dismissal_restrictions: {}
required_status_checks:
strict: true
contexts: ['YAML lint']
enforce_admins: null
restrictions: null The status check context I got from the API itself at {
"url": "https://api.github.com/repos/john-badass-test-org/.github/branches/master/protection/required_status_checks",
"strict": true,
"contexts": [
"YAML lint"
],
"contexts_url": "https://api.github.com/repos/john-badass-test-org/.github/branches/master/protection/required_status_checks/contexts"
} Any idea would be appreciated while I investigate a little further to see if I can get to the root of this. |
To my previous comment, this does not seem to be working for my |
is branch protection working in your |
I force-pushed a few attempts to my |
in case it is helpful, here is a config that works on one of my it has been a while since i configured that one and the config is simpler than you are attempting, but that one did work. there shouldn't be anything unique about configuring the we still have some steps to get to a point where troubleshooting issues like this are simpler, but i'm hoping we can identify what is preventing your config from working.
|
@travi My original config works on a new org, both with/without the required checks context. I wonder if the previous behavior I observed was due to #221 ? EDIT Actually, this is not quite my original config. I removed: ...
collaborators:
...
- username:
permission: pull which was taken from an example I can't find back. Might be the culprit... |
seems unlikely since a failure there would still be a failure no matter how that handling was happening
the missing username would likely result in an error, so that would make sense to me regardless, glad to hear that it is working for you now |
I might be coming late to this party. But after few hours of against-the-wall-head-banging debugging I realised that branch protection rules only work if you have an actual matching pattern in your repo. |
I can't get this to work either. I'd love some visibility of what's happening when it tries to apply my yaml! |
Anyone have solution for this ? |
Hello. I am trying to make settings.yml branch protection work too. No luck unfortunately. I have even tried the absolute minimum configuration. Still nothing happens. I don't know why. Other settings and labels work.
Doesn't work ^
Works ^ Edit: Today it just worked (TM). I don't know why, but it sometimes works, sometimes doesn't. |
This comment was marked as resolved.
This comment was marked as resolved.
as i've mentioned in other threads, configuring branch protection does still work as long as there are no errors in the config and no other errors occurred when the app attempted to apply earlier changes through the api. #518 needs to be implemented to provide feedback about failures to give a better chance to resolve config problems, but i can't provide an ETA for getting that implemented at this point |
None of the repos where I have branch protection configured gets the settings applied.
I did two different tests without success.
master
, settings are not appliedInitially, I thought that this could be related to #136. That's why I did test num 2.
Test were done on this repo:
https://github.com/renatocaval/oh-my-git/
https://github.com/renatocaval/oh-my-git/blob/master/.github/settings.yml#L13-L23
The text was updated successfully, but these errors were encountered: