-
Notifications
You must be signed in to change notification settings - Fork 11
chore: Add file data source support for FDv2. #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
e613d7c to
e7ada4d
Compare
e7ada4d to
1a548dd
Compare
This comment was marked as outdated.
This comment was marked as outdated.
lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/integrations/FileDataSourceImpl.java
Outdated
Show resolved
Hide resolved
lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/integrations/FileDataSourceImpl.java
Outdated
Show resolved
Hide resolved
lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/integrations/FileDataSourceBase.java
Outdated
Show resolved
Hide resolved
lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/integrations/FileDataSourceBase.java
Show resolved
Hide resolved
...sdk/server/src/main/java/com/launchdarkly/sdk/server/integrations/FileDataSourceBuilder.java
Show resolved
Hide resolved
...sdk/server/src/main/java/com/launchdarkly/sdk/server/integrations/FileDataSourceBuilder.java
Show resolved
Hide resolved
This comment was marked as outdated.
This comment was marked as outdated.
lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/integrations/FileSynchronizer.java
Show resolved
Hide resolved
lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/integrations/FileSynchronizer.java
Outdated
Show resolved
Hide resolved
|
bugbot review |
...sdk/server/src/main/java/com/launchdarkly/sdk/server/integrations/FileDataSourceBuilder.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| DataBuilder builder = new DataBuilder(duplicateKeysHandling); | ||
| int version; | ||
| try { | ||
| version = dataLoader.load(builder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public Initializer build(DataSourceBuildInputs context) { | ||
| return delegate.buildInitializer(context); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent closing brace indentation in nested class
Low Severity
The closing brace of FileInitializerBuilder at line 273 has no indentation (column 0), but should have 2-space indentation to match the nested class pattern. Compare with FileSynchronizerBuilder's closing brace at line 378 which correctly uses 2-space indent.


Note
Medium Risk
Changes core file-data loading and persistence semantics (new
shouldPersistflag/defaults) and introduces new background-thread/file-watcher behavior, which could affect initialization and update delivery timing.Overview
Adds FDv2 support for file-based flag data by introducing
FileData.initializer()(one-shot) andFileData.synchronizer()(watching/streaming) builders that emitFDv2SourceResultchange sets/statuses, sharing parsing/loading logic via newFileDataSourceBase.Refactors the legacy
FileDataSourceImplto delegate to the newFileSynchronizerand adapt FDv2 results back into the oldDataSourcecallbacks, while addingshouldPersistconfiguration (legacy fileDataSourcedefaults to persisting for compatibility; FDv2 initializer/synchronizer default to not persisting).Also bumps
launchdarkly-java-sdk-commonto2.2.1and switches local uses ofIterableAsyncQueueto the sharedcom.launchdarkly.sdk.collections.IterableAsyncQueue(removing the in-repo implementation/tests), plus adds new tests for FDv2 file initializer/synchronizer behavior and persistence defaults.Written by Cursor Bugbot for commit 3c9e35f. This will update automatically on new commits. Configure here.