Uh oh!
There was an error while loading. Please reload this page.
feat: Add async migration support - #470
Conversation
abe7dac to
c735e0eComparejsonbailey
commented
Jul 27, 2026
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c735e0e. Configure here.
c735e0e to
ec7746aCompare…ic base Drop _MigrationConfigBase and give MigrationConfig and AsyncMigrationConfig their own bodies. The shared base saved only a few trivial passthrough properties while adding generic indirection, and full duplication matches how Config/AsyncConfig are handled. MigrationConfig reverts to its pre-async standalone form.
Give MigratorBuilder and AsyncMigratorBuilder their own read_execution_order/ track_latency/track_errors methods instead of sharing a base for three trivial property setters. MigratorBuilder and types.py revert to their pre-async form.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Move track_migration_op into a finally so a write cancelled mid-operation still emits its migration op event. The CancelledError propagates and no WriteResult is returned, but the event now records which origins were written, so a partial write is reported rather than lost. Reads are left as-is: a cancelled read has no side effect and loses its consistency measurement, so a partial read event carries no useful signal.
Uh oh!
There was an error while loading. Please reload this page.
On an early cancel (before any origin write completes) OpTracker.build returned "no origins were invoked" and the client logged a spurious error. Guard the write finally with OpTracker.has_invocations so the event is only emitted when at least one origin ran. Drop the now-redundant finally comment.
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 ef02557. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
Replace the has_invocations guard with a warning logged when a migration write is cancelled before completion, and call track_migration_op unconditionally. A cancelled dual write is a torn write worth surfacing, and the warning is co-located with the client's build error on an early cancel. Revert the now-unused OpTracker.has_invocations accessor.
Uh oh!
There was an error while loading. Please reload this page.
🤖 I have created a release *beep* *boop* --- ## [9.17.0](9.16.1...9.17.0) (2026-08-28) ### Features * Add async big segment store manager and async Redis adapter ([#462](#462)) ([aa492d2](aa492d2)) * Add async DynamoDB persistent feature store ([#490](#490)) ([cb010df](cb010df)) * Add async event processor ([ec7c113](ec7c113)) * Add async event processor ([#472](#472)) ([ec7c113](ec7c113)) * Add async FDv1 polling data source and feature requester ([#475](#475)) ([cca37a8](cca37a8)) * Add async FDv1 streaming and data source status tracking ([#464](#464)) ([4bf7067](4bf7067)) * Add async FDv2 data sources ([#485](#485)) ([5da1515](5da1515)) * Add async FDv2 data system ([#486](#486)) ([6a70132](6a70132)) * Add async hook, plugin, and flag tracker ([#463](#463)) ([686a70a](686a70a)) * Add async migration support ([#470](#470)) ([577d51e](577d51e)) * Add async persistent feature store foundation and Redis adapter ([f9c76ee](f9c76ee)) * Add AsyncConfig for the async SDK client ([#471](#471)) ([0587a78](0587a78)) * Add AsyncLDClient with FDv1 data system and public API ([#480](#480)) ([fd041a5](fd041a5)) * Add Config.with_wrapper_information ([#501](#501)) ([8a98583](8a98583)) * Add environment ID support for hooks. ([#484](#484)) ([49e809f](49e809f)) * Add read-only store views and async persistence foundation for the data system ([#503](#503)) ([0eb61fa](0eb61fa)) ### Bug Fixes * Allow tombstones without a key property ([#502](#502)) ([5f44e61](5f44e61)) * Escape attribute names reported in redactedAttributes ([#505](#505)) ([90059cb](90059cb)) * Prevent a persistent-store outage from throwing in the sync FDv2 evaluation ([#506](#506)) ([467da53](467da53)) * Return empty prerequisites for a flag that fails to evaluate in all_flags_state ([#483](#483)) ([73e9b07](73e9b07)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > **Release Please** bumps the package from **9.16.1** to **9.17.0** in `pyproject.toml`, `ldclient/version.py`, `.release-please-manifest.json`, and the provenance example in `PROVENANCE.md`. > > `CHANGELOG.md` gains a new **9.17.0** (2026-08-28) section that records what ships in this minor release: a broad **async** surface (`AsyncLDClient`, `AsyncConfig`, async FDv1/FDv2 data systems, event processor, hooks/plugins, migration, and Redis/DynamoDB persistent stores plus big-segment async support), plus sync improvements (`Config.with_wrapper_information`, hook environment ID, read-only store views) and bug fixes (tombstones, `redactedAttributes` escaping, FDv2 persistent-store resilience, `all_flags_state` prerequisites). > > No application logic changes appear in this diff—only version metadata and release notes. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f225e46. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Adds the async migration surface for the async Python SDK —
AsyncMigrator,AsyncMigratorBuilder,AsyncMigrationConfig, and theAsyncMigratorFntype — inldclient/migrations/async_migrator.py, eagerly exported fromldclient/migrations/__init__.py(import-cheap: asyncio stdlib only, no aiohttp).Also carries the migration config/builder dedup shared by the sync and async surfaces:
types.pygains_MigrationConfigBase[_MigratorFnT](Generic) and_MigratorBuilderBase(fluent-setter mixin), andmigrator.py'sMigratorBuilderis re-based onto that mixin. These are behavior-preserving refactors of already-released sync code.The public async classes carry experimental
.. caution::blocks.Self-contained: depends only on already-merged foundation work. The
AsyncLDClient/Contextreferences areTYPE_CHECKING-only (annotations kept lazy viafrom __future__ import annotations); no runtime import of any not-yet-merged async module.No CHANGELOG or version changes (handled at release).
Tracked internally: SDK-2767
Note
Medium Risk
New experimental migration execution path affects dual-origin reads/writes and telemetry during flag-driven cutovers; behavior is well-tested but not production-stable per API warnings.
Overview
Adds an experimental async migration API for the async Python SDK, mirroring the sync migrator’s stage-driven read/write behavior with coroutine-based old/new handlers.
New surface in
async_migrator.py:AsyncMigrator/AsyncMigratorImpl,AsyncMigratorBuilder,AsyncMigrationConfig,AsyncMigratorFn, andAsyncExecutor. Reads honorExecutionOrder(parallel, serial, random) viaasyncio.gatherand optional consistency checks; writes run authoritative-first and skip the second origin on authoritative failure.migration_variationis awaited;track_migration_opstays synchronous. Write cancellation logs a warning, still emits migration telemetry infinally, and propagatesCancelledErrorwithout undoing a completed authoritative write.ldclient/migrations/__init__.pyre-exports the new types.test_async_migrator.pyadds broad pytest coverage (builder validation, payloads, tracking, consistency, execution order, cancellation) using aFakeAsyncClient.Reviewed by Cursor Bugbot for commit d35a24c. Bugbot is set up for automated code reviews on this repo. Configure here.