Repository navigation
SCA-1619: preserve held Android hides and page on missing token - #25131
Conversation
Failure-Class: FC-app-review-visibility-diverges-from-held-store-state
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d1d34663a
ℹ️ 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".
| result = subprocess.run( | ||
| [ | ||
| "gcloud", | ||
| "scheduler", | ||
| "jobs", |
There was a problem hiding this comment.
Authenticate the scheduler check in the Codemagic brake lane
On a fresh Codemagic runner, this new mandatory check has no authenticated Google Cloud CLI identity. The android-rollout-brake workflow in codemagic.yaml:2958–2977 only loads the Play credential group and invokes Python; it never activates credentials for gcloud. The existing promote.play_edit() consumes GCLOUD_SERVICE_ACCOUNT_CREDENTIALS directly through the Python SDK, which does not authenticate this subprocess. Google's CLI documentation requires importing credentials and activating them “for use in gcloud.” Consequently, even after operators pause all writers, both status reads and brake operations stop before opening a Play edit. Provision an authenticated scheduler-read identity in this lane, or perform the check through an explicitly authenticated API client.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Resolved on the current head: the scheduler check uses the existing service-account JSON through authenticated google.auth AuthorizedSession, not an unauthenticated gcloud subprocess.
# Conflicts: # backend/charts/monitoring/alerts/app-review-config.json # backend/docs/runbooks/app-review-config.md # backend/tests/unit/test_app_review_config_lifecycle.py
…9-app-review-followups
…9-app-review-followups
…9-app-review-followups # Conflicts: # backend/docs/runbooks/app-review-config.md
…9-app-review-followups
…9-app-review-followups
…9-app-review-followups
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df54e390bc
ℹ️ 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".
|
|
||
| credentials = service_account.Credentials.from_service_account_info( | ||
| json.loads(credentials_raw), | ||
| scopes=["https://www.googleapis.com/auth/cloud-platform.read-only"], |
There was a problem hiding this comment.
Request a supported OAuth scope for the scheduler check
Even with valid Codemagic credentials and cloudscheduler.jobs.get permission, this check requests an unsupported OAuth scope. The new AuthorizedSession fixes the previous unauthenticated-CLI path, but Google's jobs.get documentation requires either cloud-platform or cloud-scheduler, not cloud-platform.read-only. Consequently, the scheduler read is rejected and every brake action, including status, fails before opening a Play edit. Request a supported scope and enforce read-only access through the identity's IAM permissions.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Resolved by using the documented cloud-scheduler OAuth scope (one of only two accepted by jobs.get); IAM still enforces read-only access. This exact scope now has request and negative-response regression coverage on the publication candidate.
|
/approve-ui a962a4f |
…9-app-review-followups
…9-app-review-followups
Git-on-my-level
left a comment
There was a problem hiding this comment.
Head e849962 adds same-marketing-version build rollover coverage, a full lease for a new build code, preservation of pending hides when an older build completes, supported scheduler auth scope, and cleanup of uncommitted Play edits after failed reads/validation/commits. Focused verification: 251 selected backend tests, 37 promotion tests, 105 daily-train tests, release-process guards, and diff whitespace checks all pass locally. No live production, store, or scheduler writes were used. Parent #25123 still needs to merge before this child; GitHub required checks and fresh-head approval remain merge gates.
…9-app-review-followups
|
/approve-ui 24ef80c |
## What changed and why Adds a bounded review-visibility lifecycle: successful store submissions are reported by Codemagic, then an internal sweep reconciles App Store Connect and Google Play state and expires temporary hides after 14 days. The app-review read path and its parity behavior remain unchanged. ## Current-main repair (2026-11-14) - Integrated current `main` at `3980a409cb9b` with a normal merge. The GMP inventory now contains 326 consumers, preserving main’s batch-census and newer metric consumers alongside both app-review consumers. - Resolve Firestore through `get_firestore_client()` at each lifecycle access. Store read failures still run TTL cleanup and emit bounded `omi_fallback_total` telemetry for the `ttl_only` path. - Declared and explicitly kept all four app-review metrics in the backend-sync scrape while retaining main’s free-allowance metric family; both critical app-review alerts use the unmuted human Telegram paging tier. The sweep-silent rule remains paused until its first successful tick. - Added semantic-versus-build regressions: a semantic-only hide applies across builds, while clearing one build-qualified hide preserves another build. - After the current-main conflict resolution, the app-review lifecycle/boundary/storefront, monitoring/GMP, scrape, batch-census, and scheduler-reconcile suites passed: 444 passed, 2 skipped. Alert backtest lint passed with 3 pre-existing legacy-debt notices and no failures. The child rollout-brake suite passed 30 tests after parent integration. No store account, live scheduler, or production Firestore access was used. ## Product invariants affected - INV-DATA-1 Line-Count-Exception: backend/utils/metrics.py | 1765 -> 1816 | add pre-zeroed app-review lifecycle alert and sweep metrics. ## How it was verified - Focused lifecycle, monitoring/export, closed-reason, scheduler, and route-policy tests: 259 passed. - `python3 app/scripts/mobile_store_promote_test.py`: 32 passed. - `python3 .github/scripts/check-release-process-guards.py`: passed. - `PYTHON=./.venv/bin/python bash test-preflight.sh` from `backend/`: 17 passed, 9 optional environment warnings, 0 failed. - Pyright on changed backend modules: 0 errors, 33 dynamic SDK/response typing warnings. - After adding submission-token reasons to the paging rule, regenerated the canonical combined alert export and GMP inventory. The focused app-review, monitoring-GMP, and monitoring-provisioner suites pass: 116 passed. - On parent head `0f7b038d4c5b`, hosted shards exposed the stale inventory and split/combined alert mismatch; both artifacts are regenerated on this follow-up. Two separate timing-guard files were rerun with the prescribed `backend/test.sh` runner through `omi-heavy`: 50 passed, with CPU-time warnings below the 1.0-second failure limit. The refreshed head still needs GitHub checks. - The full local `backend/test.sh` run reported timing/load failures in `test_live_recovery_matrix.py`, `test_qualify_parakeet_route.py`, and `test_backend_test_runner.py`. Each file passed its prescribed isolated rerun (103 passed/3 deselected, 34 passed, and 16 passed respectively); no reproducible failure remained. - No store accounts, production APIs, Firestore writes, deployments, credentials, or scheduler activation were used during validation. ## Tests Coverage includes held/draft Play releases remaining hidden until a completed rollout, clearing legacy iOS hides when ASC is live or terminal, adoption and expiry of pre-existing hides, build-qualified iOS version matching, tombstone persistence, bounded and rate-limited submission receipts, Codemagic hook failure handling and staging override, Play edit-conflict retry, workflow environment-group scope, and alert paging policy. ## UI evidence UI-Evidence: none -- backend and release automation only. ## Failure class Failure-Class: FC-metric-dropped-by-scrape-allowlist ## Operational notes and deviations - The hourly worker combines store reconciliation and TTL cleanup. Its scheduler declaration remains `planned` and `PAUSED`; it runs at minute 17 to avoid the rollout-watch and daily-train Play edit windows, and retries one edit-creation conflict. - Activation is gated on parent #25123 landing before child #25131, then the child’s final repaired code being merged and deployed. Verify held/draft Android writes, expired-receipt renewal, missing-receipt reconciliation, token-error paging, and brake scheduler quiescence from child regressions and deployment receipts. Parent-only checks do not satisfy these gates; merge alone is not activation permission. - Only a Play production release with `status == "completed"` counts as live. Draft, in-progress, and held releases remain hidden. The 14-day lease is the staged-rollout backstop. When a lease expires, the hide stays off for that version until a new submission is recorded; its tombstone prevents reconciliation from re-hiding it. - The iOS reconciler adopts existing matching hides and clears them on live or terminal ASC state, including build-qualified entries such as `1.0.547+20` when ASC reports `1.0.547`. The current poller does not query the separate `macos` document; its existing `1.0.80+501` entry remains a manual cleanup decision after checking store state. Unmatched legacy iOS entries also require a separate manual decision. - Before merge, create the Codemagic `app_review_config` environment group empty. It is referenced only by `mobile-store-promote` and `mobile-daily-train`; Codemagic rejects missing groups. The hook is best-effort after a successful store submission. Do not add the token until the scheduler is enabled and one successful sweep tick is confirmed. - The path-based invariant checker also selects `INV-AUTH-1` and `INV-BETA-1` because `codemagic.yaml` changed. Those desktop auth and beta contracts are untouched; only the two mobile workflow group bindings changed here, so the affected-invariant list above intentionally cites `INV-DATA-1` alone. - After the stacked merge and under separate authorization, provision only the documented scoped store credentials and Secret Manager bindings to `backend-runtime`. The submission and sweep routes run on `backend-sync`; do not grant `backend-listen` access for them. Probe the narrowest ASC read role and verify on a staging app that the Play role can create/read/delete an uncommitted edit before production activation; a view-only Play role has not been verified to allow this. - The submission endpoint caches the token in-process for 60 seconds, compares UTF-8 bytes in constant time, returns the same 401 for missing or incorrect tokens, and limits requests to 10 per IP per minute. Receipts must be no more than 15 minutes old (five minutes future skew); repeated receipts do not extend an active lease. Rotate the Secret Manager value and Codemagic group together, wait 60 seconds or restart all instances, verify in staging, then revoke the old value. - The real paging rule covers unavailable store credentials, store API errors, unavailable submission tokens, and rejected submission tokens; routine repairs and live clears are success paths. Missing store credentials still allow TTL cleanup. The silent-sweep alert stays paused until its first successful tick. - The Play reader opens a temporary edit, reads only `production`, and deletes it without committing. Internal and alpha tracks are not queried. - No credential creation, production write, deployment, or scheduler activation is part of this PR. Merge alone cannot activate the paused scheduler.
The Hygiene job runs mobile_store_promote_test.py on system Python without google-auth, so patching google.oauth2.service_account failed to resolve the target. Inject stub modules through sys.modules instead. Failure-Class: new Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ps' into lane/sca-1619-app-review-followups # Conflicts: # app/scripts/mobile_store_promote_test.py
…es (#25372) Two slow-suite guards are red on main since #25340 and #25368 merged. This repairs both with test and inventory changes only; no production code changes. Failure-Class: none ## What was wrong - `test_llm_gateway_coverage_guardrails.py::test_direct_provider_usage_stays_inside_approved_boundaries` reports `DirectUse(utils/llm/summary_embeddings.py, AsyncOpenAI)`: the file added by #25340 was not in the direct-provider inventory. - `test_real_clock_budget_ratchet.py::test_no_new_tiny_real_clock_budgets` rejects two tests that set `COMPOSER_CONTEXT_TIMEOUT_SECONDS` to 0.1 s (#25340) and 0.04 s (#25368), real-clock budgets under the 0.5 s limit. Both guards are marked slow and are selected by path, so the two pull requests' own CI did not run them; other pull requests (#25314, #25131) inherited the failures. ## The repair - Inventory: `utils/llm/summary_embeddings.py` is registered with its policy stated beside the entry. It is the composer's single bounded embedding request for owner-memory retrieval. It enforces the generated-compute budget and resolves the BYOK key before any IO, and routes through the LLM gateway whenever gateway feature mode is on, which is the production setting on backend, backend-sync and backend-sync-backfill (`OMI_LLM_GATEWAY_FEATURE_MODE=gateway`, read from the serving specs). The direct client is the non-gateway branch only: same provider, key custody and model as `clients.py` `OpenAIEmbeddings`, with SDK retries off and the caller's absolute deadline. It lives outside `clients.py` so the notes routing digest and paid checkpoints stay unchanged. Both branches are exercised with the real SDK in `test_episode_summary_provider_bounds.py`. No gateway, BYOK or quota path is bypassed. - Tests: both context-budget tests now inject the clock and the completion event of `composer_context_budget`, so the caller's whole budget elapses deterministically while the provider call is still running. They still assert the properties the originals covered: the caller returns at the deadline and not when the non-cooperative provider finishes, partial context is discarded, completed sections survive, late results are never published, and the timeout fallback is recorded once. The ratchet and its allowlist are unchanged. ## Verification Both guards, the ratchet's stale-entry checks, the provider-bounds tests and the two edited test files: 89 passed locally with slow tests selected (`-m "slow or not slow"`). No tuning value, flag, state or schema changes. Rollback: revert this commit; main returns to the two red guards. Author: Claude Fable 5.2. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/25372?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. -->
UI-Evidence: none -- backend lifecycle, monitoring, release operator docs; no UI changed.
Summary
draft; the sweep only clears a hide after a genuinely completed rollout. Fresh receipts renew an expired lease, and first-sight reconciliation repairs missing receipts without reviving expired tombstones.R1 decision
Use the write-side fix. When
changesNotSentForReviewis enabled, an omitted Android release status defaults todraft; otherwise it remainscompleted. A held draft cannot be mistaken for a live rollout by the sweep, while a genuinely completed rollout remains the approval signal. This avoids exposing a staged fraction before review.Audit coverage
Credentialsimport, TTL-only cleanup on store failure, and semantic/build-aware hide matching. Credential, store, and submission-token failures page through the wired alert path.google_playservice-account credentials and the API-supportedcloud-schedulerOAuth scope, with read-only access enforced by IAM. Missing or deniedcloudscheduler.jobs.getaccess fails before a Play edit.fail_openin the route manifest. Added the sweep counter andoutcomelabel to the metric contract.combined_equals_split: trueand retains all 326 query consumers.Branch and merge order
Parent PR #25123 merged to
mainatbc7e79190a84(2026-11-15 06:40Z). This PR targetsmain, currently based on18a774e84662; child head05e5df7b4c79includes a normal merge of that current base. The child retains its lifecycle and operational changes, including thed1c77ea6hermetic Play SDK test fix. The priororigin/lane/sca-1606event failed before tests because the parent branch had been deleted; that stale-base event is resolved by the currentmainintegration. The alternative branchlane/sca-1619-studioremains untouched.Product invariants affected
INV-AUTH-1,INV-DATA-1, andINV-BETA-1are inherited from stacked PR SCA-1606 Reconcile temporary app review visibility #25123. This follow-up does not change session ownership, production-family data-plane authority, or beta identity.Verification
8e767d02812d169e90e1ab75a5e2c07a5ba2f2c5; the targeted lifecycle/alert/GMP suite passed 116 tests. The previously timing-sensitive shard-6 scope passed a 50-test local rerun.backend/.venv/bin/python app/scripts/mobile_store_promote_test.pypassed 37 tests,backend/.venv/bin/python app/scripts/mobile_daily_train_test.pypassed 105 tests, andbackend/.venv/bin/python .github/scripts/check-release-process-guards.pypassed.git diff --checkpassed.backend-syncunderbackend-runtime; this stack does not requestbackend-listenaccess.Failure-Class: new
Line-Count-Exception: backend/utils/metrics.py | 1765 -> 1817 | the integrated stack carries the app-review lifecycle metrics and their reason labels without splitting the existing metric module