terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

fix: destroy the resource on drift

Open yordis opened this issue 3 years ago • 14 comments

closes 749

Based on the request from @jcudit https://github.com/integrations/terraform-provider-github/issues/749#issuecomment-945144056 related to https://github.com/integrations/terraform-provider-github/issues/749#issuecomment-939018875

yordis avatar Nov 05 '22 18:11 yordis

👋 Hey Friends, this pull request 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[bot] avatar Aug 03 '23 01:08 github-actions[bot]

hopefully will figure out how to test this locally one day 😢

yordis avatar Aug 03 '23 01:08 yordis

@yordis have you had a peek at our CONTRIBUTING.md yet? There's some environment configuration you need but testing changes locally is very doable.

kfcampbell avatar Aug 10 '23 20:08 kfcampbell

@kfcampbell definitely helped a ton, my breakpoint is being hit now. Now trying to figure out how we suppose to setup the test case for it!

yordis avatar Aug 10 '23 22:08 yordis

I am trying to figure out what function would allow me to check if a new id was assigned to the resource ... any feedback welcome

yordis avatar Aug 10 '23 22:08 yordis

The thing is working! Just the testing environment is tricky! I am unsure how to create a scenario where the external resource change and whatnot ... 😢

https://github.com/integrations/terraform-provider-github/assets/4237280/f7204e80-8413-4d3f-a1e2-7608e847115f

yordis avatar Aug 10 '23 23:08 yordis

@yordis can you build a version of the provider locally and use it to manually test?

kfcampbell avatar Aug 11 '23 21:08 kfcampbell

@kfcampbell good idea!

yordis avatar Aug 11 '23 23:08 yordis

Hey I gave it a try to test it by building the local plugin, but I couldn't figure out how to make it work:

I did the following:

cat ~/.terraformrc         
provider_installation {
  dev_overrides {
    "integrations/github" = "/Users/ubi/Developer/github.com/integrations/terraform-provider-github/bin/"
  }

  direct {}
}

No luck, I tested manually as I showed before, so maybe try on your end if you do not mind.

yordis avatar Aug 25 '23 02:08 yordis

@yordis can you try following the instructions here to build the provider locally? You should be using a dev.tfrc file in order to specify the override.

kfcampbell avatar Sep 05 '23 22:09 kfcampbell

I tried that guideline multiple times, and it didn't work.

As shown in the video, I tested by running the code in the test environment. I would appreciate it if someone took the lead in helping to do an integration test out of the generated binary.

yordis avatar Sep 15 '23 22:09 yordis

👋 Hey Friends, this pull request 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[bot] avatar Jun 12 '24 01:06 github-actions[bot]

keep

yordis avatar Jun 12 '24 14:06 yordis

Hi @yordis

We're running into the same problem just with regular action secrets. I would like to offer my help in getting this fixed.

I can see your approach is to add a new destroy_on_drift property, but could we not just respect the already available ignore_changes array? And then check for either plaintext_value or encrypted_value appearing in that array, and not destroy it on drift, instead of introducing a new variable/config option? LMK what you think.

MagnusHJensen avatar Oct 04 '24 10:10 MagnusHJensen

Why wasn't this merged?

nbali avatar Nov 13 '24 12:11 nbali

👋 Hey Friends, this pull request 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[bot] avatar Aug 11 '25 02:08 github-actions[bot]

this is funny, because we can't

nbali avatar Aug 11 '25 07:08 nbali

Thanks for updating the documentation in this PR :+1:

calebworks avatar Oct 31 '25 06:10 calebworks