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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

github/repos: remove omitempty option in BranchRestrictionsRequest #1571

Merged
merged 1 commit into from Jul 16, 2020

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