nodejs-docs-samples
nodejs-docs-samples copied to clipboard
feat:add finding sources iam samples
Description
b/339808836
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 pull request is from a branch created directly off of
GoogleCloudPlatform/nodejs-docs-samples. Not a fork. - [ ] 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
Here is the summary of changes.
You are about to add 17 region tags.
- security-center/snippets/v2/bulkMuteFindings.js:21, tag
securitycenter_bulk_mute_v2 - security-center/snippets/v2/createFinding.js:19, tag
securitycenter_create_finding_v2 - security-center/snippets/v2/createSource.js:19, tag
securitycenter_create_source_v2 - security-center/snippets/v2/getIamPolicy.js:19, tag
securitycenter_get_iam_policies_v2 - security-center/snippets/v2/getSource.js:19, tag
securitycenter_get_source_v2 - security-center/snippets/v2/groupFindings.js:20, tag
securitycenter_group_all_findings_v2 - security-center/snippets/v2/groupFindingsWithFilter.js:20, tag
securitycenter_group_filtered_findings_v2 - security-center/snippets/v2/listAllFindings.js:19, tag
securitycenter_list_findings_v2 - security-center/snippets/v2/listAllSources.js:19, tag
securitycenter_list_sources_v2 - security-center/snippets/v2/listFilteredFindings.js:19, tag
securitycenter_list_filtered_findings_v2 - security-center/snippets/v2/setFindingState.js:19, tag
securitycenter_set_findings_by_state_v2 - security-center/snippets/v2/setIamPolicy.js:19, tag
securitycenter_set_iam_polices_v2 - security-center/snippets/v2/setMuteFinding.js:21, tag
securitycenter_set_mute_v2 - security-center/snippets/v2/setUnmuteFinding.js:21, tag
securitycenter_set_unmute_v2 - security-center/snippets/v2/testIam.js:19, tag
securitycenter_test_iam_permissions_v2 - security-center/snippets/v2/updateFindingSource.js:21, tag
securitycenter_update_finding_source_properties_v2 - security-center/snippets/v2/updateSource.js:19, tag
securitycenter_update_source_v2
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
Hi @rafaelMurata, thanks for submitting. I'm going to take a look at this and your other pending pull requests and get you updates within the next five days.
Hi @rafaelMurata, I've been involved in a deep dive on security, but I just did an analysis on why tests are failing for your pull request. Here are steps for you to follow to be able to get this over the line. You can reference the commits in my experimental pull request for guidance: #3743
-
Rebase on main. I made changes (merged in #3744) to the security-center v1 workflow paths to isolate tests from v2 and make diagnosing issues easier.
-
Amend the commit message. It fails the convention commit test. Insert a space following the colon of the commit message.
Change: "feat:add finding sources iam samples"
to: "feat: add finding sources iam samples"
-
Update paths for security-center-snippets-v2.yaml. See this commit: https://github.com/GoogleCloudPlatform/nodejs-docs-samples/pull/3743/commits/5bfdac6f9aceaa18a3c4d53c81d0f83304ac67aa
-
Ensure
GCLOUD_ORGANIZATIONis set before usingtest.yaml. See this commit: https://github.com/GoogleCloudPlatform/nodejs-docs-samples/pull/3743/commits/f4deec01098d0ac4185c8807d8a874e74d015f97Also fix
projectId(see the diff forfindings.test.jsin the same commit).Note: you might also be able to set the
GCLOUD_ORGANIZATIONenvironment variable using a repository variable (tested in this commit: https://github.com/GoogleCloudPlatform/nodejs-docs-samples/pull/3743/commits/dcbefb343dd916dfd8fc6269105a702df559c73e), but this is experimental and it's not clear yet if we'll keep it. I'll shoot to have an answer by tomorrow. -
Force push your changes to update the pull request.
This should leave two final test failures (matching the experimental PR: https://github.com/GoogleCloudPlatform/nodejs-docs-samples/actions/runs/9985548491/job/27596569424?pr=3743#step:11:45).
Error: spawnSync /bin/sh ENOBUFSThis is due to exceeding the output buffer for exec. To resolve the issue, try experimenting with setting exec's maxBuffer to a larger size or perhaps consider using spawn instead of exec since that will stream output instead of buffering it.