{{ message }}
chore: Extract shared sans-I/O cores from sync data paths#450
Open
jsonbailey wants to merge 1 commit into
Open
chore: Extract shared sans-I/O cores from sync data paths#450jsonbailey wants to merge 1 commit into
jsonbailey wants to merge 1 commit into
Conversation
8906a2a to
6cc7d23
Compare
6cc7d23 to
a3d1f1b
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.

What
Extracts the shared, I/O-free ("sans-I/O") logic out of three sync data paths into dedicated
_coremodules that both the existing sync code and the future async siblings build on:ldclient/impl/client_core.py— environment-metadata construction, plugin-hook collection, and the secure-mode HMAC helper, lifted out ofLDClient.ldclient/impl/datasystem/fdv2_core.py— the FDv2 status providers (DataSourceStatusProviderImpl,DataStoreStatusProviderImpl), the persistent-store wrapper (FeatureStoreClientWrapper), and theConditionDirectiveenum.ldclient/impl/events/event_processor_core.py— the shared event wrapper/output types (DebugEvent,IndexEvent,EventOutputFormatter,EventBuffer,FlushPayload).The sync modules (
client.py,impl/events/event_processor.py,impl/datasystem/fdv2.py) now import and route through these cores.fdv2.pyre-exports the moved names (via__all__) so existing import paths such asfrom ldclient.impl.datasystem.fdv2 import FeatureStoreClientWrappercontinue to resolve unchanged.CONTRIBUTING.mdgains a short sync/async parity note describing the_coreconvention.Why
Part of the async Python SDK epic (SDK-60). Pulling this shared logic into
_coremodules lets the sync and async client implementations share identical, I/O-free behavior instead of duplicating it. This PR contains only the extraction and the sync routing; the async siblings and async packaging land in separate slices.Parity
This is a pure refactor — sync behavior must remain byte-for-byte identical to
main. The extracted functions/classes are moved verbatim (the only mechanical change isself._configbecoming an explicitconfigparameter inclient_core). This warrants a careful sync-behavior review to confirm no behavioral drift slipped in.Validation
uv run pytest ldclient/testing— 1012 passed, 197 skipped (DB/YAML skips only)uv run mypy ldclient— Success: no issues found in 165 source filesuv run isort --check ldclient— cleanRefs SDK-2602 (epic SDK-60).
Note
Medium Risk
Large mechanical moves across client startup, FDv2 persistence monitoring, and event formatting; behavior is intended to be identical but warrants careful sync regression review.
Overview
Pulls shared, I/O-free logic into three
_coremodules so sync and future async clients can reuse the same code, and wires the existing sync paths through them.client_core.pyholds environment metadata, plugin hook collection, andsecure_mode_hash;LDClientnow calls these instead of private methods.fdv2_core.pyholds FDv2 status providers,FeatureStoreClientWrapper, andConditionDirective;fdv2.pyimports them and re-exports via__all__so existing import paths stay valid.event_processor_core.pyholdsEventBuffer,EventOutputFormatter, and related event wrapper types; the sync event processor imports from there.CONTRIBUTING.mddocuments the sync/async_coreconvention and parity expectations.Reviewed by Cursor Bugbot for commit a3d1f1b. Bugbot is set up for automated code reviews on this repo. Configure here.