+
Skip to content

Conversation

anGie44
Copy link
Contributor

@anGie44 anGie44 commented Jul 9, 2020

Closes #1546

Notes:

  • this reverts a previous change to the BranchRestrictionsRequest as it does not behave as expected such that restrictions configured for individual repositories still result in an error if users/teams fields are not set e.g.
No subschema in "anyOf" matched.
"teams", "users" weren't supplied.
Not all subschemas of "allOf" matched.
For 'anyOf/1', {"apps"=>["myApp"]} is not a null.

or if set to nil or []string{} e.g.

422 Validation Failed [{Resource: Field: Code: Message:Only organization repositories can have users and team restrictions}]

@googlebot googlebot added the cla: yes Indication that the PR author has signed a Google Contributor License Agreement. label Jul 9, 2020
@codecov
Copy link

codecov bot commented Jul 9, 2020

Codecov Report

Merging #1571 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1571   +/-   ##
=======================================
  Coverage   67.95%   67.95%           
=======================================
  Files          96       96           
  Lines        8762     8762           
=======================================
  Hits         5954     5954           
  Misses       1898     1898           
  Partials      910      910           
Impacted Files Coverage Δ
github/repos.go 70.04% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4f1bb0...934a52c. Read the comment docs.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @anGie44 !
LGTM, and unless you know of a solution using curl that we could reverse-engineer, then I don't have any other suggestions than to just go ahead and merge this PR.

Awaiting second LGTM before merging.

Copy link

@andrew-waters andrew-waters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well

@gmlewis
Copy link
Collaborator

gmlewis commented Jul 16, 2020

Thank you, @andrew-waters!
Merging.

@gmlewis gmlewis merged commit e881974 into google:master Jul 16, 2020
@anGie44
Copy link
Contributor Author

anGie44 commented Jul 16, 2020

thank you @gmlewis and @andrew-waters! would love to get this in the next release to help the Terraform Provider Github project benefit from the new features already in v32

@anGie44 anGie44 deleted the b-branch-protection-request branch July 16, 2020 02:00
@gmlewis
Copy link
Collaborator

gmlewis commented Jul 18, 2020

Sorry for the delay... hopefully I can get to this tomorrow.

@gmlewis
Copy link
Collaborator

gmlewis commented Jul 18, 2020

@anGie44 - this is now available in Release v32.1.0: https://github.com/google/go-github/releases/tag/v32.1.0
Thank you for your patience and understanding!

@anGie44
Copy link
Contributor Author

anGie44 commented Jul 19, 2020

Not a problem, @gmlewis! thanks so much for your help and review 😃

n1lesh pushed a commit to n1lesh/go-github that referenced this pull request Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Indication that the PR author has signed a Google Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repositories.UpdateBranchProtection returning 422 Error when restrictions contain empty fields

4 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载