Skip to content

chore(gkerecommender): Next prototype of running configure for gkerecommender#13213

Closed
jskeet wants to merge 5 commits intogoogleapis:mainfrom
jskeet:configure-gkerecommender-3
Closed

chore(gkerecommender): Next prototype of running configure for gkerecommender#13213
jskeet wants to merge 5 commits intogoogleapis:mainfrom
jskeet:configure-gkerecommender-3

Conversation

@jskeet
Copy link
Copy Markdown
Contributor

@jskeet jskeet commented Oct 23, 2025

Notes:

  • Despite go.work being in the global allowlist, the current container doesn't modify it - the output directory is relatively bare, whereas "go work use" requires all the other go.mod files to exist. The format of go.work is sufficiently simple that we could probably edit it "manually" but I'd really rather not.
  • The current container does run "go mod init" (in configure) but not "go mod tidy"

So basically our initial playbook would be:

  1. Run librarian generate -api=google/cloud/abc/v1 -library=abc
  2. Run (cd abc && go mod tidy)
  3. Run go work use ./abc
  4. Commit changes and push

(The second and third steps would only be necessary for a new library as opposed to a new API within an existing library.)

@jskeet jskeet requested a review from a team October 23, 2025 08:47
@jskeet jskeet marked this pull request as draft October 23, 2025 08:48
@snippet-bot
Copy link
Copy Markdown

snippet-bot Bot commented Oct 23, 2025

Here is the summary of changes.

You are about to add 6 region tags.

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

@jskeet jskeet added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Oct 23, 2025
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @jskeet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request is a prototype for configuring and integrating the new GKE Recommender API Go client library into the project. It sets up the necessary configuration for the librarian tool, adds the generated client code, and updates the Go module workspace to properly include and manage the new library. The changes aim to streamline the process of adding new API clients and ensure their correct build and dependency management.

Highlights

  • New Go Client Library: This pull request introduces the gkerecommender Go client library, providing an interface for the GKE Recommender API.
  • Configuration Updates: The .librarian/config.yaml file has been updated to include go.work and internal/generated/snippets/go.mod in the global allowlist, ensuring these files can be modified during the configuration process. A new library entry for gkerecommender has also been added to .librarian/state.yaml.
  • Module Integration: The go.work file is updated to include the new gkerecommender module, and internal/generated/snippets/go.mod now contains a replace directive to correctly link the local gkerecommender module.
  • Generated Code and Documentation: Numerous new files have been added, including the generated Go client code for the GKE Recommender API, its gRPC protobuf definitions, example usage snippets, and essential documentation files like CHANGES.md and README.md.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

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

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 introduces a new Go client library for the GKE Recommender API (gkerecommender). The changes include the generated client code, example snippets, and updates to the repository's configuration files to integrate the new module. While most of the changes appear to be standard for adding a new library, there is a critical configuration issue in .librarian/state.yaml that needs to be addressed. The remove_regex patterns are set to delete the essential client files that are being added, which would result in a broken library.

Comment thread .librarian/state.yaml
Comment on lines +2399 to +2408
- ^internal/generated/snippets/gkerecommender/
- ^apiv1/[^/]*_client\.go$
- ^apiv1/[^/]*_client_example_go123_test\.go$
- ^apiv1/[^/]*_client_example_test\.go$
- ^apiv1/auxiliary\.go$
- ^apiv1/auxiliary_go123\.go$
- ^apiv1/doc\.go$
- ^apiv1/gapic_metadata\.json$
- ^apiv1/helpers\.go$
- ^apiv1/gkerecommenderpb/.*$
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.

high

This remove_regex configuration appears to be incorrect. It's configured to remove all the essential generated client files and snippets that are being added in this pull request. This will likely result in a broken or incomplete client library.

For example:

  • ^internal/generated/snippets/gkerecommender/ will remove the generated snippets.
  • ^apiv1/[^/]*_client\\.go$ will remove gke_inference_quickstart_client.go.

These files are necessary for the client library to function. Please remove these regular expressions to ensure the files are preserved.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @jskeet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates the new gkerecommender Go client library into the repository. It updates the build system configuration to properly handle the new module, generates the client code and associated files, and ensures that the module is correctly referenced within the Go workspace. The overall purpose is to enable the use of the GKE Recommender API through a dedicated Go client.

Highlights

  • New Library Integration: The pull request introduces the gkerecommender Go client library, providing an interface for the GKE Recommender API. This involves adding its configuration to .librarian/state.yaml and generating all necessary client code.
  • Build System Configuration: The .librarian/config.yaml file has been updated to include go.work and internal/generated/snippets/go.mod in the global allowlist, ensuring these files can be modified during the configure process.
  • Go Module Updates: The main go.work file now includes the newly added gkerecommender module, and internal/generated/snippets/go.mod has been updated with a replace directive to correctly reference the local gkerecommender module.
  • Generated Client Code and Snippets: A comprehensive set of generated files for the gkerecommender API client has been added, including API client implementations, gRPC service definitions, documentation, example usage, and snippet metadata.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

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

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 introduces a new Go module for the GKE Recommender API, gkerecommender. The changes include the generated client library code, example snippets, and module files (go.mod, go.sum). Configuration files for the repository's tooling (.librarian/config.yaml, .librarian/state.yaml) and the Go workspace (go.work) have also been updated to incorporate this new module. My review focuses on the configuration changes, as most of the code is auto-generated. I've found a critical issue in the remove_regex configuration for the new library which would likely cause the build to fail by removing all the generated source files.

Comment thread .librarian/state.yaml
This is now fixed in the template in librariangen.
@jskeet jskeet requested a review from quartzmo October 23, 2025 09:08
@jskeet
Copy link
Copy Markdown
Contributor Author

jskeet commented Oct 23, 2025

@quartzmo I think this is a reasonable pausing point. vet now passes, which is a start. Will create a new PR for the container implementation.

@jskeet jskeet changed the title Next prototype of configure Next prototype of running configure for gkerecommender Oct 23, 2025
@quartzmo quartzmo changed the title Next prototype of running configure for gkerecommender chore(gkerecommender): Next prototype of running configure for gkerecommender Oct 23, 2025
@jskeet
Copy link
Copy Markdown
Contributor Author

jskeet commented Oct 27, 2025

Closing in favor of #13220

@jskeet jskeet closed this Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Indicates a pull request not ready for merge, due to either quality or timing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants