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

ProtectedBranches API changes for Required Review Enforcement #1512

Closed
ryangribble opened this issue Dec 12, 2016 · 10 comments
Closed

ProtectedBranches API changes for Required Review Enforcement #1512

ryangribble opened this issue Dec 12, 2016 · 10 comments
Labels
Type: Feature New feature or request

Comments

@ryangribble
Copy link
Contributor

As per this blog anouncement the ProtectedBranches API has a new required_pull_request_reviews object

  • On the existing UpdateBranchProtection method (add to our BranchProtectionSettingsUpdate request object, which will require a few ctors to be added to cater for the different combinations of the 3 fields being provided/not provided)

  • Returned by the existing GetBranchProtection method (add to our BranchProtectionSettings response object)

  • On new methods to Get, Update, Remove the required review enforcement

    • GET /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews
    • PATCH /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews
    • DELETE /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews
@ryangribble ryangribble self-assigned this Dec 12, 2016
@M-Zuber
Copy link
Contributor

M-Zuber commented Dec 12, 2016

I'd like to try and do this one if it's still available

@ryangribble ryangribble removed their assignment Dec 12, 2016
@ryangribble
Copy link
Contributor Author

All yours @M-Zuber !

@ryangribble
Copy link
Contributor Author

Unless you prefer the organization ones I also just raised #1513 and #1514 in which case Im happy to knock over this protected branches one since Im pretty familiar with this area.

Up to you though, if you want to do this one that's cool

@M-Zuber
Copy link
Contributor

M-Zuber commented Dec 12, 2016

I want something small in order to get back into things.
Lets see if I can get this one done fast enough to start tackling those also 😀

@BigAlInTheHouse
Copy link

BigAlInTheHouse commented Dec 12, 2016 via email

@M-Zuber
Copy link
Contributor

M-Zuber commented Dec 13, 2016

How exactly do you want the additional ctors to look?
Currently there are 2: one that takes only a BranchProtectionRequiredStatusChecksUpdate, and the other that takes a BranchProtectionPushRestrictionsUpdate in addition.

Based on my understanding of the docs: You can, and should, pass required_pull_request_reviews as well. While this is not required currently, it should be treated as such and will be soon., the BranchProtectionRequiredPullRequestReviewsUpdate object is different in that it can not be disabled by passing in null.

This would lead to a total of 3 ctors:

  • BranchProtectionRequiredPullRequestReviewsUpdate + BranchProtectionRequiredStatusChecksUpdate
  • BranchProtectionRequiredPullRequestReviewsUpdate + BranchProtectionPushRestrictionsUpdate
  • All three

Does that make sense?

@ryangribble
Copy link
Contributor Author

I would have thought passing null means review isn't required at all, then passing the object means review IS required (with the boolean indicating whether admins also have to comply with it or not). If you can't pass null how do you indicate no review is required?

@M-Zuber
Copy link
Contributor

M-Zuber commented Dec 13, 2016

Hmmm... Had not thought of it that way, and you are probably correct.
But the docs seem to imply otherwise as for the older params they specify pass in null to disable while for the new param they don't.

So I am going to assume you are correct, and try to write an integration test proving it.

@M-Zuber
Copy link
Contributor

M-Zuber commented Dec 22, 2016

I didn't get to writing the tests yet, but am making a pr just to get another set of 👀 on it as soon as possible

@nickfloyd
Copy link
Contributor

resolved with: #1523

@nickfloyd nickfloyd added Type: Feature New feature or request and removed category: feature labels Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants