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 Config Changes To github_branch_protection #570

Closed
wants to merge 2 commits into from
Closed

Conversation

jcudit
Copy link
Contributor

@jcudit jcudit commented Oct 19, 2020

repository was previously removed in favour of repository_id. We
revert to repository here and transition repository_id to a computed
value that is derived from a GraphQL lookup against the provided
repository.

branch was previously removed in favour of pattern. Similarly,
pattern becomes computed and takes the value of branch. branch
now becomes deprecated for removal in the next major release.

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

`repository` was previously removed in favour of `repository_id`.  We 
revert to `repository` here and transition `repository_id` to a computed 
value that is derived from a GraphQL lookup against the provided 
`repository`.

`branch` was previously removed in favour of `pattern`.  Similarly, 
`pattern` becomes computed and takes the value of `branch`.  `branch` 
now becomes deprecated for removal in the next major release.
@ghost ghost added size/M Type: Documentation Improvements or additions to documentation labels Oct 19, 2020
@jcudit jcudit added this to the v3.1.1 milestone Oct 19, 2020
@jcudit jcudit marked this pull request as ready for review October 19, 2020 19:41
Copy link
Contributor

@woodb woodb left a comment

Choose a reason for hiding this comment

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

Looks good! There were some other breaking changes that we may want to revert, specifically around changes to required_pull_request_reviews

  • dismissal_users -> dismissal_restrictions
  • dismissal_teams -> dismissal_restrictions

Additionally, dismissal_restrictions is erroneously cited in the docs as dismissal_actors (see #569).

Should we make dismissal_restrictions a computed field w/ actor ID's from dismissal_users and dismissal_teams, adding a deprecation warning for those fields as well?

Comment on lines +26 to +28
Type: schema.TypeString,
Computed: true,
Description: "GraphQL `node_id` of a repository",
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

ForceNew: true,
Description: "",
Description: "`pattern` for a `BranchProtectionRule`",
Deprecated: "use `pattern` after v4.0.0 instead",
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Comment on lines +30 to +32
resource.TestCheckResourceAttr(
"github_branch_protection.test", "branch", "main",
),
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks

website/docs/r/branch_protection.html.markdown Outdated Show resolved Hide resolved
@davidji99
Copy link

It would be great if the PR author could add in some state migrations so users that currently define REPOSITORY_ID don't need to terraform state rm and terraform import to move to the version that will require REPOSITORY attribute.

@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
@jcudit jcudit removed this from the v4.0.1 milestone Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.1.0 has breaking changes which are not identified in changelog
3 participants