Repository navigation
ci: release and CI reliability bundle (checkout stalls, mobile pin race, batch verify, local CPU cap, pusher probe) - #22936
Conversation
…ce, batch verify, local CPU cap, pusher probe) David named this workflow change on 2026-10-20 (two-lane lead session): CI/release reliability - Checkout stall bound everywhere: GIT_HTTP_LOW_SPEED_LIMIT/TIME at workflow level in the 66 workflows #22890 did not cover, plus a manifest-registered guard (workflow-checkout-stall-bounds) that fails when a workflow checks out, directly or through a local composite action, without them. - Codemagic source-pin race: the internal iOS/Android pin step now runs app/scripts/checkout_release_source_pin.sh, which checks out the evaluated SHA when main moved past it between dispatch and clone, and fails closed on an invalid pin, a pin the tip does not contain, or a failed fetch/checkout. - Batch worker deploy: Verify rollout is bounded at every layer (job 75 min, step 45 min, kubectl request timeouts, status report capped), its wait covers Recreate's 1500 s drain plus GPU startup (2400 s, chart progress deadline to match), and it asserts the deployment serves the built digest. The 10-20 run lost its runner; that still needs a job re-run, now documented in place. - Local pre-push CPU cap: test.sh's default fail limit 0.30 s -> 1.0 s, same as CI's runner (unchanged). Warn target stays 0.1 s. - Pusher dev probe: all six listen_closed_early failures on 10-19/20 landed 15-17 s after a dev listen helm upgrade under the other deploy lock. The probe now records the WebSocket close code, and the step retries once, only for listen_closed_early and only when the listen Deployment's generation changed during the attempt; the first receipt is kept as attempt1. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
…checkout step Only the document-level raw and semantic digests move; the desktop release and preview workflow digests are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-pin script Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Codemagic pin: build_provenance_dart_defines.sh compared HEAD with CM_COMMIT
(the cloned tip) and would have failed the pinned build one step later. The
pin script now records OMI_RELEASE_PIN_CLONED_TIP in $CM_ENV (fails closed
inside Codemagic if CM_ENV is unset), and provenance accepts HEAD != CM_COMMIT
only when HEAD is the pin, the recorded tip is CM_COMMIT, and the pin is its
ancestor.
- Pusher probe retry: an unreadable generation after the attempt ("unknown")
differed from the numeric before-read and allowed a retry. Both reads must
now be integers and differ.
- Checkout stall guard: match staged copies of checkout actions
(./.github/firestore-workflow/.github/actions/firestore-readiness) by suffix.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7da7b51f70
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return 1 | ||
| fi | ||
|
|
||
| git checkout --quiet --detach "$pin" |
There was a problem hiding this comment.
Record the cloned tip before checking out the pin
When main advances between dispatch and clone—the exact race this script handles—this detaches HEAD to OMI_RELEASE_SOURCE_SHA while Codemagic leaves CM_COMMIT set to the cloned branch tip. Both internal workflows later invoke app/scripts/build_provenance_dart_defines.sh, whose lines 42-44 require HEAD to equal CM_COMMIT, so the build still deterministically fails after the checkout succeeds. Persist the original tip through CM_ENV and teach the provenance check to accept the verified pin/ancestor relationship.
Useful? React with 👍 / 👎.
| if not isinstance(document, dict): | ||
| return [] | ||
| checks_out = any( | ||
| _is_checkout(uses) or (isinstance(uses, str) and uses.rstrip("/") in checkout_actions) |
There was a problem hiding this comment.
Recognize staged checkout-action paths
For the required staged Firestore action, workflows use ./.github/firestore-workflow/.github/actions/firestore-readiness, while checkout_action_refs() records only ./.github/actions/firestore-readiness; this exact-membership test therefore does not recognize the staged action as containing checkout. A caller whose only checkout is inside that staged composite can omit both bounds and still pass this new guard, so match the known action reference by normalized suffix as well.
AGENTS.md reference: .github/AGENTS.md:L33-L33
Useful? React with 👍 / 👎.
| stage="$(jq -r '.failure_stage // "unknown"' pusher-dev-semantic-probe.json 2>/dev/null || echo unknown)" | ||
| close_code="$(jq -r '.listen_close_code // "none"' pusher-dev-semantic-probe.json 2>/dev/null || echo none)" | ||
| generation_after="$(listen_generation)" | ||
| if [[ "$stage" != listen_closed_early || "$generation_before" == unknown || "$generation_after" == "$generation_before" ]]; then |
There was a problem hiding this comment.
Reject an unreadable post-probe generation
If the first generation read succeeds but the post-probe kubectl get fails, listen_generation returns unknown; because unknown differs from the numeric pre-probe value, this condition incorrectly treats the failed read as proof of a rollout and retries. A transient Kubernetes API failure can therefore mask an unrelated listen_closed_early result and produce misleading qualification evidence; require both generation values to be integers before comparing them.
Useful? React with 👍 / 👎.
| rollout_timeout=600s | ||
| if [[ "$SERVICE" == "batch-pipeline-worker" ]]; then | ||
| rollout_timeout=1800s | ||
| rollout_timeout=2400s |
There was a problem hiding this comment.
Cover the full Recreate rollout budget
When the old batch worker uses most of its 1500-second termination grace and the replacement takes more than 900 seconds to become ready, this 2400-second wait fails a rollout that is still within the chart's healthy envelope: backend/charts/batch-pipeline-worker/templates/deployment.yaml lines 106-109 allow up to 1200 seconds for the startup probe alone, before accounting for scheduling, image pull, or readiness. The chart's matching progressDeadlineSeconds: 2400 has the same under-budget problem, and the 45-minute step ceiling leaves no room for verification at the full 1500+1200-second bound, so all three limits need headroom above the derived Recreate budget.
AGENTS.md reference: .github/AGENTS.md:L26-L26
Useful? React with 👍 / 👎.
…Windows python-cli-ci "Windows ACL / Python 3.12" has been red on main since 2026-10-20 (run 39442884972), and it blocked this PR because the workflow edit selects the job. #22271 opened the segments file directly and relied on POSIX errors: Windows raises PermissionError for a directory (not IsADirectoryError) and FileNotFoundError for a path under a regular file (not ENOTDIR). Recognize both, with probes that cannot raise a second error, and cover them on every OS by simulating the Windows exceptions. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
…is branch The workflow-checkout-stall-bounds guard flagged it on the merge ref. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Grok review of 5067480: Win32 collapses `..` before lookup, so notes.txt\..\missing.json is a missing file, not a path under notes.txt. Normalize before scanning parents (except \\?\ and \\.\ paths). Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ace-package ImportError BasedHardware#22936 added a repo-root scripts/ namespace package; from scripts import export_openapi now raises plain ImportError (unknown location) which ModuleNotFoundError did not catch. Widens the direct-CLI fallback to ImportError. Unblocks every branch off tonight's main in the backend-route-policy-baseline pre-push check (loop: firestore-reads, WQ2 carrier PR).
David named this workflow change on 2026-10-20 (two-lane lead session): CI/release reliability
Summary
This PR fixes five CI and release reliability problems from 2026-10-20. It edits existing workflows and scripts only; it adds no new workflow files.
1. Checkout stall bound everywhere
GIT_HTTP_LOW_SPEED_LIMIT=1000/GIT_HTTP_LOW_SPEED_TIME=60on 6 workflows. The other 66 that useactions/checkoutcould still hang 7–10 minutes on a stalled fetch, until the TCP reset.env. The edit was mechanical: the keys go at the top of an existingenv:block, or a new block goes beforejobs:..github/scripts/check_workflow_checkout_stall_bounds.py, fails when a workflow checks out without them. It is registered in the manifest asworkflow-checkout-stall-bounds(local + ci lanes) and modeled onworkflow-apt-network-bounds.actions/checkoutis held to the same rule (deploy-backend-stack,firestore-readiness). Otherwise moving a checkout into an action would hide the missing bound.actionlinton all 66 edited workflows reports no new non-shellcheck findings. The apt guard and the manifest tests still pass.2. Codemagic source-pin race
dispatch_mobile_internal_builds.pydispatches a branch withOMI_RELEASE_SOURCE_SHA. Codemagic's "Verify dispatcher source pin" failed whenever main moved during the roughly one minute before clone. Both the iOS and Android internal builds died that way on 10-20.app/scripts/checkout_release_source_pin.sh.merge-base --is-ancestor, fetching or unshallowing if needed), it checks out the pin detached and re-verifies HEAD. The build then uses exactly the evaluated commit, andbuild_provenance_dart_defines.sh's HEAD==pin check still holds.ci/mobile-internal/<sha>tag needscontents: writein the dispatcher, adds a tag to the public repo per build, and could fire Codemagic'stag_pushworkflows.codemagic.yamlfrom the tip. Only the step definitions are newer; the source being built is the pin.3. Batch worker deploy false failure
BlobNotFound, and thealways()summary and notify steps stayed pending. So the runner died; it was not a hungkubectlor a timeout.rollout status --timeout=1800smust have returned by 17:02, and no job timeout was set (default 360 min).{{ .Release.Name }}=prod-omi-batch-pipeline-worker, matchingdeploy/$TARGET_RELEASE.rollout statuswas bounded.progressDeadlineSeconds: 1800) is shorter than Recreate's 1500 s old-pod drain plus GPU startup, so a healthy rollout could report failure.timeout-minutes: 75(healthy runs take ~14 min) and steptimeout-minutes: 45.rollout statuswaits 2400 s for batch-pipeline-worker, and the chart'sprogressDeadlineSecondsis raised to 2400 to match.@$EXPECTED_DIGEST.deploy_status_report.pyis capped withtimeout 120, and itskubectl getcalls carry--request-timeout=30s.prodenvironment gate, so I left it out.test_batch_pipeline_chart.pyrun the real step script with a stub kubectl. They cover the 2400 s/600 s budgets, digest match passes, digest mismatch fails, and the timeouts are present. 94 tests passed across the chart,deploy_status_reportand workflow-contract files.4. Local pre-push CPU cap
backend/test.shdefaultedBACKEND_FAST_UNIT_FAIL_SECONDSto 0.30 s, against CI's 1.0 s. On 10-20 it failed lane 1's sync push twice on tests that pass alone and pass in CI.backend/scripts/run-unit-ci.sh(unchanged). The 0.1 s warn target still reports anything over it. The README and allowlist header are updated.test_fast_unit_duration_guard.pyandtest_backend_unit_ci_runner.pypass. CI's limit is untouched.5. Pusher dev live probe
listen_closed_earlygcp_backend_pusher_auto_deploy.ymlon 10-19/20, including 5098bbc, ff9e323 and fbb197a. Each one came 15–17 s after ahelm upgrade dev-omi-backend-listen, started bygcp_backend_auto_dev.ymlorgcp_backend_listen_helm.yml, landed mid-probe.deploy-backend-stack-developmentlock, not the pusher lock.preStop: sleep 15, so the pod the port-forward is pinned to terminates mid-probe.Fix: a bounded retry with the reason logged. Sharing the backend-stack lock would make the probe and queued backend deploys cancel each other, because GitHub keeps only one pending run per group.
listen_close_code. Only the code is recorded, never the reason text.metadata.generation, and runs the attempt.listen_closed_earlyand the generation changed during the attempt. It then emits a::warningwith the stage, close code and generation change, and keeps the first receipt aspusher-dev-semantic-probe.attempt1.json(uploaded).Verified: 5 new tests run the real step script with stubbed kubectl, python3 and curl:
The probe tests assert close code 1006 in the receipt and the status line. All 26 tests in
test_pusher_deployment_control_workflow.pypass, including the bash-5 parse check.6. Main-red Windows CLI job (found while merging)
python-cli-ci"Windows ACL / Python 3.12" has been red on main since 2026-10-20 (run 39442884972). It failstest_conversation_from_segments_rejects_directoryand..._file_parent_is_not_a_directory. The job runs on this PR only becausepython-cli-ci.ymlgained the stall env.PermissionErrorrather thanIsADirectoryError, and a path under a regular file raisesFileNotFoundErrorrather thanENOTDIR.from_segmentsrecognizes both cases. Theis_dir/is_fileprobes are wrapped so they cannot raise a second error.Review (Grok, via agentctl)
The first pass returned REQUEST_CHANGES with three findings, all fixed in 96a3564:
build_provenance_dart_defines.sh, because HEAD !=CM_COMMIT(the cloned tip).OMI_RELEASE_PIN_CLONED_TIPto$CM_ENV, and fails closed ifCM_ENVis unset inside Codemagic.CM_COMMIT, and the pin is an ancestor of it.build_provenance_dart_defines_test.sh, plus theCM_ENVrecord in the dispatcher tests.unknown!= numeric). Both reads must now be integers and must differ; two test cases were added../.github/firestore-workflow/.github/actions/firestore-readiness). It now matches by suffix; a test was added.Lane / contract
Lane
ci-rel(P4), CI/release reliability; owner sign-offs for edits to other lanes' files: noneProduct invariants affected
GIT_HTTP_LOW_SPEED_*env lines were added to production-family deploy workflows (and the batch-worker Verify rollout bounds). No routing or data-plane behavior changes.Verification
backend/test.shwithtest_batch_pipeline_chart,test_deploy_status_reportandtest_workflow_contracts: 94 passed.test_pusher_deployment_control_workflow: 26 passed.test_pusher_semantic_probe,test_fast_unit_duration_guardandtest_backend_unit_ci_runner: passed..github/scripts: checkout-stall guard (9), apt guard,test_run_checks(one environment-only failure,test_new_marker_requires_tracking_issue, unrelated), and the new dispatcher pin tests (15 incl. existing).TestPendingCommits.test_a_non_ancestor_baseline_counts_as_pending, which already hangs in a local partial clone. It is unchanged by this PR; CI uses a full clone.Rollback
Revert this PR. Each item is independent, and no data or runtime state changes. The chart's
progressDeadlineSecondstakes effect only on the next batch-worker deploy.Failure-Class: none
🤖 Generated with Claude Code