You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PullRequestReviewsEnforcementRequest.DismissalRestrictionsRequest set to nil results in 422 from GH #664
No subschema in "anyOf" matched.
For 'properties/dismissal_restrictions', [] is not an object.
Not all subschemas of "allOf" matched.
For 'anyOf/1', {"dismissal_restrictions"=>[], "dismiss_stale_reviews"=>false} is not a null. []]
I have PR #703 in to fix this. It seems to be failing because I added a new library go-spew which is essentially the recursive %+v I always wanted and that doesn't get pulled in during the build.
I think in order to resolve this bug, we need to figure out how to reproduce a successful response from GitHub using REST API. Then, once we have that, we can work on the Go code to fix the code, if needed.
From my understanding of #703, the way to get a successful response from GitHub is to perform the API call involving DismissalRestrictionsRequest on an organization-owned repository. It doesn't work on personal repositories and gives 422 in that case. /cc @beiriannydd
In any case, I have a support request out to GitHub to try to find out what the expected behavior is/should be. If the docs are wrong, and the property should be null (instead of an empty array), I'll provide a PR to make the change.
Update: I just tried passing null—by modifying the JSON Marshal code—and GitHub complains about that too... the actual problem might be on GitHub's end. (I'm attempting to modify a private organization repo, not a personal or public repo.)
It seems to me that GitHub has updated the docs by now, and I'm not aware of what exactly we're waiting on them for, so removed that label. I think PR #791 will resolve this issue (let me know if not).
Activity
iwata commentedon Jul 21, 2017
And I hope that
PullRequestReviewsEnforcementRequestsupportsrequire_code_owner_reviewskey 😄 .https://developer.github.com/v3/repos/branches/#update-branch-protection
dmitshur commentedon Jul 21, 2017
I ran into this issue as well in #674. See
go-github/test/integration/repos_test.go
Lines 111 to 113 in e062a8c
When this issue is resolved, that integration test can be fixed too.
Github API documentation was incorrect, dismissal_restrictions should…
Fix google#664 PullRequestReviewsEnforcementRequest.DismissalRestrict…
Fix google#664. Docs for empty DismissalRestrictions were incorrect. …
beiriannydd commentedon Aug 21, 2017
I have PR #703 in to fix this. It seems to be failing because I added a new library go-spew which is essentially the recursive %+v I always wanted and that doesn't get pulled in during the build.
beiriannydd commentedon Aug 21, 2017
Tests are passing :)
dmitshur commentedon Aug 22, 2017
See my comment at #703 (comment).
I think in order to resolve this bug, we need to figure out how to reproduce a successful response from GitHub using REST API. Then, once we have that, we can work on the Go code to fix the code, if needed.
Fix google#664. Docs for empty DismissalRestrictions were incorrect. …
dmitshur commentedon Sep 5, 2017
From my understanding of #703, the way to get a successful response from GitHub is to perform the API call involving DismissalRestrictionsRequest on an organization-owned repository. It doesn't work on personal repositories and gives 422 in that case. /cc @beiriannydd
JaredReisinger commentedon Oct 30, 2017
I just started seeing a 422 when an empty array is passed for
dismissal_restrictions. The docs (https://developer.github.com/v3/repos/branches/#update-branch-protection) specifically mention that passing an empty array is the right way to disable dismissal restrictions (which is weird, IMO, sincenullwould work just fine for this, and the object isn't normally an array)... so the current implementation is as per the docs, but GitHub still seems to be complaining.In any case, I have a support request out to GitHub to try to find out what the expected behavior is/should be. If the docs are wrong, and the property should be null (instead of an empty array), I'll provide a PR to make the change.
Update: I just tried passing
null—by modifying the JSON Marshal code—and GitHub complains about that too... the actual problem might be on GitHub's end. (I'm attempting to modify a private organization repo, not a personal or public repo.)dmitshur commentedon Mar 19, 2018
It seems to me that GitHub has updated the docs by now, and I'm not aware of what exactly we're waiting on them for, so removed that label. I think PR #791 will resolve this issue (let me know if not).
Bug fix PUT /repos/:owner/:repo/branches/:branch/protection (#791)
Update go-github dependency to HEAD master
Update go-github dependency to HEAD master
Update go-github dependency to HEAD master
Bug fix PUT /repos/:owner/:repo/branches/:branch/protection (google#791)
Bug fix PUT /repos/:owner/:repo/branches/:branch/protection (google#791)