Make billing budget filter credit_types and subaccounts updatable#7035
Make billing budget filter credit_types and subaccounts updatable#7035ScottSuarez merged 1 commit intomainfrom
Conversation
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Breaking Change(s) DetectedThe following breaking change(s) were detected within your pull request. If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 4 files changed, 83 insertions(+), 11 deletions(-)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed testsTestAccFirebaserulesRelease_BasicRelease|TestAccBillingSubaccount_renameOnDestroy|TestAccContainerCluster_withInvalidGatewayApiConfigChannel|TestAccBillingBudget_billingBudgetUpdate|TestAccBillingBudget_billingBudgetFilterExample|TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample|TestAccBillingBudget_billingFilterSubaccounts |
|
Tests passed during RECORDING mode: All tests passed |
trodge
left a comment
There was a problem hiding this comment.
The breaking change detection is complaining because we're removing O+C from budget_filter.credit_types and budget_filter.subaccounts, but I can't figure out why these fields needed to be O+C in the first place. The overrides were added in #4273 but the test that was failing, TestAccBillingBudget_billingBudgetBasicExample, seemed to only require budget_filter and budget_filter.credit_types_treatment be O+C.
| custom_flatten: 'templates/terraform/custom_flatten/object_to_bool.go.erb' | ||
| amount.specifiedAmount.currencyCode: !ruby/object:Overrides::Terraform::PropertyOverride | ||
| default_from_api: true | ||
| budgetFilter.creditTypes: !ruby/object:Overrides::Terraform::PropertyOverride |
There was a problem hiding this comment.
Do these overrides need to be removed to make the field updatable?
There was a problem hiding this comment.
Without removing the overrides, the test testAccBillingBudget_billingBudgetCustomPeriodUpdate failed. https://github.com/GoogleCloudPlatform/magic-modules/pull/7035/files#diff-a5c0fe03fa3b54255bdca47bd1415a24c2de3ec1715a457db27a558bd0e1b530R114.
The error is "Credit types treatment of INCLUDE_ALL_CREDITS or EXCLUDE_ALL_CREDITS requires empty list of credit_types".
The reason is that creditTypes is sent to API because of the computed override even the user does not set that field in config.
There was a problem hiding this comment.
I checked the response from API and the API does not return default values for the two fields. These two fields do not behave like computed fields.
There was a problem hiding this comment.
This should be able to be fixed while retaining the computed property. Even though this is a mistake these changes will break end users.
There was a problem hiding this comment.
@ScottSuarez , do you have an idea how to fix it while retaining the computed property?
|
Even if a value does not need to be O+C.. A transition from O+C to O is breaking as terraform state is stored for the previously O+C field. So any subsequent apply will try to resolve the diff by removing any previous value. |
|
Is this change allowed to merge to main branch with the |
|
I tested with the config https://paste.googleplex.com/6534593615233024 and current provider. The config contains the field credit_types, which is one field in the PR from O+C -> O. And then build the new provider and do terraform plan. The plan is empty. In this special case, is it not a breaking change? |
I think the case we want to test is one where |
I also tested this case that |
I can confirm. Also tested this scenario |
|
In this PR, C + O of fields credit_types and subaccounts are changed to O. I tested the following cases with built provider and do not see diff for terraform plan.
It looks like it is because the fields don't behave like computed and don't have default values in API side, the changes from C + O -> C is not breaking. |
|
Talked with @ScottSuarez , as the change from C + O to O is a breaking change, we will keep Computed property now. To remove the fields Created a bug hashicorp/terraform-provider-google#13456 and we need to remove Computed for these fields in the next major release. |
4c664f5 to
5e84578
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 4 files changed, 139 insertions(+), 12 deletions(-)) |
5e84578 to
886d117
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 4 files changed, 139 insertions(+), 12 deletions(-)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed testsTestAccContainerCluster_withInvalidGatewayApiConfigChannel|TestAccBillingBudget_billingFilterSubaccounts|TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample |
|
Tests passed during RECORDING mode: Tests failed during RECORDING mode: Please fix these to complete your PR |
Fixes https://b.corp.google.com/issues/242945866
Make fields
credit_typesandsubaccountsupdatableIf this PR is for Terraform, I acknowledge that I have:
make testandmake lintto ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)