Repository navigation
fix(ci): restore singleton notifications job before sidecar redeploy - #21113
Merged
Git-on-my-level merged 2 commits intoOct 10, 2026
Merged
Conversation
…ntainer gcloud syntax deploy-cloudrun@v3 places its own --update-env-vars/--set-secrets/--memory before user --flags; gcloud run jobs deploy rejects that order once --container is present. Drive the job deploy with an explicit gcloud step whose --container leads. No behavioral delta to the deployed job spec. Failure-Class: none
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Failure-Class
Failure-Class: none
Summary
Repair #21090's notifications-job deploy failure in GitHub run 37991914100:
deploy-cloudrun@v3appends custom flags after image/env/secrets, so thelate
--containeris rejected before an API call. Replace the branch's rawgcloud 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 --detachskipsabsent 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
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-100selects the solecontainer, and explicitly raises for an unnamed multi-container Job update;
command_lib/run/config_changes.py:117-128uses that selector for an image/envchange 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
confirms container flags must follow
--containerwhen present. The actionrelease notes did not identify a verified ordering repair. Read-only IAM inspection
confirmed the prod deployer holds
roles/run.developer, whose permissions includerun.jobs.list; the exact filtered existence query returnednotifications-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 (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.