chore: Add async contract-test service for FDv1 - #481
Merged
Conversation
jsonbailey
marked this pull request as draft
August 5, 2026 23:08
jsonbailey
force-pushed
the
jb/sdk-2867/async-client
branch
from
August 11, 2026 19:17
491115e to
bcd5bdd
Compare
Drop capabilities the FDv1-only async service cannot satisfy: the persistent-data-store-* entries (no async persistent feature store exists; the sync store cannot be awaited), fdv1-fallback (an FDv2 dataSystem feature that raises NotImplementedError), and the unrecognized 'async' entry. Remove the now-dead persistentDataStore handling and the _create_persistent_store helper, plus the unused _set_optional_time / _set_optional_value helpers and Callable import. Also close a partially-started client before returning 500 so it does not leak tasks or sessions, and align the migrator build-failure shape with the sync service (return 200 with the error string instead of raising).
jsonbailey
force-pushed
the
jb/sdk-2868/async-contract-tests
branch
from
August 12, 2026 18:13
7709980 to
9f0466a
Compare
jsonbailey
marked this pull request as ready for review
August 12, 2026 19:54
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 40b5a79. Configure here.
keelerm84
approved these changes
Aug 12, 2026
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.

Summary
Adds the async contract-test service so the SDK contract-test harness can exercise
AsyncLDClient. Covers FDv1 (streaming / polling / LDD), hooks, and migration handlers.What's included
contract-tests/async_service.py— async client entity + Flask routes for the contract-test harness (FDv1 config, evaluation, hooks, migrations).contract-tests/hook.py— hook test support shared by the service.Held back for a later PR (FDv2)
FDv2 support is deferred to PR 11. The
dataSystem(FDv2) branch inAsyncClientEntity.start()(which lazily importeddatasourcev2.async_polling/async_streaming) is not included here — it now raisesNotImplementedError("FDv2 (dataSystem) is not yet supported in the async contract-test service"). The FDv1 streaming / polling / LDD paths, hooks, and migration handlers are unchanged.Verification
async_service.pyandhook.pyimport cleanly (no reference to any held-backdatasourcev2.async_*module).pycodestyleandisort --check --atomicclean on both files (the repo'smypylint target runs onldclientonly, notcontract-tests).Note
Overview
Adds a parallel async contract-test harness so the shared SDK contract suite can drive
AsyncLDClientinstead of the sync client.async_service.pyexposes the same HTTP surface (status capabilities, create client, per-client commands, teardown) via aiohttp, backed byAsyncClientEntity.AsyncClientEntitymaps harness configuration toAsyncConfigfor FDv1 paths: streaming, polling, LDD, events, big segments, and evaluation hooks registered withadd_hook()beforestart().dataSystem(FDv2) is explicitly rejected withNotImplementedErroruntil a follow-up PR. Command handlers cover evaluation, all-flags state, events, contexts, big-segment status, migrations (AsyncMigratorBuilderwithasyncio.to_threadfor callback HTTP), and flag / flag-value change listeners.Supporting pieces:
AsyncBigSegmentStoreFixture(async HTTP callbacks to the harness),AsyncListenerRegistry(bridges sync tracker callbacks to async HTTP posts), andAsyncPostingHookinhook.py(async hook stages withasyncio.to_threadforrequests.post).The sync
client_entity.pymigration callback is updated fromResult.errortoResult.failto match theResultAPI used by migrators.Reviewed by Cursor Bugbot for commit 32ec504. Bugbot is set up for automated code reviews on this repo. Configure here.