fix: change fork to TypeString and add conditional ForceNew#2959
fix: change fork to TypeString and add conditional ForceNew#2959diofeher merged 5 commits intointegrations:mainfrom
fork to TypeString and add conditional ForceNew#2959Conversation
resource_github_repository
c5da0c5 to
62333fb
Compare
|
I wasn't able to find a way to automate the test as I was doing it manually. It would be helpful to have another round of testing, though. |
resource_github_repositoryfork in resource_github_repository
fork in resource_github_repositoryfork in resource_github_repository
2067b0c to
dc71e81
Compare
dc71e81 to
c8478e8
Compare
fork in resource_github_repositoryfork to TypeString
|
I think we might need to do the same to the |
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
|
@deiga Thanks for the catch! I previously added to them but removed them in later iterations. So just using the |
|
I tested migrating from the existing field "TypeBool" to "TypeString," and it also worked well. |
nickfloyd
left a comment
There was a problem hiding this comment.
It looks like we still need ForceNewIfChange for both source_owner and source_repo.
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
fork to TypeStringfork to TypeString and add conditional ForceNew
|
Thanks for the reviews @deiga and @nickfloyd |
| return oldValStr != "" && oldValStr != newValStr | ||
| } | ||
|
|
||
| func customDiffFunction(_ context.Context, diff *schema.ResourceDiff, v any) error { |
There was a problem hiding this comment.
I'm moving this function closer to where it's used so it's easier to read and navigate.
…grations#2959) * fix: change "fork" to TypeString * lint + computed on source_owner and source_repo Signed-off-by: Diogenes Fernandes <diofeher@gmail.com> * adding automated test Signed-off-by: Diogenes Fernandes <diofeher@gmail.com> * source_repo and source_owner logic added Signed-off-by: Diogenes Fernandes <diofeher@gmail.com> * lint Signed-off-by: Diogenes Fernandes <diofeher@gmail.com> --------- Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Resolves #2954
Before the change?
forkfield. Now that we're supporting that, any resource that adds the attribute triggers recreation, even if the attribute is the same as the one returned by the API.After the change?
Computedto the field, so the resource has access to the value to calculate if it needs to recreate the resource. By using that infork, the other two attributes are filled in.Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!