Skip to content

fix(testing): let the Phase 0A storage fake take the kwargs the real Blob takes - #12188

Merged
kodjima33 merged 1 commit into
BasedHardware:mainfrom
abunet:fix/replay-harness-storage-fake-kwargs
Aug 25, 2026
Merged

fix(testing): let the Phase 0A storage fake take the kwargs the real Blob takes#12188
kodjima33 merged 1 commit into
BasedHardware:mainfrom
abunet:fix/replay-harness-storage-fake-kwargs

Conversation

@abunet

@abunet abunet commented Aug 25, 2026

Copy link
Copy Markdown

What changed and why

_LocalBlob in the Phase 0A replay harness accepts only the positional argument on
upload_from_filename, upload_from_string and download_to_filename. The real
google.cloud.storage.Blob it stands in for accepts more — content_type among them — so a caller
that passes one dies inside the harness with a bare TypeError, surfacing three layers away as an
HTTP 503 from the sync router with nothing pointing at the fake:

ERROR routers.sync: event=sync_dispatch outcome=staging_failed lane=fresh exception_type=TypeError
POST /v2/sync-local-files ... 503 Service Unavailable
{"code":"sync_dispatch_unavailable","detail":"Sync dispatch is temporarily unavailable; ..."}
FEASIBILITY OUTCOME: BLOCKED

The file's own comment (line 48) calls itself a "copy of sync_cloud_tasks_stack pattern, not
import"
. That original — backend/testing/sync_cloud_tasks_stack/storage.py, backing the
blocking gauntlet — already tolerates *_args, **_kwargs on all three methods. The copy dropped
it. This restores it, and nothing else: three signatures, no behaviour change.

Closes #12186.

Product invariants affected

none

How it was verified

The defect is latent on main today — upload_syncing_temporal_file calls the blob with no keyword —
so "revert the fix and watch a test go red" would prove nothing. Verified the other way, by adding a
caller that uses the real API (content_type='application/octet-stream') and running the harness:

worktree state npm run test:replay-harness-phase0a:emulator
main + that caller, fake unfixed FEASIBILITY OUTCOME: BLOCKED (base, mutant-unguarded, mutant-guarded)
main + that caller, fake fixed FEASIBILITY OUTCOME: GREEN/BOUNDED
this branch as it ships (caller reverted, fix only) FEASIBILITY OUTCOME: GREEN/BOUNDED

So the change is load-bearing for any caller that uses the documented API, and inert for main as it
stands. Ran against the real Firestore emulator and a real redis-server, the same way the CI job
does; the probe caller was reverted before committing and is not part of the diff.

python3 .github/scripts/run_checks.py --base upstream/main --head HEAD --lane ci passes.

Tests

No test change. The fake lives in backend/testing/replay_harness_phase0a/apps.py, which installs the
egress guard and rebinds google.auth at import time — importing it from a unit test would pollute
sys.modules, which tests/unit/test_sys_modules_hermeticity.py exists to prevent. The behavioural
coverage is the harness run itself, shown above. Happy to add a test if you would rather the fake were
extracted into an importable module, but that seemed like more surface than this fix warrants.

Failure class (fixes)

Failure-Class: none

Review in cubic

…Blob takes

`_LocalBlob` in the Phase 0A replay harness accepts only the positional argument on
`upload_from_filename`, `upload_from_string` and `download_to_filename`, while the real
`google.cloud.storage.Blob` accepts more — `content_type` among them. A caller that passes
one dies inside the harness with a bare `TypeError`, surfacing three layers away as an
HTTP 503 from the sync router with nothing pointing at the fake.

The file's own comment calls itself a "copy of sync_cloud_tasks_stack pattern", and that
original — backing the blocking gauntlet — already tolerates `*_args, **_kwargs` on all
three. This copy dropped it; this restores it. No behaviour change.

Verified by running the harness against a caller that passes `content_type`:
BLOCKED on all three scenarios before, GREEN/BOUNDED after. With the caller reverted, the
shipped diff leaves the harness GREEN/BOUNDED as it is on main today.

Failure-Class: none

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confidence 5/5 (backend/testing): fixes the storage test-fake's method signatures to accept the same kwargs the real GCS Blob takes, matching an established pattern. Trivial, scoped, CI green.

@kodjima33
kodjima33 merged commit 6430ee8 into BasedHardware:main Aug 25, 2026
34 checks passed
abunet added a commit to abunet/omi that referenced this pull request Aug 25, 2026
…nd it was ours to drop

`fix/replay-harness-storage-fake-kwargs` (BasedHardware#12188) and the speaker-sample word count (BasedHardware#12169)
were both merged upstream, so both files return to byte-identical with theirs — verified,
`git diff upstream/main` is empty for each. The single conflict was our own marked workaround
in replay_harness_phase0a/apps.py against their now-merged fix: took theirs, and the comment
that said "once that is merged this file goes back to being byte-identical to theirs, and this
comment with it" went with it.

ADR-0030 audit, now including the Dart surface — the gap the +12 merge left, where
`getTimeZone` came through unchanged while upstream updated its FCM sibling. The nine
`check_oss_*` guards are 0, and our port markers are intact (118 `_object_store()`,
261 `_store()`, 152 `_signed_url`, 58 `get_auth_provider`, 53 `_vector_store()`,
48 `get_document_store`).
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.

Replay harness Phase 0A: the storage fake rejects kwargs the real GCS Blob accepts

2 participants