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

Added ForceNew on labels #4734

Merged
merged 3 commits into from
May 3, 2021

Conversation

edwardmedia
Copy link
Contributor

@edwardmedia edwardmedia commented Apr 27, 2021

Fixes hashicorp/terraform-provider-google#9000

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)

logging: fixed `metric_descriptor.labels` can't be updated on 'google_logging_metric'

@google-cla google-cla bot added the cla: yes label Apr 27, 2021
@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@melinath, please review this PR or find an appropriate assignee.

@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 ( 1 file changed, 1 insertion(+))
Terraform Beta: Diff ( 1 file changed, 1 insertion(+))
Ansible: Diff ( 1 file changed, 1 insertion(+), 1 deletion(-))

@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=184495"

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccBillingBudget_billingBudgetUpdateRemoveFilter|TestAccBillingBudget_billingBudgetLastperiodExample|TestAccBillingBudget_billingBudgetBasicExample|TestAccBillingBudget_billingBudgetFilterExample|TestAccBillingBudget_billingBudgetNotifyExample|TestAccComputeBackendService_internalLoadBalancing You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=184501"

@edwardmedia edwardmedia changed the title Added ForeNew on labels Added ForceNew on labels Apr 28, 2021
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.

From the docs it looks like description can be modified without recreating the resource - perhaps input should just be on key and valueType?

It would be great to have a test that would have caught this - i.e. verifying that label deletion works.

@edwardmedia
Copy link
Contributor Author

The issue on the labels field, not on description.

@edwardmedia edwardmedia requested a review from melinath April 30, 2021 20:47
@melinath
Copy link
Member

yes, the issue is not with description - it should be safe to update description without recreating the resource. With the current PR, it seems like updating the description would be a change to the label, which would cause the entire resource to be recreated. Is that correct?

I think we only need to recreate if a label key or valueType changes; we shouldn't recreate if a label description changes.

@edwardmedia
Copy link
Contributor Author

I see what you mean now. Thank you. @melinath Updating the PR

@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, 61 insertions(+))
Terraform Beta: Diff ( 2 files changed, 61 insertions(+))
Ansible: Diff ( 1 file changed, 3 insertions(+), 1 deletion(-))

@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=185262"

@edwardmedia
Copy link
Contributor Author

@melinath I added a test on updating description

@modular-magician
Copy link
Collaborator

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

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.

The test should be making sure that changing the label key works (rather than the description), since changing the label key was the original trigger of the bug.

@edwardmedia
Copy link
Contributor Author

edwardmedia commented May 3, 2021

Changes in key and/or value triggers recreation. There is nothing we should do in test for these two fields. We want to make sure changing description does not trigger recreation

@melinath
Copy link
Member

melinath commented May 3, 2021

per discussion:

  • not adding a regression test because it would be slow (and ForceNew means that it will always succeed, so we don't test that kind of update because tests are slow.)
  • The description test isn't strictly related to the bug but it doesn't hurt anything either and it's doing a useful thing.

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_logging_metric should be recreated when renaming label
3 participants