-
Notifications
You must be signed in to change notification settings - Fork 763
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
allow empty push_restrictions #594
Comments
The problem is that restricts pushes is only set if the number of users that have access > 1: https://github.com/terraform-providers/terraform-provider-github/blob/e9dc4e7177785b1a5c349cb15527b263dba389ef/github/util_v4_branch_protection.go#L159 |
I have the same issue using version 4.2.0 of the provider. |
👋 Hey Friends, this issue has been automatically marked as |
Hi all! I'm hitting this same issue now. I want the option to be enabled, just as in the picture above, without specifying names. In my case I only want "maintainers" to be able to push... This is currently not possible |
I'm bumping against this issue too now and I thought I might work towards a PR on it but thought it was worth discussion. If you look at the image from the UI: It kind of feels like it should be structured more like the following, where having the restrict_pushes block is what enables it.
The Graph API has each of these as their own property;
I'll try and raise a patch PR and maybe someone else can think about the future of this. |
I've been trying to create a PR to resolve this and I just can't seem to manage it without making breaking changes. I'm not really sure what the protocol on creating breaking changes is. If I'm allowed to offer breaking changes, I have a working solution. As it currently stands, if Option 1 terraform-provider-github/github/util_v4_branch_protection.go Lines 316 to 319 in 46650cb
Option 2
The inclusion of the block is what enables the restrictions but with no actors specified, with the inner properties configuring the additional features. Removing
My preference is for solution 2 because I don't like that properties rely on other properties but aren't noticeably connected. (While doing this I've discovered that if you set i.e. this will not work because the user has failed to set restrict_pushes = true
That's why connecting them in a block would be better. I'd love some feedback on this please. Thanks |
@georgekaz I like your proposed solution and have responded on the PR; the main issue now is that major version changes in Terraform are somewhat onerous and require code to handle state migrations to avoid breaking users. |
It currently does not look like this config is possible with the
github_branch_protection
resource:The text was updated successfully, but these errors were encountered: