Repository navigation
feat: Add the flag-overrides capability to the contract test service - #225
Draft
kinyoklion wants to merge 1 commit into
Draft
kinyoklion wants to merge 1 commit into
kinyoklion wants to merge 1 commit into
Conversation
kinyoklion
force-pushed
the
rlamb/overrides-java-file-override-source
branch
from
September 28, 2026 21:04
bc2e4a9 to
657a598
Compare
kinyoklion
force-pushed
the
rlamb/overrides-java-contract-tests
branch
from
September 28, 2026 21:04
5069a69 to
dd3942a
Compare
kinyoklion
force-pushed
the
rlamb/overrides-java-file-override-source
branch
from
October 1, 2026 23:44
657a598 to
5be8948
Compare
kinyoklion
force-pushed
the
rlamb/overrides-java-contract-tests
branch
from
October 1, 2026 23:44
dd3942a to
56efaf2
Compare
kinyoklion
force-pushed
the
rlamb/overrides-java-file-override-source
branch
from
October 3, 2026 00:58
5be8948 to
9992774
Compare
kinyoklion
force-pushed
the
rlamb/overrides-java-contract-tests
branch
from
October 3, 2026 00:58
56efaf2 to
c355fd9
Compare
Member
Author
|
bugbot 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 c355fd9. Configure here.
kinyoklion
force-pushed
the
rlamb/overrides-java-file-override-source
branch
from
October 3, 2026 01:43
9992774 to
1728c29
Compare
kinyoklion
force-pushed
the
rlamb/overrides-java-contract-tests
branch
from
October 3, 2026 01:43
c355fd9 to
310a4a1
Compare
kinyoklion
force-pushed
the
rlamb/overrides-java-file-override-source
branch
from
October 13, 2026 21:02
1728c29 to
c134bcc
Compare
kinyoklion
force-pushed
the
rlamb/overrides-java-contract-tests
branch
2 times, most recently
from
October 15, 2026 22:24
712cb2f to
048b678
Compare
The contract test service advertises the flag-overrides capability and accepts the overrides object in the SDK configuration: filePaths, duplicateKeysHandling, changeDetection, and pollIntervalMs. The block configures FileOverrides.source() on the data system builder. An overrides block without a dataSystem block is rejected, because the override source is an option of the FDv2 data system. The service reads its listening port from the PORT environment variable when set, which the Makefile already passes, so several test services can run side by side. The default stays 8000.
kinyoklion
force-pushed
the
rlamb/overrides-java-file-override-source
branch
from
October 16, 2026 21:18
a0f4c55 to
21f7364
Compare
kinyoklion
force-pushed
the
rlamb/overrides-java-contract-tests
branch
from
October 16, 2026 21:18
048b678 to
948f0bc
Compare
kinyoklion
added a commit
that referenced
this pull request
Oct 23, 2026
…240) ## Summary The Java contract test service did not declare the `flag-change-listeners` and `flag-value-change-listeners` capabilities, so the test harness skipped its flag change listener suite for Java. The suite now also covers dependent-flag notifications (sdk-test-harness #514) and override change notifications (#515), and Java should be checked by all of it. The service now declares both capabilities and handles the three listener commands. `ListenerRegistry` keeps the listeners the harness has registered with one SDK client, keyed by the harness's listener ID. A general flag change listener is registered with `FlagTracker.addFlagChangeListener` and posts the flag key of every change event to its callback URI. A flag value change listener uses `FlagTracker.addFlagValueChangeListener` for the given flag and context and posts the old and new values when the SDK reports a value change. `unregisterListener` removes the listener and returns 400 for an unknown ID; closing the client removes them all; re-registering an ID replaces the earlier listener. Notifications are posted through the existing `HookCallbackService`, and a failed post is logged rather than thrown, since the SDK calls listeners from its worker thread. The Java API has no application default value for a value change listener, so the `defaultValue` the harness sends is accepted and not used; the harness tests only compare the values of flags that exist. ## Verification Run locally: the released harness listener suite passes against this service, and so does the dependent-flag suite from sdk-test-harness #514 (prerequisite chains, segment and nested segment references, a segment behind a prerequisite, deletions, and full data sets). With this commit cherry-picked onto the flag overrides stack (#225), the override change notification suite from sdk-test-harness #515 passes as well. CI will run the released suite once the capabilities are declared. [SDK-3355](https://launchdarkly.atlassian.net/browse/SDK-3355) [SDK-3355]: https://launchdarkly.atlassian.net/browse/SDK-3355?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
This branch has not been deployed
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.
Summary
The contract test service now advertises the
flag-overridescapability and accepts theoverridesobject in the SDK configuration, as the test harness service specification describes:filePaths(required),duplicateKeysHandling(failorignore),changeDetection(pollingorwatching), andpollIntervalMs. The block configuresFileOverrides.source()on the data system builder. Anoverridesblock without adataSystemblock is rejected, because the override source is an option of the FDv2 data system.The service also reads its listening port from the
PORTenvironment variable when set, which the Makefile already passes, so several test services can run side by side on one machine. The default stays 8000.This PR depends on the file-based override source (rlamb/overrides-java-file-override-source) and is based on that branch; retarget it to feat/overrides once that branch merges.
The existing file data source keeps its current behavior; this change does not touch its code paths.
SDK-3246
Note
Overview
The Java server SDK contract test service now supports the
flag-overridesharness capability so cross-SDK tests can drive file-based flag overrides.Create-instance config accepts an optional
overridesblock (filePaths,duplicateKeysHandling,changeDetection,pollIntervalMs), mapped toFileOverrides.source()on the FDv2 data system builder.overrideswithoutdataSystemis rejected with a clear error, since overrides are a data-system option only.The service advertises
flag-overridesin its status capabilities. It also honors thePORTenvironment variable for the HTTP listen port (default 8000), so multiple contract-test services can run on one machine.Reviewed by Cursor Bugbot for commit c355fd9. Bugbot is set up for automated code reviews on this repo. Configure here.