Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add customize diff for deprecated attribute on gc_policy #4556

Merged
merged 5 commits into from
Mar 10, 2021

Conversation

ScottSuarez
Copy link
Contributor

@ScottSuarez ScottSuarez commented Mar 3, 2021

Adding customize diff when google_bigtable_gc_policy.max_age.days is equivalent to google_bigtable_gc_policy.max_age.duration.

resolves hashicorp/terraform-provider-google#8416

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

bigtable: fixed bug where gc_policy would attempt to recreate the resource when switching from deprecated attribute but maintaining the same value underlying value

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 101 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 2 files changed, 101 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=175325"

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. Just to make sure I'm understanding, it doesn't look like this tests whether there's a diff, just whether the change succeeds (but without the diff suppression it wouldn't succeed) - correct?

mmv1/compiler.rb Show resolved Hide resolved
Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like tests are failing:

Step #24 - "tpg-test": google/resource_bigtable_gc_policy.go:39:14: Error return value of `diff.Clear` is not checked (errcheck)
Step #24 - "tpg-test":      diff.Clear("max_age.0.days")
Step #24 - "tpg-test":                ^
Step #24 - "tpg-test": google/resource_bigtable_gc_policy.go:40:14: Error return value of `diff.Clear` is not checked (errcheck)
Step #24 - "tpg-test":      diff.Clear("max_age.0.duration")
Step #24 - "tpg-test":                ^
Step #23 - "tpgb-test": google-beta/resource_bigtable_gc_policy.go:39:14: Error return value of `diff.Clear` is not checked (errcheck)
Step #23 - "tpgb-test":       diff.Clear("max_age.0.days")
Step #23 - "tpgb-test":                 ^
Step #23 - "tpgb-test": google-beta/resource_bigtable_gc_policy.go:40:14: Error return value of `diff.Clear` is not checked (errcheck)
Step #23 - "tpgb-test":       diff.Clear("max_age.0.duration")
Step #23 - "tpgb-test":                 ^

@melinath
Copy link
Member

melinath commented Mar 3, 2021

I like the idea of unit tests for the diff suppress func, similar to TestDiskImageDiffSuppress - would you be open to adding some of those?

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 107 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 2 files changed, 107 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=175733"

@melinath
Copy link
Member

melinath commented Mar 5, 2021

auto-run failed. /gcbrun

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 107 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 3 files changed, 108 insertions(+), 4 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=175737"

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 190 insertions(+), 6 deletions(-))
Terraform Beta: Diff ( 3 files changed, 190 insertions(+), 6 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=175744"

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 190 insertions(+), 6 deletions(-))
Terraform Beta: Diff ( 4 files changed, 191 insertions(+), 7 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=176357"

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccApiGatewayGateway_apigatewayGatewayBasicExampleUpdated You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=176363"

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode: TestAccApiGatewayGateway_apigatewayGatewayBasicExampleUpdated Please fix these to complete your PR

@ScottSuarez ScottSuarez requested a review from melinath March 9, 2021 21:39
Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks for the tests!

@@ -74,7 +74,7 @@ func (d *ResourceDataMock) Timeout(key string) time.Duration {
type ResourceDiffMock struct {
Before map[string]interface{}
After map[string]interface{}
Cleared map[string]struct{}
Cleared map[string]interface{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised this wasn't used anywhere... Could this be map[string]bool instead?

@ScottSuarez ScottSuarez merged commit 5270653 into GoogleCloudPlatform:master Mar 10, 2021
@ScottSuarez ScottSuarez deleted the gcp branch March 10, 2021 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

google_bigtable_gc_policy max_age.days is deprecated but "doesn't support update"
3 participants