java-docs-samples icon indicating copy to clipboard operation
java-docs-samples copied to clipboard

feat(security-command-center): add sample for creating client with regional endpoint

Open hegemonic opened this issue 1 year ago • 6 comments

Description

This sample shows how to create a Security Command Center client that uses a regional endpoint, along with a client that uses the default endpoint. That's because Security Command Center's regional endpoints support only a limited subset of Security Command Center resources that are subject to data residency controls: https://cloud.google.com/security-command-center/docs/data-residency-support#scc-regional-urls-rest

As a result, it's likely that customers will need to create two clients: one for their regional endpoint, to call the methods it supports, and another for the default endpoint, to call all other methods.

This sample will be used here: https://cloud.google.com/security-command-center/docs/data-residency-support#regional-urls

Checklist

  • [x] I have followed Sample Format Guide
  • [x] pom.xml parent set to latest shared-configuration
  • [x] Appropriate changes to README are included in PR
  • [ ] 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)
  • [x] Tests pass: mvn clean verify required
  • [x] Lint passes: mvn -P lint checkstyle:check required
  • [ ] Static Analysis: mvn -P lint clean compile pmd:cpd-check spotbugs:check advisory only
  • [ ] This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners 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
  • [x] Please merge this PR for me once it is approved

hegemonic avatar Oct 01 '24 23:10 hegemonic

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

snippet-bot[bot] avatar Oct 01 '24 23:10 snippet-bot[bot]

The Kokoro CI failures don't appear to be related to this PR. Let me know if you disagree.

hegemonic avatar Oct 02 '24 15:10 hegemonic

Hello @hegemonic, I have converted this PR to draft because it fails on multiple integration tests. Please address failing tests before submitting this PR for review.

minherz avatar Oct 02 '24 16:10 minherz

@minherz As I mentioned above, the Kokoro CI failures don't appear to be related to this PR. They involve a different set of tests that this PR doesn't update. Also, note that flaky-bot has already reported that these tests are failing at HEAD: #9542

If you don't agree, please let me know why this PR would cause these tests to fail.

hegemonic avatar Oct 02 '24 22:10 hegemonic

@minherz As I mentioned above, the Kokoro CI failures don't appear to be related to this PR. They involve a different set of tests that this PR doesn't update. Also, note that flaky-bot has already reported that these tests are failing at HEAD: #9542

If you don't agree, please let me know why this PR would cause these tests to fail.

I agree with your assessment that the failing tests do not directly related to the code changes you made. However, these tests do belong to the security-command-center set of snippets. So all the set's tests run each time any change to the set is made. And all the tests have to pass because any change can introduce indirect changes. For example, new tests may introduce a friction in the test environment(s) and influenced the results of the tests' execution.

All tests of the security-command-center have to pass before this PR can be reviewed and then merged. As someone submitting new samples it seems logical to expect that you have background in the domain. If you find yourself unable to resolve the failing tests, please reach out to maintainers of the security-command-center snippets and ask them to help with this problem. According to CODEOWNERS gcp-security-command-center team maintains this set of snippets.

minherz avatar Oct 03 '24 15:10 minherz

Yes, I'm familiar with Security Command Center, but I don't own any of these code samples—I'm just writing this one as a favor.

I'll ask one of the owners to fix the existing samples. For now, I'll move this back to a draft.

hegemonic avatar Oct 03 '24 16:10 hegemonic

#9580 was merged, so this PR is ready to review.

hegemonic avatar Oct 21 '24 19:10 hegemonic