Skip to content
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

prepare 7.1.0 release #217

Merged
merged 486 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
486 commits
Select commit Hold shift + click to select a range
d068336
make EvaluationReason an immutable class
eli-darkly Jan 3, 2020
4bf9abc
FrozenError doesn't exist in older Ruby, use more general RuntimeError
eli-darkly Jan 3, 2020
d8f5263
precompute evaluation reasons when we receive a flag
eli-darkly Jan 3, 2020
4ffd4fc
rm unused
eli-darkly Jan 3, 2020
bc24928
Merge branch 'eb/ch60312/reason-type' into eb/ch60312/precompute-reasons
eli-darkly Jan 3, 2020
365dddc
rename FeatureStore to DataStore
eli-darkly Jan 3, 2020
38493b9
remove references to UpdateProcessor (now DataSource)
eli-darkly Jan 3, 2020
4abded2
Merge pull request #122 from launchdarkly/eb/ch43307/bucketing-fix
eli-darkly Jan 7, 2020
0c90251
merge from public after release
LaunchDarklyCI Jan 7, 2020
10620a9
Merge branch 'master' into eb/ch60309/evaluator
eli-darkly Jan 9, 2020
4a38bc5
Merge pull request #123 from launchdarkly/eb/ch60309/evaluator
eli-darkly Jan 9, 2020
d4b1738
Merge pull request #124 from launchdarkly/eb/ch60312/reason-type
eli-darkly Jan 9, 2020
a34f2da
Merge branch 'master' into 6.0
eli-darkly Jan 9, 2020
ae89808
Merge pull request #125 from launchdarkly/eb/ch60312/precompute-reasons
eli-darkly Jan 9, 2020
8b78a4f
Merge pull request #126 from launchdarkly/eb/ch60407/rename-intfs
eli-darkly Jan 10, 2020
1cfcd52
add event payload ID header
eli-darkly Jan 15, 2020
640387c
Merge pull request #128 from launchdarkly/eb/ch61092/event-payload-id
eli-darkly Jan 15, 2020
5e91fe0
merge from public after release
LaunchDarklyCI Jan 15, 2020
abf83e7
Merge branch 'master' into 6.0
eli-darkly Jan 18, 2020
9865a98
(6.0) drop support for old Ruby versions
eli-darkly Jan 18, 2020
bb0d3b1
add Ruby version constraint to gemspec
eli-darkly Jan 23, 2020
65d8bb5
Merge pull request #129 from launchdarkly/eb/ch62102/old-rubies
eli-darkly Feb 3, 2020
4aaf75e
remove Rake dependency
eli-darkly Mar 9, 2020
441a195
update ld-eventsource to 1.0.2 which doesn't have Rake dependency
eli-darkly Mar 10, 2020
df631a7
Merge pull request #131 from launchdarkly/eb/ch68263/no-rake
eli-darkly Mar 10, 2020
602c5e6
implement diagnostic events in Ruby (#130)
eli-darkly Mar 10, 2020
b6566e2
merge from public after release
LaunchDarklyCI Mar 10, 2020
ddfbd17
update ruby-eventsource to 1.0.3 for backoff bug
eli-darkly Mar 18, 2020
4d6f9b5
Merge pull request #132 from launchdarkly/eb/ch69559/eventsource-fix
eli-darkly Mar 18, 2020
b53a212
merge from public after release
LaunchDarklyCI Mar 18, 2020
1fe77bb
fix incorrect initialization of EventProcessor
eli-darkly Mar 27, 2020
87a3f35
Merge pull request #133 from launchdarkly/eb/ch71287/broken-events
eli-darkly Mar 27, 2020
a4280d7
merge from public after release
LaunchDarklyCI Mar 27, 2020
6f0e1e5
remove install-time openssl check that breaks if you don't have rake
eli-darkly Apr 27, 2020
e35f8ab
treat comparison with wrong data type as a non-match, not an exceptio…
eli-darkly Apr 27, 2020
3e55dc4
fail fast for nil SDK key when appropriate
eli-darkly Apr 27, 2020
93112f5
Merge pull request #135 from launchdarkly/eb/ch74874/remove-openssl-c…
eli-darkly Apr 27, 2020
78e7496
Merge pull request #136 from launchdarkly/eb/ch73982/nil-sdk-key
eli-darkly Apr 27, 2020
dcacf1c
merge from public after release
LaunchDarklyCI Apr 27, 2020
ad7cd7f
tolerate nil value for user.custom (#137)
eli-darkly May 4, 2020
3b152d7
merge from public after release
LaunchDarklyCI May 4, 2020
4ca5ad3
Only shutdown the Redis pool if it is owned by the SDK (#158)
jacobthemyth May 27, 2020
60279fe
Merge branch 'contrib' of github.com:launchdarkly/ruby-server-sdk
eli-darkly May 27, 2020
06d55d5
improve doc comment
eli-darkly May 27, 2020
07f202f
merge from public after release
LaunchDarklyCI May 27, 2020
77bf917
remove support for indirect/patch and indirect/put (#138)
eli-darkly Jun 27, 2020
cf7c8a7
update to json 2.3.1 (#139)
apache-hb Nov 9, 2020
3d351a6
merge from public after release
LaunchDarklyCI Nov 9, 2020
ba28493
Merge branch 'master' into 6.0
eli-darkly Nov 17, 2020
0594a08
Merge branch 'master' of github.com:launchdarkly/ruby-server-sdk
eli-darkly Jan 6, 2021
4cc6d9c
add publication of API docs on GitHub Pages (#143)
eli-darkly Jan 6, 2021
5831aa6
try fixing release metadata
eli-darkly Jan 20, 2021
3396234
merge from public after release
LaunchDarklyCI Jan 20, 2021
cc78bba
Merge branch 'master' of github.com:launchdarkly/ruby-server-sdk
eli-darkly Jan 20, 2021
d4eb5b6
Merge branch 'master' of github.com:launchdarkly/ruby-server-sdk-priv…
bwoskow-ld Jan 20, 2021
3214f71
update the default base url (#144)
bwoskow-ld Jan 20, 2021
557d2c4
revert renames of feature_store & update_processor
eli-darkly Jan 21, 2021
d2b5a3c
Merge pull request #145 from launchdarkly/eb/ch98642/revert-intf-rename
eli-darkly Jan 21, 2021
97d2ca0
[ch92483] Use http gem and add socket factory support (#142)
hroederld Jan 22, 2021
c769011
update dependencies and add CI for ruby 3 (#141)
apache-hb Jan 25, 2021
91692ca
reference eventsource 2.0 in gemspec
hroederld Jan 26, 2021
ad0c4f2
add 5.x releasable branch for releaser
hroederld Jan 26, 2021
d76a76f
merge from public after release
LaunchDarklyCI Jan 26, 2021
aa10bba
Merge branch 'master' of github.com:launchdarkly/ruby-server-sdk
eli-darkly Jan 26, 2021
567f54e
use Ruby 2.6.6 in releases
eli-darkly Jan 26, 2021
a092048
Merge pull request #146 from launchdarkly/eb/ch99445/release-ruby-ver…
eli-darkly Jan 26, 2021
ab83620
merge from public after release
LaunchDarklyCI Jan 26, 2021
cc18b1f
Merge github.com:launchdarkly/ruby-server-sdk
hroederld Jan 26, 2021
efec41f
Removed the guides link
bwoskow-ld Feb 3, 2021
7601ec7
[ch99757] add alias method (#147)
hroederld Feb 4, 2021
819c499
merge from public after release
LaunchDarklyCI Feb 4, 2021
162c596
don't send event for nil user evaluation
eli-darkly Feb 6, 2021
3b55709
remove lockfile (#148)
hroederld Feb 6, 2021
110b7c4
Merge branch 'master' into eb/ch100050/no-event-for-nil-user
eli-darkly Feb 6, 2021
e7f4aaa
rm redundant nil check
eli-darkly Feb 6, 2021
bd925f9
Merge pull request #149 from launchdarkly/eb/ch100050/no-event-for-ni…
eli-darkly Feb 6, 2021
c0be90f
merge from public after release
LaunchDarklyCI May 27, 2021
0452cd9
Experiment Allocation Changes (#150)
ld-kyee May 14, 2021
4418cce
Use camelCase for JSON property names (#151)
samstokes Jun 15, 2021
4c2fd31
fixing ruby logic causing ih failures (#152)
ld-kyee Jun 16, 2021
ffda3a2
merge from public after release
LaunchDarklyCI Jun 17, 2021
03dd676
add log warning for missing user key (#153)
eli-darkly Jul 14, 2021
0b86b1b
merge from public after release
Jul 15, 2021
6e5a76c
Merge branch 'master' of github.com:launchdarkly/ruby-server-sdk
eli-darkly Jul 23, 2021
ea70f09
merge from public after release
Jul 23, 2021
0de2cab
diagnostic events should respect HTTPS_PROXY (#154)
bwoskow-ld Aug 6, 2021
6bfb030
minor test simplification (#155)
bwoskow-ld Aug 6, 2021
2a7e0fb
merge from public after release
Aug 6, 2021
57d8eae
allow higher minor versions of json and http gems
eli-darkly Aug 10, 2021
f23c075
Merge pull request #156 from launchdarkly/eb/ch118053/dependency-cons…
eli-darkly Aug 10, 2021
e1d7e83
allow v5.x of http gem (#157)
eli-darkly Aug 10, 2021
d6b7c43
use Bundler 2.2.10 + modernize CI config (#158)
eli-darkly Aug 11, 2021
9272882
merge from public after release
Aug 11, 2021
3891054
enable verbose rspec output
eli-darkly Sep 20, 2021
483799f
fix socket factory tests
eli-darkly Sep 20, 2021
b57c6f4
restore log suppression
eli-darkly Sep 20, 2021
f9f0060
Merge pull request #160 from launchdarkly/eb/ch123138/fix-tests
eli-darkly Sep 21, 2021
dc13eee
Replacing deprecated circleci image usage (#159)
bwoskow-ld Sep 21, 2021
4ff45fc
use Releaser v2 config (#161)
eli-darkly Sep 23, 2021
635b7f8
Updates docs URLs
ember-stevens Sep 24, 2021
fbbe4e6
Update lib/ldclient-rb/ldclient.rb
ember-stevens Sep 26, 2021
e14ac76
Merge pull request #162 from launchdarkly/emberstevens/sc-118589/url-…
ember-stevens Sep 27, 2021
7e2efc8
remove reliance on git in gemspec (#163)
keelerm84 Oct 8, 2021
8331058
use ruby-eventsource 2.1.1 for fix of sc-123850 and sc-125504 (#164)
eli-darkly Oct 12, 2021
2e9f818
merge from public after release
Oct 12, 2021
951df1a
Start work on flag builder.
belevy Nov 21, 2021
7f9091d
Add user targeting and rule builder
belevy Nov 22, 2021
4fdc7e8
Add datasource implementation
belevy Nov 22, 2021
58c60d7
Convert the current_flags hash to use symbols instead of strings as keys
belevy Nov 23, 2021
42e642e
Fix typo on FlagRuleBuilder copy constructor
belevy Nov 23, 2021
2b75a67
minor refactoring of impl; Added use of new Clause struct instead of …
belevy Nov 23, 2021
8a408b2
Add the doc comments
belevy Nov 23, 2021
7c0541d
(big segments 1) add public config/interface/reason types (#167)
eli-darkly Nov 23, 2021
28776f3
Cleanup docstrings to be YARD docs
belevy Nov 24, 2021
ce5de89
Added Util.is_bool helper function to clean up the check for whether …
belevy Nov 24, 2021
f3fd0b4
Merge branch 'bl/sc-130603/test-data-flag-builder' into bl/sc-130603/…
belevy Nov 24, 2021
d9f9af5
Move public classes out of Impl namespace. Most of it is in public na…
belevy Nov 24, 2021
042ecb0
Move require of concurrent/atomics to the correct module
belevy Nov 24, 2021
78e0da5
(big segments 2) implement Big Segments evaluation & status APIs (#168)
eli-darkly Nov 24, 2021
a0794d9
improve CONTRIBUTING.md with notes on code organization
eli-darkly Nov 25, 2021
7199ff1
add note about doc comments
eli-darkly Nov 25, 2021
b9f879f
Cleanup YARD warnings and cleanup docs
belevy Nov 29, 2021
54d8d23
Merge pull request #170 from launchdarkly/eb/sc-132599/code-structure…
eli-darkly Nov 30, 2021
d405059
Merge pull request #165 from launchdarkly/bl/sc-130603/test-data-flag…
belevy Nov 30, 2021
2eacf24
Merge remote-tracking branch 'origin/test-data' into bl/sc-130603/tes…
belevy Nov 30, 2021
5bbf2d3
Address PR feedback: Move is_bool back to Impl namespace to avoid con…
belevy Nov 30, 2021
19087f2
(big segments 3) implement Redis & DynamoDB big segment stores (#169)
eli-darkly Dec 1, 2021
201a61c
add missing import
eli-darkly Dec 4, 2021
fa70dc5
Merge pull request #166 from launchdarkly/bl/sc-130603/test-data-source
belevy Dec 6, 2021
91a7de3
fix stale calculation
eli-darkly Dec 6, 2021
ece6454
fix big segments user hash algorithm to use SHA256
eli-darkly Dec 8, 2021
21777e6
Merge pull request #171 from launchdarkly/eb/sc-132086/big-seg-sha256
eli-darkly Dec 8, 2021
a11d286
improve & refactor client/evaluation tests
eli-darkly Dec 8, 2021
554407c
more cleanup/DRY
eli-darkly Dec 8, 2021
786a8c9
Merge pull request #172 from launchdarkly/eb/sc-132086/better-eval-tests
eli-darkly Dec 8, 2021
0270d99
Merge branch 'big-segments'
eli-darkly Dec 9, 2021
28043c5
Merge branch 'test-data'
eli-darkly Dec 9, 2021
2b544c5
add use_preconfigured_flag and use_preconfigured_segment to TestData …
eli-darkly Dec 9, 2021
c8c8693
always cache big segment query result even if it's nil
eli-darkly Dec 9, 2021
6283277
comments
eli-darkly Dec 9, 2021
88e6b2a
add test for cache expiration
eli-darkly Dec 9, 2021
bb3ecc5
Merge pull request #175 from launchdarkly/eb/sc-132086/cache-nil-big-seg
eli-darkly Dec 9, 2021
d9c3274
use TestData in our own tests (#174)
eli-darkly Dec 9, 2021
3e4c893
replace LaunchDarkly::FileDataSource with LaunchDarkly::Integrations:…
eli-darkly Dec 9, 2021
86e3d62
Merge pull request #176 from launchdarkly/eb/sc-134212/move-file-data
eli-darkly Dec 9, 2021
facb505
merge from public after release
Dec 9, 2021
3d35964
update ruby-eventsource version for recent SSE fixes
eli-darkly Dec 31, 2021
32055f1
Merge pull request #177 from launchdarkly/eb/sc-136090/eventsource-fixes
eli-darkly Dec 31, 2021
01986ee
merge from public after release
Dec 31, 2021
5dadfe0
Bump bundler version (#184)
keelerm84 Jan 27, 2022
4a63c45
Add ability to to set initial reconnect delay (#183)
keelerm84 Jan 28, 2022
5e7cd71
Treat secondary as a built-in attribute (#180)
keelerm84 Jan 28, 2022
64b2549
all_flags_state is invalid if store isn't initialized (#182)
keelerm84 Jan 28, 2022
275b005
identify should not emit events if user key is "" (#181)
keelerm84 Jan 28, 2022
32e74ed
Account for traffic allocation on all flags (#185)
keelerm84 Feb 3, 2022
5af6e9a
Add contract tests (#178)
keelerm84 Feb 16, 2022
baca84b
Fix string interpolation in log message (#187)
keelerm84 Feb 18, 2022
4a38c40
Default opts to empty hash when creating persistent feature store (#186)
keelerm84 Mar 3, 2022
b9432e9
Remove Hakiri badge from README (#188)
keelerm84 Mar 3, 2022
f2c2228
detect http/https proxy env vars when creating HTTP clients
eli-darkly Mar 16, 2022
aef4ead
rever accidental change
eli-darkly Mar 16, 2022
c4b2976
Merge pull request #189 from launchdarkly/eb/sc-146239/proxy
eli-darkly Mar 18, 2022
f8ac540
merge from public after release
Mar 18, 2022
1bd1fae
fix nil safety in test service config
eli-darkly May 3, 2022
371ffea
Merge pull request #191 from launchdarkly/eb/sc-139410/test-service-nil
eli-darkly May 4, 2022
7ba54a7
master -> main (#190)
keelerm84 May 5, 2022
518709c
master -> main
keelerm84 May 5, 2022
2152220
update ruby-eventsource version for parsing efficiency fix
eli-darkly Jun 15, 2022
64d1ae4
Merge pull request #192 from launchdarkly/eb/sc-157090/eventsource-up…
eli-darkly Jun 15, 2022
5835035
Merge branch 'main' of github.com:launchdarkly/ruby-server-sdk
eli-darkly Jun 15, 2022
70c2b24
merge from public after release
Jun 15, 2022
654019c
miscellaneous optimizations for event processing (#193)
eli-darkly Jun 29, 2022
cb5de9d
merge from public after release
Jun 30, 2022
94f95f4
Drop support for EOL ruby versions (#196)
keelerm84 Jul 8, 2022
684eddc
Remove alias support (#195)
keelerm84 Jul 8, 2022
2635e0d
Add polling support for contract test service (#198)
keelerm84 Jul 11, 2022
c9c941d
Merge branch 'main' into v7
keelerm84 Jul 11, 2022
a656f9d
Update rubocop and enable in CI (#197)
keelerm84 Jul 11, 2022
6d9e42c
Add windows tests in circleci (#199)
keelerm84 Jul 11, 2022
9ab0c53
Merge branch 'main' into v7
keelerm84 Jul 11, 2022
4c48d05
Add application info support (#194)
keelerm84 Aug 1, 2022
bf82e5f
Merge branch 'main' into v7
keelerm84 Aug 1, 2022
cba083c
reuse EvaluationDetail instances by precomputing results
eli-darkly Aug 5, 2022
2bc642d
Merge branch 'main' of github.com:launchdarkly/ruby-server-sdk
louis-launchdarkly Aug 9, 2022
1e6f6ec
Merge pull request #204 from launchdarkly/eb/sc-162274/reuse-eval-result
eli-darkly Sep 7, 2022
27a8619
merge from public after release
Sep 7, 2022
ef814e5
Merge branch 'main' into v7
eli-darkly Sep 13, 2022
e98c61a
rubocop reformatting
eli-darkly Sep 13, 2022
5be3532
add super constructor calls
eli-darkly Sep 13, 2022
00e8a25
disable rubocop Rails rules and fix some remaining syntax offenses
eli-darkly Sep 13, 2022
be330d5
Merge pull request #205 from launchdarkly/eb/sc-159609/no-rubocop-rails
eli-darkly Sep 13, 2022
758c59b
Merge branch 'v7' into eb/sc-162274/merge-forward
eli-darkly Sep 13, 2022
87586d4
fix super calls
eli-darkly Sep 13, 2022
9732193
Add big segment support to contract tests (#201)
keelerm84 Sep 30, 2022
1554667
Merge branch 'main' into v7
keelerm84 Sep 30, 2022
eac8ae6
Initial creation of LDContext (#206)
keelerm84 Oct 10, 2022
0362d35
Add reference based value retrieval (#207)
keelerm84 Oct 20, 2022
c459824
Basic changes to use contexts in evaluations instead of users (#208)
keelerm84 Oct 26, 2022
6cc0f1b
Support ContextKind in Clauses (#209)
keelerm84 Oct 27, 2022
5ba3853
Support included / excluded contexts in segments (#210)
keelerm84 Oct 27, 2022
33a3cb9
Add contextKind support for rollouts & experiements (#211)
keelerm84 Oct 28, 2022
a500be9
Style and test matcher improvements (#212)
keelerm84 Oct 28, 2022
540ee91
Remove support for secondary attribute (#213)
keelerm84 Oct 28, 2022
1bc9186
Remove deprecated APIs (#214)
keelerm84 Nov 2, 2022
7f35335
store data model with classes that aren't Hash
eli-darkly Nov 3, 2022
6204833
lint
eli-darkly Nov 3, 2022
fd25f46
remove [] override methods in places where we don't need them
eli-darkly Nov 3, 2022
1a6a1d0
comments
eli-darkly Nov 3, 2022
351b3ec
migrate some more of the model to be non-hash classes
eli-darkly Nov 3, 2022
d4ff5bc
lint
eli-darkly Nov 3, 2022
203a8e5
Anonymous cannot be nil in new context format (#216)
keelerm84 Nov 8, 2022
56bf82d
Tweak error message language and style (#217)
keelerm84 Nov 8, 2022
4018f31
copyedit
eli-darkly Nov 9, 2022
bd3a675
Merge pull request #218 from launchdarkly/eb/sc-175399/model-classes
eli-darkly Nov 9, 2022
bbc442a
Implement prerequisite cycle detection (#219)
keelerm84 Dec 8, 2022
22d6aa4
Support attribute reference lookups (#215)
keelerm84 Dec 8, 2022
25f1c4f
Implement segment recursion and cycle detection (#220)
keelerm84 Dec 9, 2022
4375e0d
Update event logic to support users to context change (#221)
keelerm84 Dec 13, 2022
8b7ee10
Add legacy user-type support to the contract tests (#222)
keelerm84 Dec 13, 2022
ba4ec8c
Remove inline user configuration option (#223)
keelerm84 Dec 13, 2022
d96cc9b
Add context_ configuration options (#224)
keelerm84 Dec 13, 2022
f0f5477
Add support for flag context targets (#225)
keelerm84 Dec 13, 2022
ec3470a
Bump diplomat
keelerm84 Dec 14, 2022
0f865c1
Bump redis
keelerm84 Dec 14, 2022
26fb9f3
Remove oga
keelerm84 Dec 14, 2022
e1b6201
Bump connection_pool
keelerm84 Dec 14, 2022
f54a7a4
Merge pull request #230 from launchdarkly/mk/sc-180901/update-depende…
eli-darkly Dec 20, 2022
5e7f57b
Favor set for faster target lookups (#228)
keelerm84 Dec 20, 2022
4f1437e
Add secure mode hash to contract tests (#229)
keelerm84 Dec 20, 2022
5d48538
Update big segment support for users to context (#226)
keelerm84 Dec 20, 2022
0046fdc
Drop support for ruby 2.6 (#227)
keelerm84 Dec 20, 2022
ae2dce9
Update remaining references from user to contexts (#231)
keelerm84 Dec 21, 2022
7e732a2
Remove new relic integration (#233)
keelerm84 Dec 21, 2022
5530092
Rename config option private_attribute_names (#234)
keelerm84 Dec 28, 2022
47a12e0
Update test data integration to support contexts (#232)
keelerm84 Dec 29, 2022
fa3547d
Merge pull request #235 from launchdarkly/v7
keelerm84 Dec 29, 2022
9d1473f
Merge branch 'main' into private-main
keelerm84 Dec 30, 2022
fd014d3
merge from public after release
Dec 30, 2022
93f0e79
improve data model validation logging; allow missing/empty attribute …
eli-darkly Jan 11, 2023
7e48362
merge from public after release
Jan 19, 2023
497e519
Fix JSON serialization failure (#237)
keelerm84 Jan 27, 2023
fda1e55
merge from public after release
Jan 27, 2023
144d813
fix: Bump eventsource to resolve header parsing (#239)
keelerm84 Mar 16, 2023
f6e8611
merge from public after release
Mar 17, 2023
217cd4f
Merge branch 'main' of github.com:launchdarkly/ruby-server-sdk
louis-launchdarkly Mar 23, 2023
b3d6fdf
Add key to error log for invalid context during variation call for ea…
matt-dutchie Mar 31, 2023
ed38462
Merge branch 'contrib' into private-main
keelerm84 Mar 31, 2023
aca1efa
merge from public after release
Apr 3, 2023
22a1f8f
Merge branch 'main' of github.com:launchdarkly/ruby-server-sdk
louis-launchdarkly Apr 12, 2023
8e784e2
feat: Add support for payload filtering (#238)
keelerm84 Apr 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions contract-tests/client_entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ def initialize(log, config)
if config[:streaming]
streaming = config[:streaming]
opts[:stream_uri] = streaming[:baseUri] unless streaming[:baseUri].nil?
opts[:payload_filter_key] = streaming[:filter] unless streaming[:filter].nil?
opts[:initial_reconnect_delay] = streaming[:initialRetryDelayMs] / 1_000.0 unless streaming[:initialRetryDelayMs].nil?
elsif config[:polling]
polling = config[:polling]
opts[:stream] = false
opts[:base_uri] = polling[:baseUri] unless polling[:baseUri].nil?
opts[:payload_filter_key] = polling[:filter] unless polling[:filter].nil?
opts[:poll_interval] = polling[:pollIntervalMs] / 1_000.0 unless polling[:pollIntervalMs].nil?
end

Expand Down
1 change: 1 addition & 0 deletions contract-tests/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
'all-flags-with-reasons',
'all-flags-client-side-only',
'all-flags-details-only-for-tracked-flags',
'filtering',
'secure-mode-hash',
'user-type',
'tags',
Expand Down
17 changes: 17 additions & 0 deletions lib/ldclient-rb/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Config
# @option opts [#open] :socket_factory See {#socket_factory}.
# @option opts [BigSegmentsConfig] :big_segments See {#big_segments}.
# @option opts [Hash] :application See {#application}
# @option opts [String] :payload_filter_key See {#payload_filter_key}
#
def initialize(opts = {})
@base_uri = (opts[:base_uri] || Config.default_base_uri).chomp("/")
Expand Down Expand Up @@ -88,6 +89,7 @@ def initialize(opts = {})
@socket_factory = opts[:socket_factory]
@big_segments = opts[:big_segments] || BigSegmentsConfig.new(store: nil)
@application = LaunchDarkly::Impl::Util.validate_application_info(opts[:application] || {}, @logger)
@payload_filter_key = opts[:payload_filter_key]
end

#
Expand Down Expand Up @@ -330,6 +332,21 @@ def offline?
#
attr_reader :application

#
# LaunchDarkly Server SDKs historically downloaded all flag configuration and segments for a particular environment
# during initialization.
#
# For some customers, this is an unacceptably large amount of data, and has contributed to performance issues within
# their products.
#
# Filtered environments aim to solve this problem. By allowing customers to specify subsets of an environment's
# flags using a filter key, SDKs will initialize faster and use less memory.
#
# This payload filter key only applies to the default streaming and polling data sources. It will not affect TestData or FileData
# data sources, nor will it be applied to any data source provided through the {#data_source} config property.
#
attr_reader :payload_filter_key

#
# Set to true to opt out of sending diagnostics data.
#
Expand Down
8 changes: 3 additions & 5 deletions lib/ldclient-rb/requestor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@ def stop

private

def request_single_item(kind, path)
Impl::Model.deserialize(kind, make_request(path), @config.logger)
end

def make_request(path)
uri = URI(@config.base_uri + path)
uri = URI(
Util.add_payload_filter_key(@config.base_uri + path, @config)
)
headers = {}
Impl::Util.default_http_headers(@sdk_key, @config).each { |k, v| headers[k] = v }
headers["Connection"] = "keep-alive"
Expand Down
4 changes: 3 additions & 1 deletion lib/ldclient-rb/stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def start
reconnect_time: @config.initial_reconnect_delay,
}
log_connection_started
@es = SSE::Client.new(@config.stream_uri + "/all", **opts) do |conn|

uri = Util.add_payload_filter_key(@config.stream_uri + "/all", @config)
@es = SSE::Client.new(uri, **opts) do |conn|
conn.on_event { |event| process_message(event) }
conn.on_error { |err|
log_connection_result(false)
Expand Down
26 changes: 26 additions & 0 deletions lib/ldclient-rb/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@
module LaunchDarkly
# @private
module Util
#
# Append the payload filter key query parameter to the provided URI.
#
# @param uri [String]
# @param config [Config]
# @return [String]
#
def self.add_payload_filter_key(uri, config)
return uri if config.payload_filter_key.nil?

unless config.payload_filter_key.is_a?(String) && !config.payload_filter_key.empty?
config.logger.warn { "[LDClient] Filter key must be a non-empty string. No filtering will be applied." }
return uri
end

begin
parsed = URI.parse(uri)
new_query_params = URI.decode_www_form(String(parsed.query)) << ["filter", config.payload_filter_key]
parsed.query = URI.encode_www_form(new_query_params)
parsed.to_s
rescue URI::InvalidURIError
config.logger.warn { "[LDClient] URI could not be parsed. No filtering will be applied." }
uri
end
end

def self.new_http_client(uri_s, config)
http_client_options = {}
if config.socket_factory
Expand Down