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 updation capability in google_data_loss_prevention_stored_info_type resource #7601

Conversation

abheda-crest
Copy link
Contributor

@abheda-crest abheda-crest commented Apr 3, 2023

Added updation capability for dictionary, regex, and large_custom_dictionary fields in the google_data_loss_prevention_stored_info_type resource.

Added updation capability for the group_indexes subfield inside the regex field in the google_data_loss_prevention_stored_info_type resource.

fixes hashicorp/terraform-provider-google#8435

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)

dlp: Changed `dictionary`, `regex`, `regex.group_indexes` and `large_custom_dictionary` fields in `google_data_loss_prevention_stored_info_type` to be update-in-place

@abheda-crest abheda-crest requested a review from a team as a code owner April 3, 2023 12:07
@abheda-crest abheda-crest requested review from roaks3 and removed request for a team April 3, 2023 12:07
@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Apr 3, 2023
@abheda-crest
Copy link
Contributor Author

This PR also targets the issue of group_indexes not being updated through the PATCH call. As mentioned in the comment of this issue, there was a temporary solution of force recreation of the resource when group_indexes is updated but support for PATCH call was required. As this PR introduces updation capability for regex field which is parent field for group_indexes, I've removed ForceNew behaviour for group_indexes field and added relevant tests.

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Apr 4, 2023
@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, 336 insertions(+), 4 deletions(-))
Terraform Beta: Diff ( 2 files changed, 336 insertions(+), 4 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2548
Passed tests 2269
Skipped tests: 275
Affected tests: 4

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccFirebaserulesRelease_BasicRelease|TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample|TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample[Debug log]
TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example[Debug log]
TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample[Debug log]

All tests passed
View the build log or the debug log for each test

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Apr 4, 2023
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.

Just one comment for now, but code looks good. Running the VCR tests now, and if those look good will approve.

# See the License for the specific language governing permissions and
# limitations under the License.
-%>
func storedInfoTypeCustomizeDiffFunc(diff TerraformResourceDiff) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add a comment here to explain why this is needed? It could mention that updates can be done on these fields if they are changed, but not if the user changes between dictionary/regex/large_custom_dictionary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added comments for this customizedDiff in this PR.

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Apr 4, 2023
@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, 336 insertions(+), 4 deletions(-))
Terraform Beta: Diff ( 2 files changed, 336 insertions(+), 4 deletions(-))
TF Validator: Diff ( 3 files changed, 32 insertions(+), 4 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2550
Passed tests 2272
Skipped tests: 275
Affected tests: 3

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccFirebaserulesRelease_BasicRelease|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample|TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample[Debug log]
TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example[Debug log]

All tests passed
View the build log or the debug log for each test

@roaks3 roaks3 self-requested a review April 4, 2023 21:33
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.

LGTM, just going to update the release notes a bit

@roaks3 roaks3 merged commit 61cb3dd into GoogleCloudPlatform:main Apr 4, 2023
ehorning pushed a commit to ehorning/magic-modules that referenced this pull request Apr 4, 2023
…type resource (GoogleCloudPlatform#7601)

* Added updation capability in data_loss_prevention_stored_info_type resource

* Adjusted the extra whitespaces in the data_loss_prevention_stored_info_type_test file
jingcongw pushed a commit to jingcongw/magic-modules-test that referenced this pull request Apr 7, 2023
…type resource (GoogleCloudPlatform#7601)

* Added updation capability in data_loss_prevention_stored_info_type resource

* Adjusted the extra whitespaces in the data_loss_prevention_stored_info_type_test file
hao-nan-li pushed a commit to hao-nan-li/magic-modules that referenced this pull request Apr 11, 2023
…type resource (GoogleCloudPlatform#7601)

* Added updation capability in data_loss_prevention_stored_info_type resource

* Adjusted the extra whitespaces in the data_loss_prevention_stored_info_type_test file
maphad pushed a commit to maphad/magic-modules that referenced this pull request Apr 12, 2023
…type resource (GoogleCloudPlatform#7601)

* Added updation capability in data_loss_prevention_stored_info_type resource

* Adjusted the extra whitespaces in the data_loss_prevention_stored_info_type_test file
ericayyliu pushed a commit to ericayyliu/magic-modules that referenced this pull request Jul 26, 2023
…type resource (GoogleCloudPlatform#7601)

* Added updation capability in data_loss_prevention_stored_info_type resource

* Adjusted the extra whitespaces in the data_loss_prevention_stored_info_type_test file
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.

Update support for DLP stored info type
3 participants