Repository navigation
feat(backend): expose daily recap job telemetry and outage alerts - #21090
Merged
Git-on-my-level merged 4 commits intoOct 9, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Oct 9, 2026
Git-on-my-level
added a commit
that referenced
this pull request
Oct 10, 2026
…21113) ## Failure-Class Failure-Class: none ## Summary Repair #21090's notifications-job deploy failure in GitHub run 37991914100: `deploy-cloudrun@v3` appends custom flags after image/env/secrets, so the late `--container` is rejected before an API call. Replace the branch's raw gcloud attempt with the existing action and its manifest-backed env/secrets. ## Change Choose option 2: detach the GMP collector before the action, deploy a singleton without `--container`, then attach the collector again. `--job --detach` skips absent jobs and existing singletons, rejects ambiguous container layouts, removes collector dependencies/lifecycle env and volumes, and preserves app bindings, task settings, VPC annotations, and service account. Auth/network failures are fatal. No runtime validator extension or action upgrade is needed. The invariant explanation below is retained verbatim from the supplied draft; the final implementation uses the action again with the same runtime bindings. Evidence: [v3 action source](https://github.com/google-github-actions/deploy-cloudrun/blob/v3/src/main.ts) lines 157-191 build the jobs command with image/env/secrets before lines 237-242 append flags. The installed Cloud SDK 578.0.0's `googlecloudsdk/api_lib/run/container_resource.py:87-100` selects the sole container, and explicitly raises for an unnamed multi-container Job update; `command_lib/run/config_changes.py:117-128` uses that selector for an image/env change without a container name. We rely on that singleton behavior after detach, never on an implicit choice from a multi-container job. The [gcloud reference](https://docs.cloud.google.com/sdk/gcloud/reference/run/jobs/deploy) confirms container flags must follow `--container` when present. The action release notes did not identify a verified ordering repair. Read-only IAM inspection confirmed the prod deployer holds `roles/run.developer`, whose permissions include `run.jobs.list`; the exact filtered existence query returned `notifications-job`. Regression tests cover absence, singleton no-op, attached detach, repeated attach/deploy cycles, binding/task/volume preservation, rejected layouts, and list/describe/replace failures. A workflow contract pins detach/action/attach ordering and the manifest-backed action inputs. This extends the existing sidecar primitive rather than adding another deployment/config parser. There is a brief metrics gap between detach and attach. If deploy or attach fails, a retry restores the same supported shape. Production deploy and merge are outside this PR-opening task; no live job was mutated here. ## Validation - From backend: `./.venv/bin/python -m pytest -q tests/unit/test_backend_runtime_env_validator.py tests/unit/test_attach_cloud_run_gmp_sidecar.py tests/unit/test_workflow_contracts.py tests/unit/test_notifications_job_orchestrator.py tests/unit/test_daily_summary_monitoring_contract.py` — 311 passed. - `actionlint .github/workflows/gcp_notifications_job.yml` — passed. - `python3 .github/scripts/check_ci_budget.py --refresh` — passed; no inventory changes. - `scripts/pr-preflight --pr-body-file /tmp/pr-body-recap-deploy-fix.md` — passed (37 selected checks). - `OMI_PR_BODY_FILE=/tmp/pr-body-recap-deploy-fix.md make preflight` — passed (37 selected checks). - Built-in preflight limitations: the historical failure-class audit skips on this shallow clone; its fixture suite reports one existing skip. The synthetic-merge check required sandbox escalation to create temporary objects in shared Git metadata. - `OMI_PR_BODY_FILE=/tmp/pr-body-recap-deploy-fix.md git push fork HEAD` — passed on retry; normal hook passed 37 preflight checks, 44 sidecar tests, 92 workflow tests, typecheck (0 errors), and contracts for 16 images. The first transport attempt exited with SIGPIPE (141) after its hook passed; the retry updated the fork branch successfully. ## Product invariants affected - INV-DATA-1 INV-DATA-1 (data-plane-continuity): this workflow continues to render the same notifications-job Firebase/Firestore runtime bindings and service-account identity. The deploy-cloudrun@v3 action inputs (env_vars, secrets, flags, image) are unchanged; the detach step preserves the main container's env, volumes, VPC, timeout, and service account via export/replace, and the attach step re-merges the sidecar afterward. No binding, secret, or SA changes. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/21113?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
Git-on-my-level
added a commit
that referenced
this pull request
Oct 10, 2026
## Failure-Class Failure-Class: none ## Summary Follow-up to #21090/#21113: run 38032652482's sidecar-attach step failed with `spec.template.spec.task_spec.containers[1].depends_on: Dependent container 'notifications-job-1' must have startup probe specified`. Cloud Run enforces a startup probe on any container named in `run.googleapis.com/container-dependencies`; jobs cannot carry a reachable probe for the app (no serving port; TCP probes cannot reach the loopback metrics listener). The deploy itself succeeded — only the attach failed — so the job currently serves the fix singleton without telemetry. ## Change Drop `run.googleapis.com/container-dependencies` in the job attach path (`patch_job`). Containers start in parallel; the collector's 30s scrape loop simply retries until the app binds 9090 (missed early scrapes are re-sampled — counters are cumulative), and `PROMETHEUS_SIDECAR_DONE_FILE` sequences the final drain at shutdown, not startup. Service path is untouched. Test updated to pin the annotation's absence. ## Validation - backend suites: 50 passed (sidecar attach, metrics listener, daily-summary monitoring contract) ## Product invariants affected - INV-DATA-1 INV-DATA-1 (data-plane-continuity): attach-only change; the job's runtime bindings, secrets, VPC, timeout and service account are untouched, and the application container spec is unchanged apart from the previously attached telemetry env/volumes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Daily recap outage and evidence
Production summaries repeatedly reported
complete=False,failed=1, and the samecohort_utc=2026-10-03T20:03:09.672497+00:00for six days (Oct 3–9). A persistently failing recipient caused each resume to renew the cursor TTL, delaying every current cohort. The recorded serving imagenotifications-job:f1adb1clacked the Oct 9 fix. Evidence: age-out fix #21020, original fix #21012, fix commit 071ff86cdc, and the content-free log signature documented inbackend/docs/runbooks/daily-summary-cutover.md. The precise token/provider failure mechanism remains unknown. These are incident observations, not a new live production probe.The age-out fix is already merged and remains unchanged. It abandons any cohort older than two hours, regardless of health; this is the registered failure-class tradeoff.
Changes
cursor_age_secondsandresumedto the existing summary log format. Count current-day generation separately from delivery failures; never label recipients or count backfill records as recipient generation.notifications-jobto both environments' actual dedicated Stackdriver exporter namespace filters, retainingone_of(...)andcluster=__run__. Keep the existing Prometheus scrape/name normalization and update its documentation.omi-core-features: recipients by outcome, cohort completion, resumed age with the 7200-second TTL line, and current age stat.Validation
PYTHON=.venv/bin/python bash test-preflight.sh: 17 passed, 9 optional warnings, 0 failed.actionlint .github/workflows/gcp_notifications_job.yml: passed.scripts/pr-preflight --pr-body-file /tmp/pr-body.md: 39 checks passed. FinalOMI_PR_BODY_FILE=/tmp/pr-body.md make preflighton the frozen commit: 39 checks passed. The recurrence ratchet reports its normal shallow-history skip; failure-class declaration validation passed./bin/shand/run-gmp-entrypointexist.POST-MERGE DEPLOY STEPS
gcp_notifications_job.ymlfrom mergedmainwithenvironment=prodandbranch=<reviewed merge SHA>. This ships the already-merged fix, new telemetry/sidecar, and both Cloud Monitoring policies. Verify the image SHA, job completion, summary logs, collector export errors, and configured notification channels. Observe at least one summary heartbeat to arm the absence policy.gcp_cloud_run_metrics_egress.ymlfrommainwithenvironment=prodto apply the expanded exporter allowlist. Dev metrics egress auto-deploys onmain; the existing notifications job workflow is dispatch-only (there is no notifications auto-dev workflow). To validate the dev job, dispatchgcp_notifications_job.ymlwithenvironment=development.omi_daily_summary_*series in Cloud Monitoring and Prometheus, then expand the Core Features daily-recap row.Grafana panels show No-data until both the notifications-job deploy and production metrics-egress dispatch complete. The log-based alerts can page after the notifications deployment alone. Repository checks do not prove end-to-end ingestion or paging; those require the post-merge deployments and verification above.
Failure-Class: FC-failed-resume-renews-its-own-staleness-ttl
Product invariants affected
INV-DATA-1 (customer data-plane continuity): this workflow continues to render the same notifications job Firebase/Firestore runtime bindings and service-account identity. The helper preserves the application's env, secrets, network and task settings; collector-only runtime
K_SERVICE=$CLOUD_RUN_JOBsets the GMP namespace. Job patch tests verify preserved settings and string-valued env round trips. This PR performs no account/data migration or historical-data writes.