Attempted fix for #1657#1774
Conversation
- use app_id rather than memory address - don't mix contexts and checks
|
@yaakov-h can you describe how you've tested this manually so I can replicate it? Thank you for contributing! |
|
I believe this is a valid repro: #1657 (comment) The current behaviour is that this line is printing a pointer to the app ID as an integer: From the end-user perspective, the App ID is "changing all the time" described in the issue. Because we are printing the pointer and not the actual value. The suggested fix here looks reasonable to me 👍 |
|
@kfcampbell I used the existing config I was working on (the resource I posted at the top of the PR) and used Terraform |
|
@kfcampbell is it possible to validate this one and release new version of the provider? We're migrating to v5 provider given the hundreds of the repositories we have it makes the plan pretty unusable |
- 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>
@yaakov-h The problem is that if you set both |
|
@entropitor I think if you set both then that would be consumer error, but tbh I'd be in favour of removing contexts entirely as mentioned in #1701 as that also gets rid of the problem of deprecation warnings. |
- use app_id rather than memory address - don't mix contexts and checks Co-authored-by: Keegan Campbell <me@kfcampbell.com>
Resolves #1657
Behavior
Given the following resource:
Before the change?
After the change?
The GitHub API returns the
contextsvalue, so users will either need to include this deprecated field in their HCL or setignore_changesforrequired_status_checks.contexts, and then ignore the deprecation warning that the field they are ignoring is deprecated.Other information
I'm not very experienced in Go so this can probably be done better.
I've also ignored the AppID entirely if it is omitted from JSON or is a JSON
null, which can happen if a user changes the branch protection policy from requiring a specific app to allowing any GitHub app.This will probably need some unit tests added too, though #1415 didn't have any when it added checks in the first place.
Additional info
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
Type: Breaking changelabel)If
Yes, what's the impact:Pull request type
Please add the corresponding label for change this PR introduces:
Type: BugType: FeatureType: DocumentationType: Maintenance