Skip to content

fix(ci): restore singleton notifications job before sidecar redeploy - #21113

Merged
Git-on-my-level merged 2 commits into
BasedHardware:mainfrom
Git-on-my-level:lane/recap-deploy-fix
Oct 10, 2026
Merged

Git-on-my-level merged 2 commits into
BasedHardware:mainfrom
Git-on-my-level:lane/recap-deploy-fix

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

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
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
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.

View guided diff

…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
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Git-on-my-level
Git-on-my-level merged commit 14fab5f into BasedHardware:main Oct 10, 2026
54 checks passed
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.
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.

1 participant