-
Notifications
You must be signed in to change notification settings - Fork 54
chore: Switch to using symbols in FDv2 for consistency with v1 #354
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
Open
jsonbailey
wants to merge
27
commits into
main
Choose a base branch
from
jb/sdk-1547/test-persistent-data-store-recovery
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
5003b43
chore: Add FDv2 compatible data source for testing
jsonbailey 065f066
Update lib/ldclient-rb/integrations/test_data_v2/flag_builder_v2.rb
jsonbailey e99c7fc
adding tests and including fixes identified during tests
jsonbailey 8a8b294
fix tests
jsonbailey 13cd0a4
fix deep copy issue
jsonbailey 2fc9fa0
fix lint error
jsonbailey 1077e2d
because of thread.join with timeouts increase waits to avoid flaky tests
jsonbailey 7066680
chore: Create FDv2 and fallback polling data source
jsonbailey 4f75f75
address feedback
jsonbailey 4b79d47
Merge branch 'main' into jb/sdk-1544/fdv2-polling-data-source
jsonbailey 4bf0b8f
one more name change
jsonbailey b97a23d
prevent immediate retry
jsonbailey fa0bb87
always set selector in changeset builder
jsonbailey 6547940
chore: Create FDv2 streaming data source
jsonbailey 2d00acf
fix lint issues
jsonbailey e4fdafe
enable updating basis on reconnect
jsonbailey 6e0a89b
Merge branch 'main' into jb/sdk-1545/fdv2-streaming-data-source
jsonbailey e7458e2
fix lint error
jsonbailey a0725ef
Merge branch 'main' into jb/sdk-1545/fdv2-streaming-data-source
jsonbailey dc700f0
stop streamer if we are falling back
jsonbailey b3ffac4
enable fdv2 configs
jsonbailey 021b0b2
fix streaming sync to block while running
jsonbailey 3761f39
address feedback
jsonbailey 7c73f81
address feedback
jsonbailey 7745751
chore: Switch to using symbols in fdv2 for consistency with v1
jsonbailey 170e389
Merge branch 'main' into jb/sdk-1547/test-persistent-data-store-recovery
jsonbailey 4e9325c
fix mismatch
jsonbailey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| require "spec_helper" | ||
| require "ldclient-rb/impl/data_store/in_memory_feature_store" | ||
| require "ldclient-rb/impl/data_store" | ||
|
|
||
| module LaunchDarkly | ||
| module Impl | ||
| module DataStore | ||
| describe InMemoryFeatureStoreV2 do | ||
| let(:logger) { double.as_null_object } | ||
| subject { InMemoryFeatureStoreV2.new(logger) } | ||
|
|
||
| let(:flag_key) { "test-flag" } | ||
| let(:flag) do | ||
| { | ||
| key: flag_key, | ||
| version: 1, | ||
| on: true, | ||
| fallthrough: { variation: 0 }, | ||
| variations: [true, false], | ||
| } | ||
| end | ||
|
|
||
| describe "#get with string/symbol key compatibility" do | ||
| before do | ||
| # Store items with symbol keys (as done by FDv2 protocol layer) | ||
| collections = { | ||
| FEATURES => { flag_key.to_sym => flag }, | ||
| } | ||
| subject.set_basis(collections) | ||
| end | ||
|
|
||
| it "retrieves items with string keys (critical for variation calls)" do | ||
| result = subject.get(FEATURES, flag_key) | ||
| expect(result).to be_a(LaunchDarkly::Impl::Model::FeatureFlag) | ||
| expect(result.key).to eq(flag_key) | ||
| end | ||
|
|
||
| it "retrieves items with symbol keys" do | ||
| result = subject.get(FEATURES, flag_key.to_sym) | ||
| expect(result).to be_a(LaunchDarkly::Impl::Model::FeatureFlag) | ||
| expect(result.key).to eq(flag_key) | ||
| end | ||
|
|
||
| it "returns nil for non-existent keys" do | ||
| expect(subject.get(FEATURES, "nonexistent")).to be_nil | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.