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

Revert github_branch_protection GraphQL Implementation #582

Closed
wants to merge 5 commits into from

Conversation

jcudit
Copy link
Contributor

@jcudit jcudit commented Nov 1, 2020

This reverts the github_branch_protection resource back to the v3.0.0 implementation, reverting the GraphQL implementation merged in https://github.com/terraform-providers/terraform-provider-github/pull/337.

Migration from v3.0.0 to this version has been tested and requires no configuration changes.

$ TF_LOG=TRACE terraform plan
...
2020/11/01 15:02:52 [TRACE] UpgradeResourceState: upgrading state for github_branch_protection.test from version 0 to 2 using provider "registry.terraform.io/-/github"
...
No changes. Infrastructure is up-to-date.

Migration from v3.1.0 to the next release has been tested and requires the following example configuration changes:

# v3.1.0

resource "github_branch_protection" "test" {

  repository_id = github_repository.test.node_id
  pattern       = "main"

  push_restrictions = [
    github_team.first.node_id, github_team.second.node_id,
  ]

}
# next release

resource "github_branch_protection" "test" {

  repository = github_repository.test.name
  branch     = "main"

  restrictions {
    users = []
    teams = [github_team.first.slug, github_team.second.slug]
    apps  = []
  }

}
$ TF_LOG=TRACE terraform plan
...
2020/11/01 15:09:58 [TRACE] UpgradeResourceState: upgrading state for github_branch_protection.test from version 1 to 2 using provider "registry.terraform.io/-/github"
...
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

/cc https://github.com/terraform-providers/terraform-provider-github/issues/566

Jeremy Udit added 3 commits November 1, 2020 14:52

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@ghost ghost added size/XXL Type: Documentation Improvements or additions to documentation labels Nov 1, 2020
@jcudit jcudit force-pushed the revert-branch-protection branch from 546a919 to bd1e62e Compare November 1, 2020 20:33
@jcudit jcudit marked this pull request as ready for review November 1, 2020 20:54
@jcudit
Copy link
Contributor Author

jcudit commented Nov 4, 2020

Closing this as we've discussed rolling forward with v4.0.0 instead.

@jcudit jcudit closed this Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XXL Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant