Skip to content

Add allow_force_pushes, allow_deletions and require_linear_history - #473

Closed
SanderKnape wants to merge 4 commits into
integrations:mainfrom
SanderKnape:branch-protection
Closed

SanderKnape wants to merge 4 commits into
integrations:mainfrom
SanderKnape:branch-protection

Conversation

@SanderKnape

Copy link
Copy Markdown

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

@ghost ghost added size/S Type: Documentation Improvements or additions to documentation labels May 26, 2020

@anGie44 anGie44 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this PR @SanderKnape!
Preemptively approving as changes LGTM, just some suggestions below

Output of acceptance tests:

--- PASS: TestAccGithubBranchProtection_users (15.48s)
--- PASS: TestAccGithubBranchProtection_emptyDismissalRestrictions (19.63s)
--- PASS: TestAccGithubBranchProtection_emptyItems (19.70s)
--- PASS: TestAccGithubBranchProtection_basic (31.70s)
--- PASS: TestAccGithubBranchProtection_teams (45.35s)

@ghost ghost added size/M and removed size/S labels May 29, 2020
@SanderKnape

Copy link
Copy Markdown
Author

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?

@anGie44 anGie44 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, thanks! just one thing i noted in the basic test otherwise 👍

output of acceptance tests:

--- PASS: TestAccGithubBranchProtection_emptyItems (26.49s)
--- PASS: TestAccGithubBranchProtection_emptyDismissalRestrictions (27.42s)
--- PASS: TestAccGithubBranchProtection_users (28.38s)
--- PASS: TestAccGithubBranchProtection_optionalAttributes (30.24s)
--- PASS: TestAccGithubBranchProtection_basic (36.84s)
--- PASS: TestAccGithubBranchProtection_teams (58.46s)

@anGie44 anGie44 added this to the v2.9.0 milestone May 29, 2020
@jcudit jcudit modified the milestones: v2.9.0, v2.10.0 Jun 3, 2020
@meabed

meabed commented Jun 20, 2020

Copy link
Copy Markdown

Hey Could this be merged soon please 👍 :)

@jcudit jcudit modified the milestones: v2.10.0, v3.1.0 Jul 10, 2020
@jcudit

jcudit commented Sep 13, 2020

Copy link
Copy Markdown
Contributor

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

jcudit commented Oct 3, 2020

Copy link
Copy Markdown
Contributor

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 jcudit modified the milestones: v3.1.0, v3.2.0 Oct 3, 2020
@jcudit jcudit modified the milestones: v4.1.0, v4.1.1 Nov 22, 2020
@jcudit jcudit added Type: Bug Something isn't working as documented r/branch_protection labels Dec 8, 2020
@jcudit jcudit removed this from the v4.1.1 milestone Dec 8, 2020
@jimsmith-fd

jimsmith-fd commented Feb 1, 2021 •

Copy link
Copy Markdown

+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 ?

@k24dizzle

Copy link
Copy Markdown
Contributor

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

@jcudit

jcudit commented Apr 6, 2021

Copy link
Copy Markdown
Contributor

@k24dizzle added a comment to the underlying issue over in: #305 (comment).

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.

@renannprado

Copy link
Copy Markdown

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

@schmurfy

schmurfy commented Aug 8, 2021

Copy link
Copy Markdown

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 :/

@tweiss-loreal

Copy link
Copy Markdown

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

@jcudit

jcudit commented Aug 31, 2021

Copy link
Copy Markdown
Contributor

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 #649 for further progress.

Appreciate the patience on this one 🙇🏾

@nickfloyd nickfloyd added the Status: Stale Used by stalebot to clean house label Nov 30, 2022
@nickfloyd

Copy link
Copy Markdown
Contributor

👋 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!

@github-actions github-actions Bot removed the Status: Stale Used by stalebot to clean house label Dec 9, 2022
@majormoses

Copy link
Copy Markdown
Contributor

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.

@kfcampbell kfcampbell added the Status: Pinned A way to keep old or long lived issues around label Sep 8, 2023
@georgekaz

Copy link
Copy Markdown
Contributor

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.

@kfcampbell kfcampbell closed this Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r/branch_protection size/M Status: Pinned A way to keep old or long lived issues around Type: Bug Something isn't working as documented Type: Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request > New branch protection features support