Repository navigation
feat(caretaker): add triage Cloud Run job workflow - #28468
Conversation
Summary of ChangesHello, 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 adds a new Google Cloud Workflow to orchestrate the caretaker issue triage process. It automates the execution of a Cloud Run Job, incorporates robust retry logic for transient failures, and ensures system reliability by routing unrecoverable errors to a dedicated Dead Letter Queue for later inspection. Highlights
Using Gemini Code AssistThe 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
Customization To customize the 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. 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. Footnotes
|
|
📊 PR Size: size/M
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new Google Cloud Workflow (triage-worker-workflow.yaml) to trigger a Cloud Run Job and publish failures to a Pub/Sub DLQ. The review feedback correctly identifies a critical issue: calling the Cloud Run Job run API is asynchronous, meaning the workflow will immediately report success without waiting for the job to complete or catching failures. The feedback provides a detailed solution to poll the job execution status until completion.
|
Wait to review until DLQ vs Dashboard is discussed. |
e8606bb to
cc2e65d
Compare
cc2e65d to
ae8a71a
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a Google Cloud Workflow to execute the triage-worker Cloud Run Job, updating Firestore and publishing to a Pub/Sub DLQ on failure, alongside Python database updates to clear lock fields when an issue needs human intervention. Key feedback points out that the Cloud Run Job API call is asynchronous, requiring a polling loop to correctly detect job completion and failures, and suggests updating the updated_at timestamp during the workflow's Firestore patch step to maintain consistency with the database store.
|
ready for review! @adamfweidman @gundermanc |
Summary
Adds the Google Cloud Workflow definition (
triage-worker-workflow.yaml) for orchestrating the caretaker issue triage pipeline.This workflow is invoked by the Ingestion Layer upon receiving Pub/Sub events, executes the
triage-workerCloud Run Job with issue payload details, and applies retry logic. Upon job failure, it updates the issue's Firestore document toNEEDS_HUMANwith error metadata, clears the processing lock, and forwards the failed message to a Pub/Sub Dead Letter Queue (DLQ) topic (incoming-issues-dlq).Details
init): Extracts GCP project metadata, workflow execution ID, base64 payload, and constructs the target DLQ topic path.run_processing_job): Usesgoogleapis.run.v1.namespaces.jobs.runto trigger thetriage-workerCloud Run Job inus-west1, passing environment overrides (ISSUE_DETAILSandWORKFLOW_EXECUTION_ID).retry): Implements exponential backoff (initial_delay: 5,max_retries: 1) using a custom predicate for transient job failure recovery.except): Intercepts unhandled terminal errors, updates the target Firestore issue status toNEEDS_HUMAN(clearing processing lock fieldslock.holderandlock.expires_at), publishes to Pub/Sub DLQ (incoming-issues-dlq), and raises a terminal exception.success_log): Returns structured execution details and a direct Cloud Console log URL upon successful completion.IAM & Permissions
triage-orchestrator-sa) now requires the Datastore User (roles/datastore.user) role to grantgoogleapis.firestore.v1.projects.databases.documents.patchpermissions.How to Validate
This is deployed via the Cloud Console UI or using this command: