feat: add local clients for destination module#34
Merged
NicoleMGomes merged 7 commits intomainfrom Apr 8, 2026
Merged
Conversation
f958422 to
fcaa14a
Compare
911a503 to
108a8fc
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.

Description
Adds local development mode for the destination module. When a
mocks/<resource>.jsonfile is present at the repo root, the factory functions (create_client(),create_fragment_client(),create_certificate_client()) automatically return file-backed local clients that implement the same interface as the cloud clients — no credentials or network access required. Removing the mock file reverts to cloud mode with no code changes.A shared abstract base class (
LocalDevClientBase) handles JSON file I/O, thread-safe writes, and access-strategy resolution (SUBSCRIBER_ONLY, PROVIDER_ONLY, SUBSCRIBER_FIRST, PROVIDER_FIRST) for all three local clients. AWARNING-level log is emitted whenever a local client is returned so developers are aware they are not hitting the real service.mocks/is added to.gitignoreto prevent accidental commits of mock files that may contain sensitive data.Related Issue
Type of Change
How to Test
uv sync --devClient type: LocalDev<Resource>Clientand completes the full create → get → update → list → delete cycle without errors or network calls.create_client()falls back to cloud mode (requiresCLOUD_SDK_CFG_*env vars or/etc/secrets/appfndmount).uv run pytest tests/destination/unit/ -vChecklist
Breaking Changes
None. Local mode is additive — the factory functions behave exactly as before when no mock files are present.
Additional Notes
{"subaccount": [...], "instance": [...]}. Subaccount entries without a"tenant"field are provider entries; entries with"tenant"are subscriber-specific.<repo_root>/mocks/<resource>.json. This makes local mode opt-in at the filesystem level with no environment variable or code change required to toggle it.mocks/is gitignored to avoid accidental commits — mock files may contain local URLs, certificate content, or other sensitive data.test_init.py.