Skip to content

chore: Update owlbot to avoid copying generated unit tests for pure GAPIC libraries#13518

Open
lqiu96 wants to merge 2 commits into
mainfrom
disable-tests-pure-gapic
Open

chore: Update owlbot to avoid copying generated unit tests for pure GAPIC libraries#13518
lqiu96 wants to merge 2 commits into
mainfrom
disable-tests-pure-gapic

Conversation

@lqiu96

@lqiu96 lqiu96 commented Jun 18, 2026

Copy link
Copy Markdown
Member

Update all the owlbot hermetic configs to not copy over the GAPIC generated unit tests. We will instead rely on the showcase tests for coverage for functionality.

This also updates the template owlbot.yaml.monorepo.j2 to prevent new client libraries from copying over the generated unit tests. All future library generations should only contain the source code.

Part of #13296 to speed up the CIs (reducing the bulk test times).

@lqiu96 lqiu96 requested a review from blakeli0 June 18, 2026 18:28
@lqiu96 lqiu96 requested review from a team as code owners June 18, 2026 18:28

@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 refines the OwlBot hermetic build configurations across numerous Java client libraries and updates the monorepo template. The changes narrow down the directory cleanup to target specific generated client and mock test files under the com/google/cloud/ path instead of removing the entire src directory, and adjust copy paths to target src/main. However, the reviewer pointed out a critical issue: hardcoding the com/google/cloud/ package prefix in the template and individual library configurations will cause cleanup failures for libraries using other namespaces (such as com/google/area120/, com/google/shopping/, com/google/iam/, and com/google/maps/), leaving stale test files. It is recommended to use a more generic regex in the template and correct the specific package paths in the affected library configurations.

Comment thread java-area120-tables/.OwlBot-hermetic.yaml Outdated
Comment thread java-shopping-css/.OwlBot-hermetic.yaml Outdated
Comment thread java-iam-admin/.OwlBot-hermetic.yaml Outdated
Comment thread java-maps-fleetengine/.OwlBot-hermetic.yaml Outdated
@lqiu96 lqiu96 force-pushed the disable-tests-pure-gapic branch from b79bb42 to 34d4f50 Compare June 18, 2026 18:59
@lqiu96

lqiu96 commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@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 OwlBot configuration files (.OwlBot-hermetic.yaml) across numerous Java modules and the monorepo template to target /src/main instead of /src for copying and removal, while refining preservation regexes to accommodate broader package structures. A critical issue was identified in java-security-private-ca/.OwlBot-hermetic.yaml where a copy rule source path uses v.* instead of the capture group (v.*), which will cause the $1 reference in the destination path to fail.

Comment thread java-security-private-ca/.OwlBot-hermetic.yaml Outdated
@lqiu96 lqiu96 force-pushed the disable-tests-pure-gapic branch from 99537cf to 91b2e21 Compare June 18, 2026 20:10
@lqiu96 lqiu96 force-pushed the disable-tests-pure-gapic branch from 91b2e21 to aff35c6 Compare June 18, 2026 20:22
@lqiu96

lqiu96 commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@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 OwlBot configuration (.OwlBot-hermetic.yaml) across multiple Java client libraries and the monorepo template. The configuration is adjusted to copy only the src/main directory (instead of the entire src directory) and to remove generated client tests and mock services (such as *ClientTest.java, *ClientHttpJsonTest.java, and Mock*.java). This results in the deletion of these generated test and mock files from the repository. There are no review comments, so no additional feedback is provided.

@lqiu96

lqiu96 commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@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 OwlBot hermetic configuration (.OwlBot-hermetic.yaml) across numerous Java client libraries to refine the directory structure and regex patterns used during code generation. Specifically, it narrows down the removal and copying of GAPIC source files to the src/main directory instead of the entire src directory, and adds explicit exclusions for generated client tests, HTTP/JSON tests, and mock files. Consequently, various generated mock services and client test files have been deleted. The monorepo template and golden files are also updated to align with these changes. I have no feedback to provide as there are no review comments.

@blakeli0

Copy link
Copy Markdown
Contributor

Is next generation going to remove the unit tests? Or we have to manually remove them first?

@lqiu96 lqiu96 force-pushed the disable-tests-pure-gapic branch from 965c8d0 to 7df8201 Compare June 22, 2026 19:51
@lqiu96

lqiu96 commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

Is next generation going to remove the unit tests? Or we have to manually remove them first?

I believe the next generation should remove it. The remove regex should remove the specific autogenerated tests and the copy regex only copies over the files in /src/main. The existing handwritten test files in /src/test should remain.

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants