Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Do not check for changes in getters #122

Closed
wants to merge 2 commits into from
Closed

Do not check for changes in getters #122

wants to merge 2 commits into from

Conversation

gtirloni
Copy link

Fixes #104

It doesn't make sense to check for changes when reading values from resource_data.

E.g. email_template.template is never changed but we need to read it to be passed to the API during the update.

This successfully fixed the bug for me and I was able to update the email templates as expected.

Tested with terraform 0.12.7

$ make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./...) -v  -timeout 120m -coverprofile="c.out" -run ^".*"$
?   	github.com/alexkappa/terraform-provider-auth0	[no test files]
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_debugDefaults
=== RUN   TestProvider_debugDefaults/should_be_false_when_AUTH0_DEBUG_environment_variable_is_set_to_"false"
=== RUN   TestProvider_debugDefaults/should_be_false_if_no_AUTH0_DEBUG_environment_variable_is_defined
=== RUN   TestProvider_debugDefaults/should_be_true_when_AUTH0_DEBUG_environment_variable_is_set_to_"1"
=== RUN   TestProvider_debugDefaults/should_be_true_when_AUTH0_DEBUG_environment_variable_is_set_to_"true"
=== RUN   TestProvider_debugDefaults/should_be_true_when_AUTH0_DEBUG_environment_variable_is_set_to_"on"
--- PASS: TestProvider_debugDefaults (0.00s)
    --- PASS: TestProvider_debugDefaults/should_be_false_when_AUTH0_DEBUG_environment_variable_is_set_to_"false" (0.00s)
    --- PASS: TestProvider_debugDefaults/should_be_false_if_no_AUTH0_DEBUG_environment_variable_is_defined (0.00s)
    --- PASS: TestProvider_debugDefaults/should_be_true_when_AUTH0_DEBUG_environment_variable_is_set_to_"1" (0.00s)
    --- PASS: TestProvider_debugDefaults/should_be_true_when_AUTH0_DEBUG_environment_variable_is_set_to_"true" (0.00s)
    --- PASS: TestProvider_debugDefaults/should_be_true_when_AUTH0_DEBUG_environment_variable_is_set_to_"on" (0.00s)
=== RUN   TestAccClientGrant
--- PASS: TestAccClientGrant (5.42s)
=== RUN   TestAccClient
--- PASS: TestAccClient (3.04s)
=== RUN   TestAccConnection
--- PASS: TestAccConnection (4.82s)
=== RUN   TestAccConnectionAd
--- PASS: TestAccConnectionAd (2.76s)
=== RUN   TestAccConnectionWaad
--- PASS: TestAccConnectionWaad (2.80s)
=== RUN   TestAccConnectionWithEnbledClients
--- PASS: TestAccConnectionWithEnbledClients (18.08s)
=== RUN   TestAccCustomDomain
--- SKIP: TestAccCustomDomain (0.00s)
    resource_auth0_custom_domain_test.go:12: 
=== RUN   TestAccEmailTemplate
--- PASS: TestAccEmailTemplate (4.04s)
=== RUN   TestAccEmail
--- PASS: TestAccEmail (2.71s)
=== RUN   TestAccResourceServer
--- PASS: TestAccResourceServer (2.66s)
=== RUN   TestAccRuleConfig
--- PASS: TestAccRuleConfig (2.52s)
=== RUN   TestAccRule
--- PASS: TestAccRule (2.50s)
=== RUN   TestRuleNameRegexp
--- PASS: TestRuleNameRegexp (0.00s)
=== RUN   TestAccTenant
--- PASS: TestAccTenant (2.79s)
=== RUN   TestAccUserMissingRequiredParams
--- PASS: TestAccUserMissingRequiredParams (0.01s)
=== RUN   TestAccUserCreateUser
--- PASS: TestAccUserCreateUser (2.49s)
=== RUN   TestMapData
--- PASS: TestMapData (0.00s)
PASS
coverage: 76.9% of statements
ok  	github.com/alexkappa/terraform-provider-auth0/auth0	56.678s	coverage: 76.9% of statements

@github-actions
Copy link

This PR has become stale as it has been open 30 days with no activity.
Stale PRs will be closed after 5 days if no action is taken. If you
think this PR should not be closed, remove the stale label.

@github-actions github-actions bot added the stale label Dec 11, 2019
@alexkappa
Copy link
Owner

@gtirloni changes to the resource data code is quite risky to change at the moment. The lack of update tests in our test suite makes this a little hard to illustrate but the HasChange is there for a reason. The issue referenced is resolved differently however by merging #144.

@alexkappa alexkappa closed this Dec 11, 2019
@gtirloni
Copy link
Author

Understood, thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

404 Errors when updating auth0_email_template
2 participants