-
Notifications
You must be signed in to change notification settings - Fork 772
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
[BUG]: integration_id value returns difference that can't be ignored #2317
Comments
I have a problem which seems to be connected with yours. I can't apply a plan with integration_id other than 0, because of the same error (422 error code). Were you able to use non-0 integration_id @strachg? |
For me the 422 error code was caused by missing repository access in the configuration the GH App. This can be fixed by either allowing APP to read all repositories or using |
I also ran into this problem. In my case I want This fully prevents me from creating ruleset with required checks. I also checked the API directly and I get the same error when setting This code part looks suspicious: terraform-provider-github/github/respository_rules_utils.go Lines 492 to 501 in 061b2f5
Feels like it should be: for _, check := range params.RequiredStatusChecks {
integrationID := int64(0)
checkMap := make(map[string]interface{}{})
checkMap["context"] = check.Context
if check.IntegrationID != nil {
checkMap["integration_id"] = *check.IntegrationID
}
requiredStatusChecksSlice = append(requiredStatusChecksSlice, checkMap)
} |
I attempted to fix this problem in #2529 In the tests it looks promising that zero and 0 values are handled correctly after the change. In my local tests I could successfully create rulesets afterwards. |
Expected Behavior
When using the
github_repository_ruleset
and enabling therequired_status_checks
with arequired_check
config block, the integration_id is an optional value. When arequired_check
is configured with only thecontext
value provided, the integration_id should be ignored.Actual Behavior
When using the
github_repository_ruleset
and enabling therequired_status_checks
, if the integration_id is not supplied, once the value is updated on the github side (if you have something like Github Advanced Security), the terraform plan results show that the integration_id has been updated. Limitation in Lifecycle ignore_changes means that this value can't be ignored without ignoring allrequired_check
blocks that have been configured.If the value returned on subsequent
terraform plan
executions is used initially, when creating the required_check, the following error is returned.Terraform Version
Terraform v1.9.2
on darwin_arm64
Affected Resource(s)
Terraform Configuration Files
Steps to Reproduce
No response
Debug Output
No response
Panic Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: