-
Notifications
You must be signed in to change notification settings - Fork 777
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
Feat: Add support for the require_last_push_approval flag in github_branch_protection_v3 #2017
Conversation
…_pull_request_reviews of github_branch_protection_v3
@kfcampbell any chance you can take a look at this? |
It would be nice if someone would look at this. Is there any reason it's sitting around being ignored? |
Sorry for the delay here. After the addition in
@matthewcostatide can you reproduce this? Do the tests succeed for you? |
@kfcampbell @matthewcostatide I had a look at this and I think what is missing is
The tests seem pretty broken to me, they fail to delete the repos they create with a On another note, this bit of code
as opposed to
seems to be required because of a strange use of a pointer here and I think this accessor code is possibly wrong too. Something to look at outside the scope of this PR. |
@georgekaz you're a hero for fighting the good fight with our test situation. Thanks for your research! As always, should you desire to submit any PRs with fixes you'd like to see, I'm happy to review. |
Yeah, sure I can take a look at the tests in general. On this occasion though the test was correct to fail, the property on the object is not being set. If @matthewcostatide would like to add the fix I suggested above it will pass. I don't really want to push to Matthew's branch, he may not like it! |
Hi @matthewcostatide could you add the following line please:
Then I think the tests will pass and this PR has a chance of being merged. Thanks |
IMO given this was raised beginning on Feb, seems fair enough to push this fix to the branch . This is a feature many will be able to benefit from :) |
@aalvarezaph @kfcampbell I couldn't edit @matthewcostatide's branch because I'm not a repo maintainer, so I've had to open a new PR with the patch. #2199 |
…_approval flag in github_branch_protection_v3 (#2199) * Add the require_last_push_approval flag as an option for the required_pull_request_reviews of github_branch_protection_v3 * Update github/resource_github_branch_protection_v3.go * Update website/docs/r/branch_protection_v3.html.markdown * Use local var to capture RequireLastPushApproval value, and pass it to the containing struct as a reference * Add missing property read --------- Co-authored-by: Matthew Costa <matthew.costa@tide.co> Co-authored-by: Keegan Campbell <me@kfcampbell.com> Co-authored-by: Matthew Costa <127119678+matthewcostatide@users.noreply.github.com>
Resolves #1723
Before the change?
The
github_branch_protection_v3
resource doesn't support setting therequire_last_push_approval
flag, and its presence is omitted from the documentation.After the change?
This PR adds support for the
require_last_push_approval
flag in therequired_pull_request_reviews
block of thegithub_branch_protection_v3
resource type, consistent with thegithub_branch_protection
resource.Pull request checklist
Does this introduce a breaking change?
It should not
Please see our docs on breaking changes to help!