Skip to content

fix(generator): use flat_ref_types in test templates and delete remove-unused-imports - #17900

Merged
ohmayr merged 2 commits into
mainfrom
delete-remove-unused-imports-script
Jul 27, 2026
Merged

fix(generator): use flat_ref_types in test templates and delete remove-unused-imports#17900
ohmayr merged 2 commits into
mainfrom
delete-remove-unused-imports-script

Conversation

@ohmayr

@ohmayr ohmayr commented Jul 24, 2026

Copy link
Copy Markdown
Contributor
  • Switches unit test template proto imports from method.ref_types (recursive) to method.flat_ref_types (direct method parameters only).
  • Prevents unused transitive _pb2 imports from being emitted into unit test files.
  • Deletes legacy synthtool post-processing script .librarian/generator-input/client-post-processing/remove-unused-imports.yaml.

Fixes: #16359

@ohmayr
ohmayr requested a review from a team as a code owner July 24, 2026 22:18
@ohmayr ohmayr changed the title fix(gapic-generator): use flat_ref_types in unit test templates and delete remove-unused-imports script fix(generator): use flat_ref_types in test templates and delete remove-unused-imports Jul 24, 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 deletes an unused import patch configuration file and updates the Jinja templates for test generation (test_%service.py.j2) in both standard and ads-templates to use method.flat_ref_types instead of method.ref_types. I have no feedback to provide.

@chalmerlowe chalmerlowe 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

@ohmayr
ohmayr merged commit 395f764 into main Jul 27, 2026
100 checks passed
@ohmayr
ohmayr deleted the delete-remove-unused-imports-script branch July 27, 2026 16:35
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.

Remove unused imports in generated test code

2 participants