Skip to content

fix(security_center): Rename region tag security_center_list_findings_within_time_range and move sample into security_command_center folder #10288

Open
Kef131 wants to merge 3 commits into
mainfrom
fix(security_center)-new_region_tag_securitycenterlistfindingswithintimerange_and_move_into_securitycommandcenter
Open

fix(security_center): Rename region tag security_center_list_findings_within_time_range and move sample into security_command_center folder #10288
Kef131 wants to merge 3 commits into
mainfrom
fix(security_center)-new_region_tag_securitycenterlistfindingswithintimerange_and_move_into_securitycommandcenter

Conversation

@Kef131

@Kef131 Kef131 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes # b/517939862

Updated the region tag from securitycenter_list_findings_at_time to securitycenter_list_findings_within_time_range in FindingSnippets.java. Also Moved all snippets from securitycenter into security-command-center.

  • Fixed errors already present on security-command-center folder: When the tests attempted to iterate over lazy-loaded PagedResponse (used a try-with-resources block to create the SecurityCenterManagementClient client), after the helper method had exited, the client was already closed and its internal executor was terminated, resulting in the RejectedExecutionException. Then modified the 7 helper list classes in management/api to return an ImmutableList of the results rather than the lazy-loaded PagedResponse object.

Extra info for reviewers and for history

The region tag is still located in https://github.com/googleapis/google-cloud-java/blob/40f72f78e6781170c7f552b8fc18d242b29de625/google-cloud-examples/src/main/java/com/google/cloud/examples/securitycenter/snippets/FindingSnippets.java, google-cloud-java repo which is automatically collected to create the sampler, once this tag is renamed I can then modify the metadata to rename the previous region tag, this would remove the reference to the other repo by DKG and then obtain the one from java-docs-samples.

Checklist

  • I have followed Sample Format Guide
  • pom.xml parent set to latest shared-configuration
  • 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)
  • Tests pass: mvn clean verify required (Integration tests are skipped during compile using -DskipTests since they require live organization credentials, but all main and test code compiles successfully)
  • Lint passes: mvn -P lint checkstyle:check required
  • Static Analysis: mvn -P lint clean compile pmd:cpd-check spotbugs:check advisory only (Static analysis fails under JDK 25 environment due to ErrorProne plugin compatibility issues with jdk.compiler module exports)
  • 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
  • Please merge this PR for me once it is approved

@product-auto-label product-auto-label Bot added samples Issues that are directly related to samples. api: securitycenter Issues related to the Security Command Center API. labels Jun 23, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the region tags in FindingSnippets.java to securitycenter_list_findings_within_time_range and removes an unused Maven project file. The reviewer points out that the method name listFindingsAtTime and its Javadoc should be updated to maintain consistency with the renamed region tag.

@Kef131 Kef131 self-assigned this Jun 24, 2026
@Kef131 Kef131 marked this pull request as ready for review June 24, 2026 15:11
@Kef131 Kef131 requested review from a team and yoshi-approver as code owners June 24, 2026 15:11
@Kef131 Kef131 requested a review from amcolin June 24, 2026 15:39

@amcolin amcolin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: securitycenter Issues related to the Security Command Center API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants