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

DLP: Added sample for de-identify table with FPE #3234

Merged

Conversation

dinesh-crest
Copy link
Contributor

DLP: Added sample for de-identify table with FPE
Added unit test cases for same

PS:- I have marked the test cases to skip as the required resources are not available. I have verified locally and the test cases seem to be working fine if resources are provided.

Description

Reference:- https://cloud.google.com/dlp/docs/samples/dlp-deidentify-table-fpe

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

  • I have followed guidelines from CONTRIBUTING.MD and Samples Style Guide
  • Tests pass: npm test (see Testing)
  • Lint pass: npm run lint (see Style)
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new sample directory, and I created GitHub Actions workflow for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

@dinesh-crest dinesh-crest requested review from a team as code owners May 26, 2023 12:30
@product-auto-label product-auto-label bot added api: dlp Issues related to the Sensitive Data Protection API. samples Issues that are directly related to samples. labels May 26, 2023
@dinesh-crest
Copy link
Contributor Author

This sample requires resources like valid keyName and wrappedKey. I don't see any reference to their availability in the existing test cases from Environment variables. I also observed in the existing test cases that if resources are not available, they are marked to skip, so I have followed the same pattern. I have also tested locally and if those resources are provided, the test cases run fine.

@snippet-bot
Copy link

snippet-bot bot commented May 26, 2023

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@annadata annadata assigned annadata and unassigned realjordanna May 30, 2023
@annadata annadata added kokoro:force-run Add this label to force Kokoro to re-run the tests. actions:force-run labels May 30, 2023
@kokoro-team kokoro-team removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels May 30, 2023
@@ -333,4 +335,29 @@ describe('deid', () => {
}
assert.include(output, 'INVALID_ARGUMENT');
});

// dlp_deidentify_table_fpe
it.skip('should de-identify table using Format Preserving Encryption (FPE)', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are we skipping the tests in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They were skipped because we didn't have resources like wrappedKey and keyName. Anyway, now we are using mock API calls, so removed the it.skip now and updated the tests. Thanks

Copy link
Collaborator

@kweinmeister kweinmeister left a comment

Choose a reason for hiding this comment

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

Skipped tests

@pattishin
Copy link
Contributor

@dinesh-crest please reference comment I made here to resolve the dlp workflow failure #3240 (comment)

Copy link

@annadata annadata left a comment

Choose a reason for hiding this comment

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

Please address minor comments.

dlp/system-test/mockdata.js Show resolved Hide resolved
dlp/deIdentifyTableWithFpe.js Show resolved Hide resolved
@annadata annadata added kokoro:force-run Add this label to force Kokoro to re-run the tests. actions:force-run labels Jun 13, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 13, 2023
@annadata annadata added kokoro:force-run Add this label to force Kokoro to re-run the tests. actions:force-run labels Jun 13, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 13, 2023
@annadata
Copy link

/gcb

@annadata annadata added kokoro:force-run Add this label to force Kokoro to re-run the tests. actions:force-run labels Jun 13, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 13, 2023
@annadata
Copy link

@dinesh-crest Please have a look at the test failures.

@annadata annadata added kokoro:force-run Add this label to force Kokoro to re-run the tests. actions:force-run labels Jun 14, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 14, 2023
@annadata annadata added kokoro:force-run Add this label to force Kokoro to re-run the tests. actions:force-run labels Jun 14, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 14, 2023
@dinesh-crest
Copy link
Contributor Author

Skipped tests

@kweinmeister resolved

@annadata annadata added kokoro:force-run Add this label to force Kokoro to re-run the tests. actions:force-run labels Jun 20, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 20, 2023
@annadata annadata added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed actions:force-run labels Jun 21, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 21, 2023
@kweinmeister kweinmeister merged commit 76c51f0 into GoogleCloudPlatform:main Jun 21, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: dlp Issues related to the Sensitive Data Protection API. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants