fix: Correct secret drift implementation#3069
Conversation
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
d8a4694 to
4a14a57
Compare
nickfloyd
left a comment
There was a problem hiding this comment.
I really like this approach vs what we have. I just had some thoughts to consider.
299e8db to
c1c5bc3
Compare
|
I've updated the implementation to not require a recreate now that the diff is being handled correctly. I've also updated the pattern to correctly handle repo identity and support repo renames. |
d34ded0 to
12aef66
Compare
5a5289a to
edfa9c9
Compare
|
There is an open PR for adding import of should that be taken into account or closed? |
|
Further prior art on this topic: #2499 |
|
This might resolve #2047 |
edfa9c9 to
4d05762
Compare
ed76b3b to
ffe3c55
Compare
ffe3c55 to
64b2761
Compare
64b2761 to
6c9e156
Compare
github/resource_github_actions_environment_secret_migration_test.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
6c9e156 to
817e9a3
Compare
|
Tested this in a project and confirmed it's working as intended - updating |
|
Scratch that - secrets showed that they would be updated in place, but the actual secret value was cleared (edit: unsure if it was cleared or set to something else, but it was definitely changed). Example output from the apply of a secret whose value was wiped: |
|
@Piccirello the secret will always be set to the value that you provide in the config unless you've used a lifecycle ignore changes? But even if you're using ignore changes, changing the selected repos will update the secret to the value in config. How come you're not using the specific resources for managing selected repos outside of the actual secret? |
|
The secret is defined with
We're using the |
|
@Piccirello your current pattern won't work as changing the selected repos will cause the secret value to be updated even if it's in lifecycle ignore changes. You should be using |
|
qq - what's the platform-side impact of applying the changes to Applying the below causes the secret to be updated in some way on the GH side, trying to understand what, or if it's just a one-time push of the same secret values? # github_actions_organization_secret.EVAN_TEST will be updated in-place
~ resource "github_actions_organization_secret" "EVAN_TEST" {
- destroy_on_drift = true -> null
id = "EVAN_TEST"
# (7 unchanged attributes hidden)
} |
|
@evanrappe it's a no-op as |
|
@stevehipwell yeah its a clean apply the second time, but I'm just curious what it's actually doing on the GH api when you apply the above one-time drift, as it updates the "last updated" time for the secret on the page that lists the secrets. |
|
@evanrappe for clarity it's not a no-op, as it is putting the same secret back (it doesn't know what the secret it), but it should have no effect on your configuration. I removed the default value for |
Resolves #3049
Resolves #2782
Resolves #2913
Resolves #2047
Resolves #2518
Closes #2462
Closes #2499
Before the change?
After the change?
destroy_on_driftpattern is ignored & deprecatedPull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!