Skip to content

spanner: fixed applying default_labels changes #13269

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

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

rickard-von-essen
Copy link
Contributor

@rickard-von-essen rickard-von-essen commented Mar 6, 2025

Before this fix just changing default_labels on the provider for a google_spanner_instance resulted in this error:

googleapi: Error 400: Invalid UpdateInstance request.
[...]
Must specify a non-empty field mask

Fixes hashicorp/terraform-provider-google#18445

Added one acceptance tests to surface this issue.

  • TestAccSpannerInstance_basicUpdateWithProviderDefaultLabels
spanner: fixed issue with applying changes in provider `default_labels` on `google_spanner_instance`

Copy link

github-actions bot commented Mar 6, 2025

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@NickElliot, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@github-actions github-actions bot requested a review from NickElliot March 6, 2025 08:42
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Mar 6, 2025
Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

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

one point stood out to me

Before this fix just changing default_labels on the provider for a
google_spanner_instance resulted in this error:

googleapi: Error 400: Invalid UpdateInstance request.
[...]
Must specify a non-empty field mask

Fixes hashicorp/terraform-provider-google#18445

Added one acceptance tests to surface this issue.

- TestAccSpannerInstance_basicUpdateWithProviderDefaultLabels
@rickard-von-essen
Copy link
Contributor Author

Addressed the review comment and re-executed the acceptance test.

$ make testacc TEST=./google/services/spanner TESTARGS='-run=TestAccSpannerInstance_basicUpdateWithProviderDefaultLabels$$'
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google/services/spanner -v -run=TestAccSpannerInstance_basicUpdateWithProviderDefaultLabels$ -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google/version.ProviderVersion=acc"
=== RUN   TestAccSpannerInstance_basicUpdateWithProviderDefaultLabels
=== PAUSE TestAccSpannerInstance_basicUpdateWithProviderDefaultLabels
=== CONT  TestAccSpannerInstance_basicUpdateWithProviderDefaultLabels
--- PASS: TestAccSpannerInstance_basicUpdateWithProviderDefaultLabels (60.45s)
PASS
ok      github.com/hashicorp/terraform-provider-google/google/services/spanner  61.089s

Copy link

@NickElliot This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@modular-magician modular-magician added service/spanner and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Mar 20, 2025
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 66 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 66 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 43
Passed tests: 37
Skipped tests: 5
Affected tests: 1

Click here to see the affected service packages
  • spanner

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccSpannerInstance_basicUpdateWithProviderDefaultLabels

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccSpannerInstance_basicUpdateWithProviderDefaultLabels [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

Copy link

@GoogleCloudPlatform/terraform-team @NickElliot This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

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

LGTM

@NickElliot NickElliot added this pull request to the merge queue Mar 24, 2025
Merged via the queue into GoogleCloudPlatform:main with commit b1cca42 Mar 24, 2025
21 checks passed
bcreddy-gcp pushed a commit to bcreddy-gcp/magic-modules that referenced this pull request Mar 25, 2025
JaylonmcShan03 pushed a commit to JaylonmcShan03/magic-modules-jmcshan that referenced this pull request Mar 30, 2025
Dawid212 pushed a commit to Dawid212/magic-modules that referenced this pull request Apr 9, 2025
@rickard-von-essen rickard-von-essen deleted the issue-18445 branch April 14, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BadRequest error when updating google_spanner_instance with labels set at provider level
3 participants