Repository navigation
Adding BypassPullRequestActorIDs to branch protection - #1030
Conversation
|
Can we get this shipped please? :-) |
|
@jcudit please could you review this PR? |
kfcampbell
left a comment
There was a problem hiding this comment.
I had a few initial questions. I like this feature addition a lot.
Can you add tests to cover this change?
| return vGh4 | ||
| } | ||
|
|
||
| func githubv4IDSliceEmpty(ss []string) []githubv4.ID { |
There was a problem hiding this comment.
Why is "Empty" in the name here? It looks like the function is a translation between a string slice and a githubv4.ID slice, and I'm not quite understanding how Empty fits in.
There was a problem hiding this comment.
If I remember it correctly, I had to add this here so we can set the list of pull_request_bypassers to empty list:
resource "github_branch_protection" "test" {
...
required_pull_request_reviews {
pull_request_bypassers = []
}
}Without this we cannot remove all bypassers if any were set before.
I didn't want to make changes to the githubv4IDSlice for the case some other logic would break so I added this new function. If you feel the function should be called differently, plese suggest a new name and I will amend it.
| if a.Actor.Team != (Actor{}) { | ||
| bypassActors = append(bypassActors, a.Actor.Team.ID.(string)) | ||
| } | ||
| if a.Actor.User != (Actor{}) { | ||
| bypassActors = append(bypassActors, a.Actor.User.ID.(string)) | ||
| } |
There was a problem hiding this comment.
Do you mind explaining this logic to me a little more?
There was a problem hiding this comment.
The logic is the same like in the case of setPushActorIDs bellow.
|
Any update on this? I am very interested in having this merged :) |
|
Also interested in seeing this get merged, pretty please! |
kfcampbell
left a comment
There was a problem hiding this comment.
This is good to merge!
|
Thanks a ton for submitting this functionality. |
|
Any idea when this will be merged? |
|
Hi, |
|
@chenshap I didn't have immediate plans to do so, but if you'd like to open a PR I'd be receptive to reviewing it and getting it in! |
This PR is fixing the issue #1005 by adding the functionality to define a list of users/teams that can bypass the PR restrictions. Unfortunately there doesn't seem to be any boolean flag like in the case of the
restrict_dismissals+dismissal_restrictionsparameters.