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

Error: Field 'bypassPullRequestAllowances' doesn't exist on type 'BranchProtectionRule' #1090

Closed
djaboxx opened this issue Mar 15, 2022 · 11 comments
Labels
Status: Stale Used by stalebot to clean house

Comments

@djaboxx
Copy link

djaboxx commented Mar 15, 2022

Terraform Version

0.14.7

Affected Resource(s)

Please list the resources as a list, for example:

  • github_branch_protection

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

# https://registry.terraform.io/providers/integrations/github/latest/docs/resources/branch_protection
resource "github_branch_protection" "main" {
  count             = var.github_create_repo ? 1 : 0
  enforce_admins    = var.github_enforce_admins_branch_protection
  pattern           = data.github_repository.repo_lookup.default_branch
  push_restrictions = []
  repository_id     = github_repository.repo[0].node_id
  required_pull_request_reviews {
    dismiss_stale_reviews           = var.github_dismiss_stale_reviews
    require_code_owner_reviews      = var.github_require_code_owner_reviews
    required_approving_review_count = var.github_required_approving_review_count
  }
  required_status_checks {
    contexts = [
      "Terraform Enterprise/${var.organization}/${var.name}",
      "sentinel/${var.organization}/${var.name}"
    ]
    strict = true
  }
  depends_on = [
    # first let the automation create the codeowners and backend file then only create branch protection rule
    # if branch protection rule is created first, codeowners will fail
    github_repository_file.codeowners,
    github_repository_file.backend
  ]
}

Debug Output

Please provide a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

This configuration was working properly, prior to latest version of provider. We are using on-prem TFE.

Actual Behavior

What actually happened?
Error: Field 'bypassPullRequestAllowances' doesn't exist on type 'BranchProtectionRule'

@djaboxx
Copy link
Author

djaboxx commented Mar 17, 2022

Error: Variable $input of type CreateBranchProtectionRuleInput! was provided invalid value for bypassPullRequestActorIds (Field is not defined on CreateBranchProtectionRuleInput)

  on .terraform/modules/workspaces.pagerduty/github_repo.tf line 71, in resource "github_branch_protection" "main":
  71: resource "github_branch_protection" "main" {

Still broken

@carocad
Copy link
Contributor

carocad commented Mar 18, 2022

From what I can see this was introduced in v4.21.0 with this PR: #1030

@carocad
Copy link
Contributor

carocad commented Mar 18, 2022

@djaboxx are you also using Github Enterprise? My guess is that the GraphQL schema on our instances doesnt include that field but public github does 😞

@kfcampbell
Copy link
Member

What version of GitHub Enterprise are you using? In the meantime, can you use v4.20.1 as a workaround?

@carocad
Copy link
Contributor

carocad commented Mar 18, 2022

GitHub Enterprise Server 3.2.10

@alexbde
Copy link

alexbde commented Mar 22, 2022

I can confirm this issue exists with GHES 3.2.10 and is resolved downgrading to provider v4.20.1.

@github-actions
Copy link

👋 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 added the Status: Stale Used by stalebot to clean house label Dec 26, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2023
@djaboxx
Copy link
Author

djaboxx commented Mar 12, 2023

When will a fix be provided for this issue?

@kfcampbell kfcampbell reopened this Mar 31, 2023
@kfcampbell
Copy link
Member

@djaboxx I can't offer a specific date that we could implement something to work around this, but we're always encouraging of contributions if you'd like to submit! Perhaps we could implement a GHES_VERSION environment variable that could be checked before constructing the GraphQL query.

Copy link

👋 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 added the Status: Stale Used by stalebot to clean house label Jan 15, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Used by stalebot to clean house
Projects
None yet
Development

No branches or pull requests

5 participants