Skip to content

Conversation

@shollyman
Copy link
Contributor

This PR is the first of a series that is meant to improve the structure
of the gapic generator. This PR improves how the plugin configuration
flow works, and provides a centralized place for new plugin args to be
mapped to specific configuration options. It also makes it easier to do
validation by moving them into the specific options, rather than having
this all in one big parse function.

There's a couple things called out as TODOs for renaming. The point
here is to keep this PR minimally invasive, as it avoids having to visit
the callsites for all the places which rely on the current names. We
can do the renames individually through a series of small followups.

The main oddity here is the error feedback in the option pattern.
Rather than iterating through the args and collecting opts to apply, we
apply them when encountered which lets us fail immediately. We could
collect errors at apply, but I favored a "fail as early as possible"
approach to avoid risks of silently missing validation opportunities.

This PR is the first of a series that is meant to improve the structure
of the gapic generator.  This PR improves how the plugin configuration
flow works, and provides a centralized place for new plugin args to be
mapped to specific configuration options.  It also makes it easier to do
validation by moving them into the specific options, rather than having
this all in one big parse function.

There's a couple things called out as TODOs for renaming.  The point
here is to keep this PR minimally invasive, as it avoids having to visit
the callsites for all the places which rely on the current names.  We
can do the renames individually through a series of small followups.

The main oddity here is the error feedback in the option pattern.
Rather than iterating through the args and collecting opts to apply, we
apply them when encountered which lets us fail immediately.  We could
collect errors at apply, but I favored a "fail as early as possible"
approach to avoid risks of silently missing validation opportunities.
@shollyman shollyman requested a review from a team as a code owner October 23, 2025 20:37
@shollyman shollyman merged commit f6706de into googleapis:main Oct 27, 2025
7 checks passed
@shollyman shollyman deleted the fr-config-refactor branch October 27, 2025 21:20
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