Skip to content

updated pull_request_bypassers structs for app, like push actors - #1453

Merged
kfcampbell merged 3 commits into
integrations:mainfrom
pippitt:fix-app-pull_request_bypassers-validation
Jan 3, 2023
Merged

kfcampbell merged 3 commits into
integrations:mainfrom
pippitt:fix-app-pull_request_bypassers-validation

Conversation

@pippitt

@pippitt pippitt commented Dec 23, 2022

Copy link
Copy Markdown
Contributor

Resolves #1367

Behavior

Before the change?

  • Github apps added to the pull_request_bypassers would add correctly, but each plan/apply would re-add the app ID.

After the change?

  • terraform plan/apply will no longer see the app ID as invalid/missing when it exists (as expected).

Other information

  • Duplicated the logic from push actors

Additional info

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features) (didn't see tests for push actors)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Added the appropriate label for the given change

Does this introduce a breaking change?

  • Yes (Please add the Type: Breaking change label)
  • No

Pull request type

  • Bugfix: Type: Bug

@pippitt

pippitt commented Dec 23, 2022 •

Copy link
Copy Markdown
Contributor Author

Manual testing notes
on provider version 5.12.0 plan will show change after the apply

terraform plan
data.github_user.pippitt: Reading...
github_repository.test_repo: Refreshing state... [id=test_repo]
data.github_app.test_app: Read complete after 0s [id=274220]
data.github_user.pippitt: Read complete after 1s [id=5528902]
github_branch_protection.test_repo_protect: Refreshing state... [id=BPR_kwDOIpT-eM4B7iQj]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # github_branch_protection.test_repo_protect will be updated in-place
  ~ resource "github_branch_protection" "test_repo_protect" {
        id                              = "BPR_kwDOIpT-eM4B7iQj"
        # (11 unchanged attributes hidden)

      ~ required_pull_request_reviews {
          ~ pull_request_bypassers          = [
              + "A_kwHOByaEfM4ABC8s",
                # (1 unchanged element hidden)
            ]
            # (6 unchanged attributes hidden)
        }
    }

Plan: 0 to add, 1 to change, 0 to destroy.

When running on build from PR, no changes on plan

terraform plan
│ Warning: Provider development overrides are in effect
│
│ The following provider development overrides are set in the CLI configuration:
│  - integrations/github in /Users/matt.pippitt/go/bin
│
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases.
╵
data.github_user.pippitt: Reading...
data.github_app.test_app: Reading...
github_repository.test_repo: Refreshing state... [id=test_repo]
data.github_app.test_app: Read complete after 0s [id=274220]
data.github_user.pippitt: Read complete after 1s [id=5528902]
github_branch_protection.test_repo_protect: Refreshing state... [id=BPR_kwDOIpT-eM4B7iQj]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

@nickfloyd nickfloyd added the Type: Feature New feature or request label Dec 30, 2022

@kfcampbell kfcampbell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for contributing!

@kfcampbell
kfcampbell merged commit 3544490 into integrations:main Jan 3, 2023
avidspartan1 pushed a commit to avidspartan1/terraform-provider-github that referenced this pull request Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Apps defined as pull_request_bypassers in github_branch_protection are not properly tracked by provider

3 participants