-
Notifications
You must be signed in to change notification settings - Fork 777
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]: github_branch_protection_v3.required-status-checks.checks - app_id changes all the time #1657
Comments
@bahag-klickst can you provide an example of HCL that can be used to reproduce this issue? |
@kfcampbell , sure but I am afraid that I have to explain a bit what we are doing exactly. Here is an example Call for one of the repos giving us a hard time right now, due to the mentioned issue:
The simplified module code looked like this, using the hashicorp/github version 4.xx:
With moving to integrations/github version 5.xx, we just changed the following:
As mentioned in the issue description, as checks has a different requirement reagrding the string (https://registry.terraform.io/providers/integrations/github/latest/docs/resources/branch_protection_v3#checks) we tried to fix it by adding the app_id. But unfortunately it changes with every run. We were not able to figure out why this keeps happening. |
Hi! We have the very same issue. I created a minimal example (https://github.com/mmuth/github-terraform-provider-repro/blob/main/terraform/main.tf and the HCL: https://github.com/mmuth/github-terraform-provider-repro/blob/main/terraform/.terraform.lock.hcl) It is always inconsistent, means a successful terraform apply followed by another apply will still try to change the Github repo.
we also tried around with checks like New checks can basically be added, but we also noticed that we can never delete an existing check. It is converted to "any source" only but not removed. But this might also by a symptom of the same origin (?)... |
@kfcampbell |
@bahag-klickst unfortunately our team very rarely gets the chance to pick up items like this as part of our daily work. We are very receptive to PRs though! |
It seems that contexts have been deprecated but the alternative doesn't work at all. The issue with the branch protection resources isn't fixed either (see #670). It seems that this provider is becoming really difficult to use even for basic things like applying proper branch protection. |
I encountered the same issue today. Upon checking the raw API response, the My gut sank when I realised that if the integer value changes every time the app runs... and converting it to hex makes it look quite suspicious... Anyway I dug out my old Go docs and I'm 99% certain that the bug is here:
The code tries to flatten the API response object ( Unfortunately for this repo, that There also seems to be some incorrect copy-pasting going on, as we are appending elemnts to These two loops look to me like they have a few problems that cause terraform to re-update the branch_protection_v3 resource on every run, and cleaning them up should fix this Issue as well as other problems: terraform-provider-github/github/resource_github_branch_protection_v3_utils.go Lines 53 to 64 in f8502b8
|
- use app_id rather than memory address - don't mix contexts and checks
- use app_id rather than memory address - don't mix contexts and checks Co-authored-by: Keegan Campbell <me@kfcampbell.com>
- use app_id rather than memory address - don't mix contexts and checks Co-authored-by: Keegan Campbell <me@kfcampbell.com>
- use app_id rather than memory address - don't mix contexts and checks Co-authored-by: Keegan Campbell <me@kfcampbell.com>
Describe the need
Hej all,
We are in the middle of moving from the hashicorp/github provider to integrations/github provider and are also doing a major jump from v4.xx to latest 5.xx (as of writing/testing it was 5.22).
We are now facing an issue due to changing from contexts to checks in the required-status-checks block, because the new structure of the status checks is "context:app_id", but app_id changes with every run of our pipeline?
This is of course a bad thing, because it would lead to "unnecessary" changes with every terraform plan/apply.
SDK Version
No response
API Version
No response
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: