Add disabled offline Feature Flagging contract#7305
Open
leoromanovsky wants to merge 6 commits into
Open
Conversation
Contributor
|
|
|
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.
Motivation
Define the cross-SDK contract for startup-only offline Feature Flagging on
mainbefore each SDK implementation exists. Offline is not a cached agentless startup: the application supplies UFC JSON bytes when it creates the provider, evaluations must be ready immediately, and Feature Flagging must not activate either network configuration source.Today, system-tests can deliver the canonical UFC fixtures through Remote Configuration or the mocked agentless HTTP endpoint, but it has no cross-SDK path for passing raw UFC bytes into provider construction. That leaves offline initialization, immediate readiness, immutability, and network isolation untestable.
flowchart LR fixtures["Canonical UFC fixtures"] subgraph available["Capabilities available before this PR"] rc["Inject UFC through Remote Configuration"] agentless["Serve UFC through the agentless mock endpoint"] async["Run evaluation assertions after asynchronous readiness"] rc --> async agentless --> async end subgraph missing["Missing offline capability"] noinput["No parametric input for UFC startup bytes"] noinit["Cannot construct a provider in offline mode"] noproof["Cannot prove immediate readiness, immutability, or FFE network isolation"] noinput --> noinit --> noproof end fixtures --> rc fixtures --> agentless fixtures -.-> noinputThe tests remain disabled in every SDK manifest. The stacked Java reference in DataDog/dd-trace-java#11933 exists only to prove that this contract and the harness work end to end before SDK owners implement it.
Changes
/ffe/startFFE_FLAGSRemote Configuration payload and prove that it cannot replace the startup bytesFFE_FLAGSproduct and capability, while allowing unrelated tracer RC traffic or no RC traffic at allutilsso framework code does not import the parametric test packagedd-openfeatureartifact required for local Java provider testingflowchart TB before["Delivery-specific fixture loading and evaluation logic"] shared["Shared UFC fixture bytes and evaluation runner"] before --> shared subgraph delivery["Configuration source adapters"] rc["Remote Configuration injection"] agentless["Agentless mock HTTP endpoint"] offline["Offline bytes sent through ffe start"] end shared --> rc shared --> agentless shared --> offline rc --> retry["Asynchronous readiness retry"] agentless --> retry offline --> immediate["First evaluation must be ready"] retry --> semantics["Canonical UFC and OpenFeature assertions"] immediate --> semantics offline --> failed["Empty or malformed bytes fail closed"] offline --> immutable["Conflicting FFE RC cannot replace startup configuration"] offline --> isolated["No agentless request and no FFE RC subscription"] semantics --> feature["Parity feature 562 Offline init"] failed --> feature immutable --> feature isolated --> feature feature --> manifests["All SDK manifests stay disabled until native implementations land"]Tests added
The file contributes 26 pytest items. Each canonical fixture group can contain multiple flag-evaluation assertions.
test_offline_configuration_evaluates_fixturetest_invalid_startup_configuration_fails_closed[empty]test_invalid_startup_configuration_fails_closed[malformed]test_offline_configuration_is_immutable_and_network_isolatedgreen, injects a conflicting RC fixture whose same variation evaluates toreplacement, observes both network surfaces, then evaluates again.green; the agentless endpoint receives zero requests; all observed RC requests omitFFE_FLAGSand its capability. Unrelated tracer RC polling is permitted.Decisions
Validation
./format.sh— passed mypy, Ruff, YAML formatting/lint, parser checks, ShellCheck, and Node.js linters./run.sh TEST_THE_TEST tests/test_the_test/test_conventions.py tests/test_the_test/test_mock_ffe_agentless_backend.py tests/test_the_test/test_features.py tests/test_the_test/test_manifest.py -q—29 passed, 1 deselectedwith locally built artifacts matching DataDog/dd-trace-java#11933 head
8d654e23b7:Result:
26 passed in 32.29s.