feat: Add async migrations - #470
Open
jsonbailey wants to merge 3 commits into
Open
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
…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.
jsonbailey
marked this pull request as ready for review
July 30, 2026 21:59
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 dual-read/write migration paths can affect customer data routing when adopted; sync builder refactor is low-risk but touches released migration APIs.
Overview
Adds an experimental async migration API (
AsyncMigrator,AsyncMigratorBuilder,AsyncMigrationConfig,AsyncMigratorFn) that mirrors the sync migrator: flag-driven stages, old/new coroutine hooks, dual-read consistency checks, andtrack_migration_optelemetry. Reads can run in parallel viaasyncio.gather(vs threads on sync).Sync refactor: fluent builder options (
read_execution_order,track_latency,track_errors) move to_MigratorBuilderBaseintypes.py;MigratorBuildersubclasses it with unchanged behavior. New symbols are eagerly exported fromldclient.migrations(stdlib-only import path).Broad
test_async_migrator.pycoverage aligns with existing sync migrator tests (stages, tracking, execution order).Reviewed by Cursor Bugbot for commit 9de05e2. Bugbot is set up for automated code reviews on this repo. Configure here.