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 Sql Server Timezone Update Support #11202

Conversation

stameishiGoogle
Copy link
Contributor

@stameishiGoogle stameishiGoogle commented Jul 18, 2024

Release Note Template for Downstream PRs (will be copied)

sql: added in-place update support for `settings.time_zone` in `google_sql_database_instance` resource

Copy link

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

@shuyama1, 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 shuyama1 July 18, 2024 21:15
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jul 18, 2024
Copy link

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

Copy link

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

@modular-magician modular-magician added service/sqladmin-cp and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jul 25, 2024
@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, 69 insertions(+))
google-beta provider: Diff ( 2 files changed, 69 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 95
Passed tests: 80
Skipped tests: 14
Affected tests: 1

Click here to see the affected service packages
  • sql

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
  • TestAccSqlDatabaseInstance_SqlServerTimezone

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccSqlDatabaseInstance_SqlServerTimezone[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$

View the build log or the debug log for each test

@@ -1972,7 +1972,32 @@ func resourceSqlDatabaseInstanceUpdate(d *schema.ResourceData, meta interface{})
}
}

return resourceSqlDatabaseInstanceRead(d, meta)
// Check if timezone is updated.
Copy link
Member

Choose a reason for hiding this comment

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

We'll need to remove ForceNew: true from time_zone, otherwise, Terraform will always delete/recreate the resource if time_zone is changed.

@@ -2044,6 +2044,31 @@ func TestAccSqlDatabaseInstance_rootPasswordShouldBeUpdatable(t *testing.T) {
})
}

func TestAccSqlDatabaseInstance_SqlServerTimezone(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

This test only checks the creation/deletion of the resource. https://googlecloudplatform.github.io/magic-modules/develop/test/test/#add-an-update-test should cover more details on update tests. Please let me know if you have any questions adding the tests

@github-actions github-actions bot requested a review from shuyama1 July 29, 2024 23:59
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jul 30, 2024
Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Thanks for the update. Would you mind rebasing your PR to resolve the merge conflicts and add an update test for the field? See #11202 (comment) for update test details. Thank you!

@stameishiGoogle stameishiGoogle force-pushed the timezone-sql-server-update-support branch from 0d7106a to a3439cd Compare July 30, 2024 22:08
@github-actions github-actions bot requested a review from shuyama1 July 30, 2024 22:09
@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jul 31, 2024
@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, 106 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 106 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 97
Passed tests: 81
Skipped tests: 14
Affected tests: 2

Click here to see the affected service packages
  • sql

Action taken

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccSqlDatabaseInstance_SqlServerTimezone[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccSqlServerTimezone_update[Error message] [Debug log]

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

The VCR test failed with error:

 vcr_utils.go:152: Step 3/4 error: Error running apply: exit status 1
        
        Error: Error, failed to update instance settings for : googleapi: Error 400: Invalid request: Time zone cannot be changed after an instance is created., invalid
        
          with google_sql_database_instance.instance,
          on terraform_plugin_test.tf line 2, in resource "google_sql_database_instance" "instance":
           2: resource "google_sql_database_instance" "instance" {

Do you happen to know if in-place update is fully supported for the time_zone now?

The unit tests failed at lint checks. Details at https://github.com/GoogleCloudPlatform/magic-modules/actions/runs/10171954004/job/28133790678?pr=11202

Please let me know if you need help with debugging the issues.

@shuyama1
Copy link
Member

@stameishiGoogle from you GH account name, I assume that you're a googler. If so, you can follow the internal instruction to get your account registered so that the tests will get triggered automatically for your PR for faster feedback.

@github-actions github-actions bot requested a review from shuyama1 August 6, 2024 18:36
@stameishiGoogle
Copy link
Contributor Author

Followed the internal instructions to register my account with the Google organization - Also ran gofmt on resource_sql_database_instance_test.go

In place update is not yet fully supported. These changes are currently being worked on

@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, 104 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 104 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 98
Passed tests: 83
Skipped tests: 14
Affected tests: 1

Click here to see the affected service packages
  • sql

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
  • TestAccSqlServerTimezone_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccSqlServerTimezone_update[Error message] [Debug log]

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Thanks @stameishiGoogle for the update. LGTM overall. We'll need to wait until the feature's fully supported to get the test passed and then get the PR merged after. Please ping me when the feature is released. Thank you!

Copy link

@stameishiGoogle, this PR is waiting for action from you. Please address any comments or change requests, or re-request review from a core reviewer if no action is required.

Image showing the re-request review button

If no action is taken, this PR will be closed in 28 days.

This notification can be disabled with the disable-automatic-closure label.

@github-actions github-actions bot requested a review from shuyama1 August 28, 2024 19:08
@zli82016 zli82016 force-pushed the timezone-sql-server-update-support branch from 2576272 to 8d7ac3f Compare September 25, 2024 23:19
@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, 104 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 104 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 98
Passed tests: 83
Skipped tests: 14
Affected tests: 1

Click here to see the affected service packages
  • sql

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
  • TestAccSqlServerTimezone_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccSqlServerTimezone_update[Error message] [Debug log]

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

@stameishiGoogle
Copy link
Contributor Author

As of this morning, the feature should be fully rolled out! @shuyama1

@shuyama1
Copy link
Member

/gcbrun

…instance_test.go

Co-authored-by: Shuya Ma <87669292+shuyama1@users.noreply.github.com>
@github-actions github-actions bot requested a review from shuyama1 September 26, 2024 21:30
@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, 79 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 79 insertions(+), 1 deletion(-))

1 similar comment
@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, 79 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 79 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 97
Passed tests: 82
Skipped tests: 14
Affected tests: 1

Click here to see the affected service packages
  • sql

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
  • TestAccSqlDatabaseInstance_SqlServerTimezoneUpdate

Get to know how VCR tests work

1 similar comment
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 97
Passed tests: 82
Skipped tests: 14
Affected tests: 1

Click here to see the affected service packages
  • sql

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
  • TestAccSqlDatabaseInstance_SqlServerTimezoneUpdate

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccSqlDatabaseInstance_SqlServerTimezoneUpdate[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccSqlDatabaseInstance_SqlServerTimezoneUpdate[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$

View the build log or the debug log for each test

@shuyama1 shuyama1 merged commit 2fdda66 into GoogleCloudPlatform:main Sep 26, 2024
10 checks passed
sebkalis pushed a commit to sebkalis/magic-modules that referenced this pull request Sep 27, 2024
anavada pushed a commit to anavada/magic-modules that referenced this pull request Sep 30, 2024
niharika-98 pushed a commit to niharika-98/magic-modules that referenced this pull request Oct 7, 2024
trodge pushed a commit to trodge/magic-modules that referenced this pull request Oct 10, 2024
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Oct 23, 2024
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Oct 24, 2024
Philip-Jonany pushed a commit to Philip-Jonany/magic-modules that referenced this pull request Nov 4, 2024
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Nov 5, 2024
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.

5 participants