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

Feature Request > New branch protection features support #305

Closed
kuwas opened this issue Dec 6, 2019 · 16 comments · Fixed by #887
Closed

Feature Request > New branch protection features support #305

kuwas opened this issue Dec 6, 2019 · 16 comments · Fixed by #887
Labels
Good first issue Good for newcomers r/branch_protection Type: Feature New feature or request

Comments

@kuwas
Copy link

kuwas commented Dec 6, 2019

Description

Please add support for the new branch protection features:

  • required_linear_history
  • allow_force_pushes
  • allow_deletions

Terraform Version

Terraform v0.12.16

Affected Resource(s)

  • github_branch_protection

Terraform Configuration Files

resource "github_branch_protection" "example" {
  repository = "example-repo"
  branch = "master"
  required_linear_history = true
  allow_force_pushes = false
  allow_deletions = false
}

Debug Output

n/a

Panic Output

n/a

Expected Behavior

New branch protection features are supported

Actual Behavior

New branch protection features are not supported

Steps to Reproduce

n/a

Important Factoids

Currently not supported by go-github client, see references below

References

@arri-cc
Copy link

arri-cc commented Feb 27, 2020

Now that #342 is merged, this update is now possible. Working on it now.

@arri-cc
Copy link

arri-cc commented Feb 28, 2020

actually, we need the latest version v29.0.3 https://github.com/google/go-github/tree/v29.0.3

I'll submit a separate PR to hopefully get that done first.

@martinssipenko
Copy link
Contributor

@arri-cc you are correct. I tried doing a simple upgrade, but turned out it's not that simple, I've opened issue #368 where I outlined the issue.

@benj-fletch
Copy link
Contributor

@arri-cc I think you will also encounter issues when upgrading the Terraform version as there is a Go 1.12 SDK feature used in TF v0.12.14 onwards causing issues as we are on Go 1.11.
I have raised #370 to hopefully remediate this issue

@arri-cc
Copy link

arri-cc commented Feb 28, 2020

@arri-cc I think you will also encounter issues when upgrading the Terraform version as there is a Go 1.12 SDK feature used in TF v0.12.14 onwards causing issues as we are on Go 1.11.
I have raised #370 to hopefully remediate this issue

Interesting, we're currently using Terraform v0.12.15, so thanks for the heads up.

@yordis
Copy link

yordis commented Mar 5, 2020

@arri-cc are you still working on this? Can I help somehow?

@yordis yordis mentioned this issue Mar 5, 2020
10 tasks
@arri-cc
Copy link

arri-cc commented Mar 5, 2020

@yordis Hi!

I've been waiting in the wings while @benj-fletch and @martinssipenko sort out a number of issues that were discovered after upgrading to go-github v29.0.2.
#370 and #372 are now completed. Now what's left is the upgrade to go-github v29.0.3, which is the release that adds the branch protection features we're interested in. The remaining open issue (afaik) is here #369, which appears to be near completion.

@arri-cc
Copy link

arri-cc commented Apr 1, 2020

looks like we have go-github v29.0.3 now, i'll revisit this

@kuwas
Copy link
Author

kuwas commented Jun 24, 2020

@jcudit Will #473 be merged soon? Thanks

@TigerC10
Copy link

Looking forward to #473 😄

@jcudit jcudit added Type: Feature New feature or request r/branch_protection labels Dec 8, 2020
@jimsmith-fd
Copy link

+1 for required_linear_history or require_linear_history whatever the argument will be settled on.

I posted a comment here (as there seems to be a few splits for this argument) #473 (comment)

@jcudit
Copy link
Contributor

jcudit commented Apr 6, 2021

I'm now seeing requiresLinearHistory, allowsDeletions and allowsForcePushes available via the GraphQL API for BranchProtectionRule. Seems like we can proceed with making these configurable for the github_branch_protection resource.

I had hoped the github_branch_protection_v3 resource was transitional and did not plan on updating it with new features. Curious to hear if just enabling these features for just the github_branch_protection resource would satisfy everyone or if there are a lot of users still stuck on github_branch_protection_v3.

@anelson
Copy link

anelson commented Apr 23, 2021

I had hoped the github_branch_protection_v3 resource was transitional and did not plan on updating it with new features. Curious to hear if just enabling these features for just the github_branch_protection resource would satisfy everyone or if there are a lot of users still stuck on github_branch_protection_v3

We are not using github_branch_protection_v3 at all. Eagerly awaiting the additional of requiresLinearHistory support to github_branch_protection!

@majormoses
Copy link
Contributor

I'm now seeing requiresLinearHistory, allowsDeletions and allowsForcePushes available via the GraphQL API for BranchProtectionRule. Seems like we can proceed with making these configurable for the github_branch_protection resource.

I had hoped the github_branch_protection_v3 resource was transitional and did not plan on updating it with new features. Curious to hear if just enabling these features for just the github_branch_protection resource would satisfy everyone or if there are a lot of users still stuck on github_branch_protection_v3.

I think there are probably some orgs stuck on v3 for various reasons, my org is not using it anymore. I think we should support both APIs while github keeps pushing features to it. It does not mean that we have to have 1:1 feature parity though that would be ideal as it makes it easier for folks to migrate when they are ready.

@dududko
Copy link

dududko commented Aug 3, 2021

Any update on this issue ?

@charlie-collard
Copy link
Contributor

I've just submitted a PR to add this, tested to work locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue Good for newcomers r/branch_protection Type: Feature New feature or request
Projects
None yet