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

Make google_notebooks_instance metadata field updatable #7945

Merged
merged 7 commits into from
May 18, 2023
Merged

Conversation

melinath
Copy link
Member

@melinath melinath commented May 15, 2023

Fixes hashicorp/terraform-provider-google#14403.

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).
  • 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).
  • Generated Terraform providers, and ran make test and make lint in the generated providers to ensure it passes unit and linter tests.
  • Ran relevant acceptance tests using my own Google Cloud project and credentials (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)

notebooks: added update-in-place support for `google_notebooks_instance.metadata` field

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@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.

Terraform GA: Diff ( 1 file changed, 150 insertions(+))
Terraform Beta: Diff ( 1 file changed, 28 insertions(+), 12 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2740
Passed tests 2449
Skipped tests: 283
Affected tests: 8

Action taken

Found 8 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccNotebooksInstance_update|TestAccAlloydbBackup_missingLocation|TestAccComputeFirewallPolicyRule_multipleRules|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample|TestAccAlloydbCluster_missingLocation|TestAccApigeeKeystoresAliasesPkcs12_ApigeeKeystoresAliasesPkcs12Example|TestAccDataSourceAlloydbLocations_basic|TestAccDataSourceGoogleFirebaseAndroidAppConfig

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccAlloydbBackup_missingLocation[Debug log]
TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample[Debug log]
TestAccAlloydbCluster_missingLocation[Debug log]
TestAccApigeeKeystoresAliasesPkcs12_ApigeeKeystoresAliasesPkcs12Example[Debug log]
TestAccDataSourceAlloydbLocations_basic[Debug log]
TestAccDataSourceGoogleFirebaseAndroidAppConfig[Debug log]

Tests failed during RECORDING mode:
TestAccNotebooksInstance_update[Error message] [Debug log]
TestAccComputeFirewallPolicyRule_multipleRules[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

…nly these changes are required to make the tests pass"

This reverts commit f22a9e4.
@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.

Terraform GA: Diff ( 2 files changed, 204 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 2 files changed, 82 insertions(+), 13 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2741
Passed tests 2450
Skipped tests: 283
Affected tests: 8

Action taken

Found 8 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccNotebooksInstance_update|TestAccDataSourceGoogleFirebaseAndroidAppConfig|TestAccComputeFirewallPolicyRule_multipleRules|TestAccDataSourceAlloydbLocations_basic|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample|TestAccAlloydbCluster_missingLocation|TestAccAlloydbBackup_missingLocation|TestAccApigeeKeystoresAliasesPkcs12_ApigeeKeystoresAliasesPkcs12Example

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccNotebooksInstance_update[Debug log]
TestAccDataSourceGoogleFirebaseAndroidAppConfig[Debug log]
TestAccDataSourceAlloydbLocations_basic[Debug log]
TestAccAlloydbCluster_missingLocation[Debug log]
TestAccAlloydbBackup_missingLocation[Debug log]

Tests failed during RECORDING mode:
TestAccComputeFirewallPolicyRule_multipleRules[Error message] [Debug log]
TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample[Error message] [Debug log]
TestAccApigeeKeystoresAliasesPkcs12_ApigeeKeystoresAliasesPkcs12Example[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

@melinath melinath marked this pull request as ready for review May 16, 2023 21:04
@melinath melinath requested review from a team and roaks3 and removed request for a team May 16, 2023 21:04
Copy link
Contributor

@roaks3 roaks3 left a comment

Choose a reason for hiding this comment

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

Overall LGTM. I had a question regarding the tests, but I suspect that there is either a verification step I missed, or adding one would be more effort than it's worth.

},
{
ResourceName: "google_notebooks_instance.instance",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"vm_image"},
ImportStateVerifyIgnore: []string{"vm_image", "metadata"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Am I understanding this correctly that we aren't ever checking that the metadata is updated on the server?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes. The field is marked as ignore_read on the resource, so we never check what the value on the server is. I had to add it here because I introduced it as a new field in this test.

I suspect that we would not use ignore_read like this if implementing the resource today - but fixing that wouldn't be trivial and is outside of the scope of the ticket. In the future I think we'd want to do something similar to hashicorp/terraform-provider-google#14293.

@melinath melinath merged commit 0a88abf into main May 18, 2023
@melinath melinath deleted the tpg-14403 branch May 18, 2023 16:08
shourya116 pushed a commit to shourya116/magic-modules that referenced this pull request May 25, 2023
…latform#7945)

* Added update tests proving that metadata is not updatable

* Test fixes

* Made notebooks instance metadata field updatable

* Added metadata to ImportStateVerifyIgnore for impacted tests

* Removed non-updatable fields from update test

* Temporarily made metadata field not updatable to prove that only these changes are required to make the tests pass

* Revert "Temporarily made metadata field not updatable to prove that only these changes are required to make the tests pass"

This reverts commit f22a9e4.
ericayyliu pushed a commit to ericayyliu/magic-modules that referenced this pull request Jul 26, 2023
…latform#7945)

* Added update tests proving that metadata is not updatable

* Test fixes

* Made notebooks instance metadata field updatable

* Added metadata to ImportStateVerifyIgnore for impacted tests

* Removed non-updatable fields from update test

* Temporarily made metadata field not updatable to prove that only these changes are required to make the tests pass

* Revert "Temporarily made metadata field not updatable to prove that only these changes are required to make the tests pass"

This reverts commit f22a9e4.
wj-chen pushed a commit to wj-chen/magic-modules that referenced this pull request Aug 1, 2023
…latform#7945)

* Added update tests proving that metadata is not updatable

* Test fixes

* Made notebooks instance metadata field updatable

* Added metadata to ImportStateVerifyIgnore for impacted tests

* Removed non-updatable fields from update test

* Temporarily made metadata field not updatable to prove that only these changes are required to make the tests pass

* Revert "Temporarily made metadata field not updatable to prove that only these changes are required to make the tests pass"

This reverts commit f22a9e4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for updating google_notebooks_instance.metadata
3 participants