Skip to content

Conversation

@ChrisGe4
Copy link
Contributor

@ChrisGe4 ChrisGe4 commented Nov 21, 2025

Description

The func (r runWorkerPoolResource) reportSuccess() method needs to be implemented as the cloudRunReadyEvent is not currently being reported.

User facing changes (remove if N/A)

One more event will be logged. It will looks like

{"timestamp":"2025-11-19T23:27:55.926827750Z","cloudRunReadyEvent":{"id":"projects/xxx/locations/us-central1/workerPools/wp","taskId":"Deploy-0","resource":"projects/xxx/locations/us-central1/workerPools/wp","readyRevision":"my-service-mi6msxi6"}}

Follow-up Work (remove if N/A)

… as the cloudRunReadyEvent is not currently being reported.
@ChrisGe4 ChrisGe4 requested a review from a team as a code owner November 21, 2025 18:39
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ChrisGe4, 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 enhances the event reporting mechanism for Cloud Run worker pools. Previously, the cloudRunReadyEvent was not being reported for these resources. This change introduces the necessary logic to emit this event upon successful readiness, providing clearer visibility into the deployment status of Cloud Run worker pools.

Highlights

  • Cloud Run Worker Pool Event Reporting: Implemented the reportSuccess() method for runWorkerPoolResource to ensure that a cloudRunReadyEvent is emitted when a Cloud Run worker pool successfully becomes ready.
  • New Event Function: Added a new function CloudRunWorkerPoolReady within pkg/skaffold/event/v2/cloudrun.go to specifically handle and dispatch the CloudRunReadyEvent for worker pools.
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 implements the reportSuccess method for Cloud Run worker pools to send a cloudRunReadyEvent. The implementation looks correct, but it's missing unit tests to verify the new behavior. Additionally, the new CloudRunWorkerPoolReady function in pkg/skaffold/event/v2/cloudrun.go introduces code duplication with the existing CloudRunServiceReady function. I've added comments with suggestions to address these points.

Comment on lines +425 to +427
func (r *runWorkerPoolResource) reportSuccess() {
eventV2.CloudRunWorkerPoolReady(r.path, r.latestRevision)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This change adds new behavior but lacks corresponding tests. The existing test suite, specifically TestPrintSummaryStatus in status_test.go, does not correctly test this code path for worker pools because it uses a runServiceResource mock instead of a runWorkerPoolResource.

Please add a unit test that:

  1. Uses a runWorkerPoolResource for the test case.
  2. Asserts that eventV2.CloudRunWorkerPoolReady is called with the correct parameters when reportSuccess is invoked.

Without tests, we can't be sure this feature works as expected or protect it from future regressions.

Comment on lines +36 to +43
func CloudRunWorkerPoolReady(r, revision string) {
handler.handleCloudRunReady(&proto.CloudRunReadyEvent{
Id: r,
TaskId: fmt.Sprintf("%s-%d", constants.Deploy, handler.iteration),
Resource: r,
ReadyRevision: revision,
})
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This function's implementation is very similar to CloudRunServiceReady, leading to code duplication. This can make maintenance harder. For example, if the TaskId format needs to be changed, it would have to be updated in multiple places.

To remove the duplication, you could reuse CloudRunServiceReady by passing an empty URL. This is a pragmatic way to solve the duplication within this PR. While calling a 'Service' function for a 'WorkerPool' is not ideal semantically, it avoids duplicating the event creation logic. A longer-term solution could be to introduce a more generic helper function.

func CloudRunWorkerPoolReady(r, revision string) {
	CloudRunServiceReady(r, "", revision)
}

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant