-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 job_notification_emails and deidentify actions in google_data_loss_prevention_job_trigger #7687
Added job_notification_emails and deidentify actions in google_data_loss_prevention_job_trigger #7687
Conversation
…oss_prevention_job_trigger
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 ( 3 files changed, 647 insertions(+)) |
Tests analyticsTotal tests: Action takenFound 12 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccDataLossPreventionJobTrigger_dlpJobTriggerDeidentify|TestAccDataLossPreventionJobTrigger_dlpJobTriggerUpdateExample2|TestAccDataLossPreventionJobTrigger_dlpJobTriggerSccOutputExample|TestAccDataLossPreventionJobTrigger_dlpJobTriggerDataCatalogOutputExample|TestAccDataLossPreventionJobTrigger_dlpJobTriggerBigqueryRowLimitPercentageExample|TestAccDataLossPreventionJobTrigger_dlpJobTriggerUpdateExample|TestAccDataLossPreventionJobTrigger_dlpJobTriggerBigqueryRowLimitExample|TestAccDataLossPreventionJobTrigger_dlpJobTriggerBasicExample|TestAccComputeForwardingRule_update|TestAccDataSourceGoogleFirebaseAndroidAppConfig|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample|TestAccApigeeKeystoresAliasesPkcs12_ApigeeKeystoresAliasesPkcs12Example |
Tests passed during RECORDING mode: All tests passed |
mmv1/products/dlp/JobTrigger.yaml
Outdated
|
||
If a file type is set in this field that isn't supported by the Deidentify action then the job will fail and will not be successfully created/started. | ||
item_type: !ruby/object:Api::Type::Enum | ||
name: 'undefined' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name should be fileType?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out. I've updated the name to fileType
so that it is relevant as per the API docs. Just wanted to clarify that this name won't appear in the generated provider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can click the link in Diff report to check the generated resource in the provider.
file_type
is not there.
- deidentify | ||
allow_empty_object: true | ||
send_empty_value: true | ||
properties: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to double check that the value of jobNotificationEmails should be {} ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the API docs, there is no information about the object of jobNotificationEmails
. Moreover, I've tried sending jobNotificationEmails
as {} and it's working fine. I've also checked this with the API explorer and it is not suggesting any fields inside jobNotificationEmails
.
Following is the payload I've used to configure jobTriggers
with jobNotificationEmails
action:
---[ REQUEST ]---------------------------------------
{
"jobTrigger": {
"description": "Description for the job_trigger created by terraform",
"displayName": "TerraformDisplayName",
"inspectJob": {
"actions": [
{
"jobNotificationEmails": {},
"publishFindingsToCloudDataCatalog": null,
"publishSummaryToCscc": null
}
],
"inspectTemplateName": "sample-inspect-template",
"storageConfig": {
"cloudStorageOptions": {
"fileSet": {
"url": "gs://mybucket/directory/"
}
}
}
},
"status": "HEALTHY",
"triggers": [
{
"schedule": {
"recurrencePeriodDuration": "86400s"
}
}
]
}
}
---[ RESPONSE ]--------------------------------------
{
"name": "projects/{project_name}/jobTriggers/{job_trigger_id}",
"displayName": "TerraformDisplayName",
"description": "Description for the job_trigger created by terraform",
"inspectJob": {
"storageConfig": {
"cloudStorageOptions": {
"fileSet": {
"url": "gs://mybucket/directory/"
}
}
},
"inspectTemplateName": "sample-inspect-template",
"actions": [
{
"jobNotificationEmails": {}
}
]
},
"triggers": [
{
"schedule": {
"recurrencePeriodDuration": "86400s"
}
}
],
"createTime": "2023-04-13T08:22:50.200795Z",
"updateTime": "2023-04-13T08:22:50.200795Z",
"status": "HEALTHY"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot find the doc for this field, either. I asked the service team and am waiting for their response. Sorry for holding the PR a little bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked with the service team and they confirmed that this field should be an empty json object.
@@ -101,6 +101,57 @@ func TestAccDataLossPreventionJobTrigger_dlpJobTriggerPubsub(t *testing.T) { | |||
}) | |||
} | |||
|
|||
func TestAccDataLossPreventionJobTrigger_dlpJobTriggerJobNotificationEmails(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please move these two new tests to examples in JobTrigger.yaml file? https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/products/dlp/JobTrigger.yaml#L28
In this file mmv1/third_party/terraform/tests/resource_data_loss_prevention_job_trigger_test.go, can you please add tests for updating field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved these tests to examples and also added the update tests.
…ob-trigger-add-missing-actions-subfields
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, 1052 insertions(+)) |
Tests analyticsTotal tests: Action takenFound 7 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccDataLossPreventionJobTrigger_dlpJobTriggerChangingActions|TestAccDataLossPreventionJobTrigger_dlpJobTriggerDeidentifyUpdate|TestAccDataLossPreventionJobTrigger_dlpJobTriggerDeidentifyExample|TestAccDataLossPreventionJobTrigger_dlpJobTriggerJobNotificationEmailsExample|TestAccApigeeKeystoresAliasesPkcs12_ApigeeKeystoresAliasesPkcs12Example|TestAccDataSourceGoogleFirebaseAndroidAppConfig|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample |
Tests passed during RECORDING mode: All tests passed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…oss_prevention_job_trigger (GoogleCloudPlatform#7687) * Added job_notification_emails and deidentify actions in google_data_loss_prevention_job_trigger * Updated the deidentify actions enum and added update tests for deidentify action
Added
job_notification_emails
anddeidentify
actions in thegoogle_data_loss_prevention_job_trigger
resource.If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
in the generated providers to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)