feat: Add async migrations - #470
Draft
jsonbailey wants to merge 1 commit into
Draft
Conversation
jsonbailey
force-pushed
the
jb/sdk-2767/async-migrations
branch
from
July 27, 2026 22:01
abe7dac to
c735e0e
Compare
Contributor
Author
|
@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.
jsonbailey
force-pushed
the
jb/sdk-2767/async-migrations
branch
from
July 29, 2026 19:31
c735e0e to
ec7746a
Compare
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.
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 API affects migration read/write orchestration and dual-write behavior; sync builder refactor is intended behavior-preserving but touches released migration configuration code.
Overview
Adds an experimental async migration API (
AsyncMigrator,AsyncMigratorBuilder,AsyncMigrationConfig,AsyncMigratorFn) that mirrors the sync migrator: flag-backed stage selection viaawait migration_variation, coroutine-based old/new read/write handlers, dual-origin reads withasyncio.gatherfor parallel execution, and synchronoustrack_migration_opafter each operation. Public types are exported fromldclient.migrationswith a cheap import path (stdlibasyncioonly).Refactors shared sync/async plumbing in
types.pyvia_MigrationConfigBaseand_MigratorBuilderBase;MigratorBuildernow inherits the mixin (fluentread_execution_order/track_latency/track_errorsunchanged, attribute names normalized to_read_execution_orderetc.).Adds broad
test_async_migrator.pycoverage aligned with sync migrator tests (stages, tracking, consistency, exceptions, execution order).Reviewed by Cursor Bugbot for commit c735e0e. Bugbot is set up for automated code reviews on this repo. Configure here.