Skip to content

Conversation

@brittanycho
Copy link
Contributor

Adds listServices and also defines trigger within runv2.ts

Adds listServices to runV2.ts and defines trigger within endpointFromService function. These functions will be utilized listServices so that functions::list can utilize cloud run api

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @brittanycho, 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 introduces a new listServices utility to runv2.ts for fetching Cloud Run services, which will be crucial for the functions::list command to interact with the Cloud Run API. It also enhances the endpointFromService function to correctly interpret and define function triggers (HTTP or event-based) based on service annotations, improving the accuracy of service representation.

Highlights

  • New listServices Function: Introduced an asynchronous function listServices in runv2.ts to retrieve Cloud Run services, specifically filtering for those managed by Cloud Functions or Firebase Functions.
  • Trigger Definition Enhancement: The endpointFromService function in runv2.ts now dynamically defines triggers (HTTP or event-based) based on the TRIGGER_TYPE_ANNOTATION in service annotations.
  • Cloud Run API Integration: The new listServices function is designed to be utilized by functions::list to leverage the Cloud Run API for service discovery.
  • Comprehensive Testing: Added extensive unit tests for listServices in runv2.spec.ts, covering scenarios like successful retrieval, pagination, error handling, and service filtering.
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
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 listServices function to runv2.ts and updates trigger handling. My review focuses on improving the efficiency and robustness of the new listServices function by suggesting the use of server-side filtering and aligning the tests with the actual behavior of the API client. The changes to trigger handling in endpointFromService look good and are a clear improvement.

@brittanycho brittanycho requested a review from taeold November 19, 2025 00:43
: {
eventTrigger: {
eventType: service.annotations?.[TRIGGER_TYPE_ANNOTATION] || "unknown",
retry: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a TODO comment here on figuring out how we currently set this to false b/c we don't know how to recover the info from Run (vs Functions API)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added TODO


// TODO: trigger types.
httpsTrigger: {},
...(service.annotations?.[TRIGGER_TYPE_ANNOTATION] === "HTTP_TRIGGER"
Copy link
Contributor

Choose a reason for hiding this comment

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

note: There are actually few other triggers types that all kind of look like HTTP function:

  • HTTP function
  • Callable function
  • Auth Blocking function
  • Task Queue function
  • Scheduled function

I'd be okay leaving this as todo as we figure out how to encode this information to the underlying Run service that is compatible with both V2 functions and "direct to run" functions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added TODO

@brittanycho brittanycho merged commit a15cc04 into master Nov 19, 2025
48 checks passed
@brittanycho brittanycho deleted the fr/cloud-run-fns-list3 branch November 19, 2025 19:27
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Nov 19, 2025
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