Repository navigation
fix(testing): load shared Stripe dependencies during setup - #25473
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
Git-on-my-level
pushed a commit
to Git-on-my-level/omi
that referenced
this pull request
Nov 16, 2026
Integrate merged BasedHardware#25473 via current main without manual conflict resolution or duplicate repair. Preserve exact finish-counter contract and bounded AST test correction. Co-authored-by: multica-agent <[email protected]>
This was referenced Nov 16, 2026
Git-on-my-level
added a commit
that referenced
this pull request
Nov 21, 2026
…scrape (#25145) ## What Export the two projection finish guard counters on the backend-integration GMP scrape and the in-cluster Prometheus bridge. `OmiBatchProjectionFinishReadsPerCompletion` is the only movable guard on the projection finish-backoff lever (`BATCH_PROJECTION_FINISH_BACKOFF_ENABLED`, #25122): threshold 1200, baseline ~579 reads per completion. Its ratio needs both `omi_batch_projection_finish_reads_total` and `omi_batch_projection_finish_completed_total`. The projection sweep runs on backend-sync and backend-integration. The existing Cloud Run GMP keep rule already admits both counters. The missing sync exporter prefixes prevented the in-cluster Prometheus bridge from importing them. - `backend/deploy/cloud_run_gmp_sync.yaml`: document that the existing `__name__` keep regex covers both counters. - `backend/charts/monitoring/prometheus-stackdriver-exporter/{prod,dev}_sync_omi_cloud_run_metrics_exporter.yaml`: import both families. The checked-in guard is a `PrometheusRule`; the in-cluster Prometheus imports backend-integration through this bridge. Production has no live alert route for this guard, so qualification must prove the ratio is computable rather than claim active alerting. - `backend/tests/unit/test_projection_finish_guard_metrics_are_scraped.py`: derives the names from the producer registrations and pins them against both filters, the alert expression, the metric inventory, and the test selector. - `backend/charts/monitoring/batch-projection/README.md`: documents the export requirement. Scrape/config only: no flag flips, no deploy, no runtime change. `BATCH_PROJECTION_FINISH_BACKOFF_ENABLED` is untouched. ## Verification - `backend/.venv/bin/python -m pytest tests/unit/test_projection_finish_guard_metrics_are_scraped.py tests/unit/test_monitoring_telemetry_contract.py tests/unit/test_timeliness_metrics_are_scraped.py tests/unit/test_monitoring_alert_backtest.py tests/unit/test_monitoring_alert_rule_contract.py tests/unit/test_attach_cloud_run_gmp_sidecar.py` — all pass locally. - Deploy-lane readback (cl2-deploy, not this PR) must show both counters present in the backend-integration scrape with non-null values and the alert baseline computable. ## Main integration validation Current head: `2a952b746a9b04f1b445b578523cf7f8e2141688`, integrated with main at `d9be505b41a79ca7d7e2d3ab0d4558f0f5bd4278`. - The merge kept main's HPA contract test refactor from `2c0451b5b5146ca4adf4d8b7cf30388dbe41c4c5` for the sole conflict. The other eight files preserve the reviewed additions and deletions. - All 124 targeted tests and the bounded repository pre-push gate passed on M1. The shallow checkout deferred the 90-day failure-class history check. - Guarded admission requires Luna's carry-forward check and passing required CI at this head. The rollout lead conditionally authorized the three monitoring Helm upgrades. Release owns the three rollback revisions, live diffs at merged main, and dispatch window clear of production Prometheus guards. SCA-1799 remains open pending serving and counter readback. ### Prior integration receipts Earlier integration commit: `6fab6d70c8e050e02d8b232508f2254fbfbc7408`, integrated with main at `ce9e045e2f2fc5c99944aa1ab98d20ed249a252e`. - **R28 release handoff.** The overnight manager's decision on SCA-1799 (comment `01a1fa1e-1489-76e9-9073-03da580d956d`, delegation `event:ev-838b55485a1d03458a8c`) closed the two review rounds and directed the refreshed head to Release. Luna's SHIP at `6d1d73d68fdda8a3f6a5e4e475a72f27f53d27be` is the review of record. SCA-3420 tracks the remaining test-maintenance findings. - **Verification at the refreshed head.** The repository pre-push gate and 124 targeted tests passed (8 projection finish, 59 HPA, 57 telemetry). Required GitHub CI passed, including the [backend unit suite](https://github.com/BasedHardware/omi/actions/runs/44790145809/job/136483452651) and [Mobile Release Eligibility](https://github.com/BasedHardware/omi/actions/runs/44790145076/job/136475913213). Release reported [no connector findings](#25145 (comment)) and a clear release hold reader for SCA-3425. - **Prior release gates.** Release owns guarded merge admission. The R28 production handoff covers the sync exporter. Production rollout remains gated on confirmation of the monitoring workflow's scope or a reviewed sync-only route. SCA-1799 remains open pending production serving and counter readback. Earlier integration commit: `6655885a68d94237420beb1af8e34c78e0584820`, based on clean main integration `58994ac2d5aa880272a8d1669b7b983cc93fbdd5`. It retains the merged #25473 Stripe initialization repair and the finish-counter contract / exact AST selection. Owner disposition `01a1e538-98fb-7846-a271-76f374358b8b` authorizes the isolated HPA test correction: each owned source now has an independent selection assertion; a module-scoped fixture supplies the complete real discovered inventory. No production selector/runner, marker, guard, allowlist, assertion or Helm contract was changed. - **M1 equivalence proof passed:** baseline enumeration and owned assignments are AST-identical; the same ordered, multiplicity-preserving 21 owned paths come from the full 27-source enumeration. Actual parameter collection matches. The module-scoped fixture invokes real discovery once and returns its exact full object, equal to independent discovery: 2,923 paths. Other contract functions and the selection assertion are AST-identical. - **M1 validation at `c710ead1d1924917d4870cc71068753eed56364c`: exit 0; 470 passed across nine files, zero failures/skips or CPU-guard warnings/failures.** Python 3.11.15, Helm v4.2.3; full HPA file 59 passed, including all 21 independent selector cases and every Helm render. The prior eight-file affected set also passes with file isolation and unchanged 1.00s CPU limit. - Command: `BACKEND_UNIT_TEST_FILE_LIST="$PWD/selected-tests-c710ead1.txt" omi-workspace/bin/omi-heavy run --timeout 600 -- bash omi/backend/test.sh`. - [Full guarded worker log](https://multica-01.tail76ea03.ts.net/api/attachments/01a1e53c-185e-7b51-830e-98173b672138/download) and [source/inventory proof](https://multica-01.tail76ea03.ts.net/api/attachments/01a1e53c-1856-729a-b5b2-bc2329750edb/download), issue receipt `01a1e53c-1867-7d41-b9d6-768178a495be`. - Diff hygiene and lightweight AST equivalence checks passed on control; no backend suites/builds/type checkers ran there. - Completed [backend CI at `c710ead1`](https://github.com/BasedHardware/omi/actions/runs/43909722101): shard 2/8 passes; shard 5/8 and aggregate fail on unrelated `tests/unit/test_mcp_conversation_detail_paging.py::test_walk_1200_segments_once_with_one_existing_read_per_page` (1.12s CPU > unchanged 1.00s limit). Stopped at this different blocker; no paging-test repair or blind rerun. - Repo Checks also rejected formatting in the HPA helper. `6655885a` applies the repository's pinned formatter only (complete Python AST identical to worker-tested `c710ead1`); formatter check and diff hygiene pass. No worker rerun is claimed for this formatting-only head. Its [backend CI run](https://github.com/BasedHardware/omi/actions/runs/43912099995) was pending when that receipt was recorded. - **Prior release disposition.** At that head, the owner/22:00Z qualification hold was still in place. Exact-head CI, Release qualification and the original cl2-deploy production scrape readback were still required. - That validation round stopped before merge and deploy. Its test-correction inverse was to revert the isolated HPA change. $0 booked. ## Rollback Revert the PR. Allowlist-only change; no runtime behavior. Failure-Class: FC-metric-dropped-by-scrape-allowlist Tracks SCA-1799. Closure requires production readback. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/25145?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. -->
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.
Backend unit shard5 failed its 1.00-second call-phase CPU guard on the first resource-missing cancellation case (1.35seconds), although its assertions passed. That case imports the real Stripe helper inside its measured call. A cold local call profile attributes 1.377 of 1.389 cumulative seconds to that import and its dependencies; profiling overhead means these are diagnostic timings, not a hosted performance reproduction.
Load the same real helper once in a module-scoped pytest fixture. This follows the guard's documented separation of shared dependency setup from per-call work. All five cancellation outcomes, real cancellation logic, mocked Stripe boundaries and assertions remain intact; no CPU threshold, allowlist, guard, production code or workflow changes.
Validation: all37selected localpreflightchecks passed. IndependentDeepSeek reviewSHIP on13bf43af2d96b30c4e458a4fd93136b167fe0574, including an independent guard-active103-case run. The full isolated account-deletion service test file passed103cases with the existing guard active and no CPU warning/failure. The first cancellation case now visibly incurs4.25seconds of setup in that local run; the setup cost is retained and reported, not removed. Cloud/provider credentials were excluded and the backend hermetic network guard remained active. Hosted Linux CI remains pending.
This source repair does not authorize PR25051 merge, its sweep, or any deployment.
Product invariants affected
none
Failure class (fixes)
Failure-Class: new
New class: FC-test-cold-import-in-call-budget