terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

Add allow_force_pushes, allow_deletions and require_linear_history

Open SanderKnape opened this issue 4 years ago • 11 comments

Closes #305.

There is an inconsistency in the naming of the require_linear_history property. The documentation writes it as required_linear_history (required). The Go GitHub Client defines it as require. I actually think require makes more sense as its a boolean value and not a list of required values. I'm also fine with changing it though, so let me know.

Output of acceptance tests:

=== RUN   TestAccGithubBranchProtection_basic
=== PAUSE TestAccGithubBranchProtection_basic
=== CONT  TestAccGithubBranchProtection_basic
--- PASS: TestAccGithubBranchProtection_basic (22.06s)
PASS
ok  	github.com/terraform-providers/terraform-provider-github/github	22.083s

SanderKnape avatar May 26 '20 20:05 SanderKnape

Thanks for the feedback @anGie44. I made some changes including a set of tests specifically for the optional attributes. Is this what you had in mind?

SanderKnape avatar May 29 '20 19:05 SanderKnape

Hey Could this be merged soon please 👍 :)

meabed avatar Jun 20 '20 21:06 meabed

Looks like recent updates to the branch protection plumbing has added conflicts to this PR. I've got this queued to address this week, but welcome anyone else jumping in to remove conflicts.

jcudit avatar Sep 13 '20 19:09 jcudit

On further reading, we are running into an incompatibility between the v3 and graphql APIs. GitHub has support queued for the createBranchProtection mutation, while this is already supported via the v3 route. I have notified the team prioritizing the fix and will push this back a release 🙃 .

jcudit avatar Oct 03 '20 00:10 jcudit

+1 for require_linear_history with github_branch_protection_v3 resource doesn't support it and same goes for github_branch_protection resource

it's a step that is needed for repo creation and not having to do an out of band tweak.

When will this be available ?

jimsmith-fd avatar Feb 01 '21 12:02 jimsmith-fd

Curious about the progress on this PR, with the branch protection concerns resolved (now that there are two separate resources for graphql/v3 branch protections), could we maybe merge this in?

cc: @jcudit

k24dizzle avatar Mar 29 '21 21:03 k24dizzle

@k24dizzle added a comment to the underlying issue over in: https://github.com/integrations/terraform-provider-github/issues/305#issuecomment-814084663.

I recommend we can proceed with a new PR that adds the features to the GraphQL version of this resource as this one is quite outdated. Possibly something I have time for this week, but would ❤️ a community contribution as well.

jcudit avatar Apr 06 '21 12:04 jcudit

Would be really great to be able to use this feature.

renannprado avatar Jun 18 '21 16:06 renannprado

I wanted to stop managing repositories config by hand and move to terraform for it but the lack of require_linear_history is blocking me from doing so :/

schmurfy avatar Aug 08 '21 08:08 schmurfy

Any update on this PR ? require_linear_history is still a blocker :/

tweiss-loreal avatar Aug 19 '21 08:08 tweiss-loreal

This feature will likely land on the latest branch_protection resource rather than the legacy branch_protection_v3 resource. We do not look far off from this landing, so please track https://github.com/integrations/terraform-provider-github/issues/649 for further progress.

Appreciate the patience on this one 🙇🏾

jcudit avatar Aug 31 '21 20:08 jcudit

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

nickfloyd avatar Nov 30 '22 16:11 nickfloyd

I would think this should stay open seeing as how a community member wrote the code and a maintainer agreed that this should be accepted into the project.

majormoses avatar Sep 02 '23 03:09 majormoses

I would think this should stay open seeing as how a community member wrote the code and a maintainer agreed that this should be accepted into the project.

Sorry, just because i got confused by this, I'll mention that this PR is now really old and the 3 fields it adds now exist in the code, obviously via a different PR, so i think it should be unpinned and closed to avoid future confusion.

georgekaz avatar Nov 27 '23 23:11 georgekaz