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 8.0.0 release #227

Merged
merged 527 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
527 commits
Select commit Hold shift + click to select a range
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
d251851
merge from public after release
Apr 13, 2023
99a73e4
feat: Add data source status provider support (#240)
keelerm84 Apr 27, 2023
3e65182
test: Skip database integration tests by default (#241)
keelerm84 Apr 27, 2023
fb2362a
feat: Introduce flag change tracker api (#242)
keelerm84 Apr 28, 2023
8136806
ci: Add code coverage generation (#244)
keelerm84 May 1, 2023
d6d88fe
feat: Add support for data store status monitoring (#243)
keelerm84 May 2, 2023
72b4514
Merge branch 'main' into private-main
keelerm84 May 4, 2023
ba71416
ci: Add v3.2 build job (#245)
keelerm84 May 5, 2023
26985b2
test: General code cleanup and re-organization (#246)
keelerm84 May 10, 2023
f131fbe
test: Annotate and disable flaky tests in JRuby (#247)
keelerm84 May 11, 2023
aad362c
Updates daily flag count
ember-stevens Jun 8, 2023
e3be077
[sc-205159] Update README with current number of flags served (#248)
louis-launchdarkly Jun 10, 2023
cc73764
Merge branch 'main' into private-main
keelerm84 Jul 20, 2023
c5be3d8
ci: Update consul image; fix linting errors (#250)
keelerm84 Sep 5, 2023
9790a5e
feat: Add migration op tracker (#251)
keelerm84 Sep 7, 2023
30c6341
feat: Add migrator and builder (#252)
keelerm84 Sep 7, 2023
03e027b
feat: Implement migration variation method (#253)
keelerm84 Sep 8, 2023
e5f6110
feat: Implement migrator read & write methods (#254)
keelerm84 Sep 8, 2023
4e9190a
feat: Emit migration op event (#255)
keelerm84 Sep 12, 2023
5e6c533
feat: Support event sampling (#256)
keelerm84 Sep 14, 2023
82df533
feat: Support migration and event sampling test capabilities (#257)
keelerm84 Sep 14, 2023
ca7bff4
feat: Remove previously deprecated APIs (#258)
keelerm84 Sep 14, 2023
c3d1261
refactor: Usability improvements (#259)
keelerm84 Sep 14, 2023
2bc514d
fix: Do not run consistency check on errors (#260)
keelerm84 Sep 14, 2023
9c2cdad
fix: Warn if invoked and measurements don't align (#261)
keelerm84 Sep 14, 2023
e1ace04
fix: Handle exceptions in user defined migration functions (#262)
keelerm84 Sep 15, 2023
7d73eb2
chore: Update CODEOWNERS (#264)
keelerm84 Sep 20, 2023
cc768bb
fix: Add version to migration op event (#265)
keelerm84 Sep 27, 2023
e8d61be
fix: Emit event even without flag (#266)
keelerm84 Sep 27, 2023
8670140
refactor: Style and consistency improvements (#267)
keelerm84 Sep 27, 2023
5e1464a
fix: Use WRONG_TYPE for MigrationOp when using non-migration flag (#268)
keelerm84 Oct 2, 2023
67a8238
docs: Fix small typo
keelerm84 Oct 4, 2023
c1f266e
fix: Drop Ruby 2.7 support (#269)
keelerm84 Oct 5, 2023
449ddd1
fix: Pass tracker instead of event into track method (#270)
keelerm84 Oct 5, 2023
094a877
fix: Add deprecation notices for legacy user formats (#271)
keelerm84 Oct 12, 2023
c223b2e
fix: Remove legacy user support (#272)
keelerm84 Oct 13, 2023
cdb3569
merge from public after release
Oct 16, 2023
6ce1ca7
Merge branch 'main' into private-main
keelerm84 Oct 17, 2023
b017da9
doc: Fix grammar error
keelerm84 Oct 17, 2023
79f8c97
Merge branch 'main' into feat/uc2-migrations
keelerm84 Oct 17, 2023
e877dee
Merge uc2 forward into main (#273)
keelerm84 Oct 17, 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
3 changes: 0 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ workflows:
after-install-rubocop:
- run: gem install rubocop-performance
- build-test-windows
- build-test-linux:
name: Ruby 2.7
docker-image: cimg/ruby:2.7
- build-test-linux:
name: Ruby 3.0
docker-image: cimg/ruby:3.0
Expand Down
2 changes: 1 addition & 1 deletion .ldrelease/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ publications:

jobs:
- docker:
image: ruby:2.7-buster
image: ruby:3.0-buster
template:
name: ruby

Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require:
- rubocop-performance

AllCops:
TargetRubyVersion: 2.7
TargetRubyVersion: 3.0
Include:
- lib/**/*.rb
- spec/**/*.rb
Expand Down
3 changes: 2 additions & 1 deletion contract-tests/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ gem 'sinatra', '~> 2.1'
# Sinatra can work with several server frameworks. In JRuby, we have to use glassfish (which
# is only available in JRuby). Otherwise we use thin (which is not available in JRuby).
gem 'glassfish', :platforms => :jruby
gem 'thin', :platforms => :ruby
gem 'http', '~> 5.1'
gem 'json'
gem 'rubocop', '~> 1.37', group: 'development'
gem 'rubocop-performance', '~> 1.15', group: 'development'
gem 'thin', :platforms => :ruby
59 changes: 53 additions & 6 deletions contract-tests/client_entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'net/http'
require 'launchdarkly-server-sdk'
require './big_segment_store_fixture'
require 'http'

class ClientEntity
def initialize(log, config)
Expand Down Expand Up @@ -77,12 +78,12 @@ def evaluate(params)
response = {}

if params[:detail]
detail = @client.variation_detail(params[:flagKey], params[:context] || params[:user], params[:defaultValue])
detail = @client.variation_detail(params[:flagKey], params[:context], params[:defaultValue])
response[:value] = detail.value
response[:variationIndex] = detail.variation_index
response[:reason] = detail.reason
else
response[:value] = @client.variation(params[:flagKey], params[:context] || params[:user], params[:defaultValue])
response[:value] = @client.variation(params[:flagKey], params[:context], params[:defaultValue])
end

response
Expand All @@ -94,19 +95,65 @@ def evaluate_all(params)
opts[:with_reasons] = params[:withReasons] || false
opts[:details_only_for_tracked_flags] = params[:detailsOnlyForTrackedFlags] || false

@client.all_flags_state(params[:context] || params[:user], opts)
@client.all_flags_state(params[:context], opts)
end

def migration_variation(params)
default_stage = params[:defaultStage]
default_stage = default_stage.to_sym if default_stage.respond_to? :to_sym
stage, _ = @client.migration_variation(params[:key], params[:context], default_stage)
stage
end

def migration_operation(params)
builder = LaunchDarkly::Migrations::MigratorBuilder.new(@client)
builder.read_execution_order(params[:readExecutionOrder].to_sym)
builder.track_latency(params[:trackLatency])
builder.track_errors(params[:trackErrors])

callback = ->(endpoint) {
->(payload) {
response = HTTP.post(endpoint, body: payload)

if response.status.success?
LaunchDarkly::Result.success(response.body.to_s)
else
LaunchDarkly::Result.fail("requested failed with status code #{response.status}")
end
}
}

consistency = nil
if params[:trackConsistency]
consistency = ->(lhs, rhs) { lhs == rhs }
end

builder.read(callback.call(params[:oldEndpoint]), callback.call(params[:newEndpoint]), consistency)
builder.write(callback.call(params[:oldEndpoint]), callback.call(params[:newEndpoint]))

migrator = builder.build

return migrator if migrator.is_a? String

if params[:operation] == LaunchDarkly::Migrations::OP_READ.to_s
result = migrator.read(params[:key], params[:context], params[:defaultStage].to_sym, params[:payload])
result.success? ? result.value : result.error
else
result = migrator.write(params[:key], params[:context], params[:defaultStage].to_sym, params[:payload])
result.authoritative.success? ? result.authoritative.value : result.authoritative.error
end
end

def secure_mode_hash(params)
@client.secure_mode_hash(params[:context] || params[:user])
@client.secure_mode_hash(params[:context])
end

def track(params)
@client.track(params[:eventKey], params[:context] || params[:user], params[:data], params[:metricValue])
@client.track(params[:eventKey], params[:context], params[:data], params[:metricValue])
end

def identify(params)
@client.identify(params[:context] || params[:user])
@client.identify(params[:context])
end

def flush_events
Expand Down
9 changes: 8 additions & 1 deletion contract-tests/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
'all-flags-details-only-for-tracked-flags',
'filtering',
'secure-mode-hash',
'user-type',
'tags',
'migrations',
'event-sampling',
],
}.to_json
end
Expand Down Expand Up @@ -102,6 +103,12 @@
when "getBigSegmentStoreStatus"
status = client.get_big_segment_store_status
return [200, nil, status.to_json]
when "migrationVariation"
response = {:result => client.migration_variation(params[:migrationVariation]).to_s}
return [200, nil, response.to_json]
when "migrationOperation"
response = {:result => client.migration_operation(params[:migrationOperation]).to_s}
return [200, nil, response.to_json]
end

return [400, nil, {:error => "Unknown command requested"}.to_json]
Expand Down
2 changes: 1 addition & 1 deletion launchdarkly-server-sdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
spec.files = FileList["lib/**/*", "README.md", "LICENSE.txt"]
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.required_ruby_version = ">= 2.7.0"
spec.required_ruby_version = ">= 3.0.0"

spec.add_development_dependency "aws-sdk-dynamodb", "~> 1.57"
spec.add_development_dependency "bundler", "2.2.33"
Expand Down
1 change: 1 addition & 0 deletions lib/ldclient-rb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module LaunchDarkly
require "ldclient-rb/interfaces"
require "ldclient-rb/util"
require "ldclient-rb/flags_state"
require "ldclient-rb/migrations"
require "ldclient-rb/ldclient"
require "ldclient-rb/cache_store"
require "ldclient-rb/expiring_cache"
Expand Down
71 changes: 3 additions & 68 deletions lib/ldclient-rb/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ class Config
#
# Constructor for creating custom LaunchDarkly configurations.
#
# `user_keys_capacity` and `user_keys_flush_interval` are deprecated
# configuration options. They exist to maintain backwards compatibility
# with previous configurations. Newer code should prefer their replacement
# options -- `context_keys_capacity` and `context_keys_flush_interval`.
#
# In the event both the user and context variations are provided, the
# context specific configuration option will take precedence.
#
# Similarly, `private_attribute_names` is deprecated. Newer code should
# prefer `private_attributes`. If both are provided, `private_attributes`
# will take precedence.
#
# @param opts [Hash] the configuration options
# @option opts [Logger] :logger See {#logger}.
# @option opts [String] :base_uri ("https://sdk.launchdarkly.com") See {#base_uri}.
Expand All @@ -42,12 +30,9 @@ class Config
# @option opts [Float] :poll_interval (30) See {#poll_interval}.
# @option opts [Boolean] :stream (true) See {#stream?}.
# @option opts [Boolean] all_attributes_private (false) See {#all_attributes_private}.
# @option opts [Array] :private_attribute_names See {#private_attribute_names}.
# @option opts [Array] :private_attributes See {#private_attributes}.
# @option opts [Boolean] :send_events (true) See {#send_events}.
# @option opts [Integer] :user_keys_capacity (1000) See {#user_keys_capacity}.
# @option opts [Integer] :context_keys_capacity (1000) See {#context_keys_capacity}.
# @option opts [Float] :user_keys_flush_interval (300) See {#user_keys_flush_interval}.
# @option opts [Float] :context_keys_flush_interval (300) See {#context_keys_flush_interval}.
# @option opts [Object] :data_source See {#data_source}.
# @option opts [Boolean] :diagnostic_opt_out (false) See {#diagnostic_opt_out?}.
Expand Down Expand Up @@ -76,10 +61,10 @@ def initialize(opts = {})
@offline = opts.has_key?(:offline) ? opts[:offline] : Config.default_offline
@poll_interval = opts.has_key?(:poll_interval) && opts[:poll_interval] > Config.default_poll_interval ? opts[:poll_interval] : Config.default_poll_interval
@all_attributes_private = opts[:all_attributes_private] || false
@private_attributes = opts[:private_attributes] || opts[:private_attribute_names] || []
@private_attributes = opts[:private_attributes] || []
@send_events = opts.has_key?(:send_events) ? opts[:send_events] : Config.default_send_events
@context_keys_capacity = opts[:context_keys_capacity] || opts[:user_keys_capacity] || Config.default_context_keys_capacity
@context_keys_flush_interval = opts[:context_keys_flush_interval] || opts[:user_keys_flush_interval] || Config.default_user_keys_flush_interval
@context_keys_capacity = opts[:context_keys_capacity] || Config.default_context_keys_capacity
@context_keys_flush_interval = opts[:context_keys_flush_interval] || Config.default_context_keys_flush_interval
@data_source = opts[:data_source]
@diagnostic_opt_out = opts.has_key?(:diagnostic_opt_out) && opts[:diagnostic_opt_out]
@diagnostic_recording_interval = opts.has_key?(:diagnostic_recording_interval) && opts[:diagnostic_recording_interval] > Config.minimum_diagnostic_recording_interval ?
Expand Down Expand Up @@ -258,14 +243,6 @@ def offline?
#
attr_reader :private_attributes

#
# @deprecated Backwards compatibility alias for #private_attributes.
#
# @return [Integer]
# @see #private_attributes
#
alias :private_attribute_names :private_attributes

#
# Whether to send events back to LaunchDarkly. This differs from {#offline?} in that it affects
# only the sending of client-side events, not streaming or polling for events from the server.
Expand All @@ -281,29 +258,13 @@ def offline?
#
attr_reader :context_keys_capacity

#
# @deprecated Backwards compatibility alias for #context_keys_capacity.
#
# @return [Integer]
# @see #context_keys_flush_interval
#
alias :user_keys_capacity :context_keys_capacity

#
# The interval in seconds at which the event processor will reset its set of known context keys.
# @return [Float]
# @see #context_keys_capacity
#
attr_reader :context_keys_flush_interval

#
# @deprecated Backwards compatibility alias for #context_keys_flush_interval.
#
# @return [Integer]
# @see #context_keys_flush_interval
#
alias :user_keys_flush_interval :context_keys_flush_interval

#
# An object that is responsible for receiving feature flag data from LaunchDarkly. By default,
# the client uses its standard polling or streaming implementation; this is customizable for
Expand Down Expand Up @@ -570,18 +531,6 @@ def self.default_context_keys_flush_interval
300
end

class << self
#
# @deprecated Backwards compatibility alias for #default_context_keys_capacity
#
alias :default_user_keys_capacity :default_context_keys_capacity

#
# @deprecated Backwards compatibility alias for #default_context_keys_flush_interval
#
alias :default_user_keys_flush_interval :default_context_keys_flush_interval
end

#
# The default value for {#diagnostic_recording_interval}.
# @return [Float] 900
Expand Down Expand Up @@ -647,25 +596,11 @@ def initialize(store:, context_cache_size: nil, context_cache_time: nil, status_
# @return [Integer]
attr_reader :context_cache_size

#
# @deprecated Backwards compatibility alias for #context_cache_size
#
# @return [Integer]
#
alias :user_cache_size :context_cache_size

# The maximum length of time (in seconds) that the Big Segment state for a context will be cached
# by the SDK.
# @return [Float]
attr_reader :context_cache_time

#
# @deprecated Backwards compatibility alias for #context_cache_time
#
# @return [Float]
#
alias :user_cache_time :context_cache_time

# The interval (in seconds) at which the SDK will poll the Big Segment store to make sure it is
# available and to determine how long ago it was updated.
# @return [Float]
Expand Down
47 changes: 0 additions & 47 deletions lib/ldclient-rb/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ def self.with_key(key, kind = KIND_DEFAULT)
#
def self.create(data)
return create_invalid_context(ERR_NOT_HASH) unless data.is_a?(Hash)
return create_legacy_context(data) unless data.has_key?(:kind)

kind = data[:kind]
if kind == KIND_MULTI
Expand Down Expand Up @@ -394,52 +393,6 @@ def self.create_multi(contexts)
new(nil, nil, nil, nil, false, nil, nil, error)
end

#
# @param data [Hash]
# @return [LDContext]
#
private_class_method def self.create_legacy_context(data)
warn("DEPRECATED: legacy user format will be removed in 8.0.0", uplevel: 1)

key = data[:key]

# Legacy users are allowed to have "" as a key but they cannot have nil as a key.
return create_invalid_context(ERR_KEY_EMPTY) if key.nil?

name = data[:name]
name_error = LaunchDarkly::Impl::Context.validate_name(name)
return create_invalid_context(name_error) unless name_error.nil?

anonymous = data[:anonymous]
anonymous_error = LaunchDarkly::Impl::Context.validate_anonymous(anonymous, true)
return create_invalid_context(anonymous_error) unless anonymous_error.nil?

custom = data[:custom]
unless custom.nil? || custom.is_a?(Hash)
return create_invalid_context(ERR_CUSTOM_NON_HASH)
end

# We only need to create an attribute hash if one of these keys exist.
# Everything else is stored in dedicated instance variables.
attributes = custom.clone
data.each do |k, v|
case k
when :ip, :email, :avatar, :firstName, :lastName, :country
attributes ||= {}
attributes[k] = v.clone
else
next
end
end

private_attributes = data[:privateAttributeNames]
if private_attributes && !private_attributes.is_a?(Array)
return create_invalid_context(ERR_PRIVATE_NON_ARRAY)
end

new(key.to_s, key.to_s, KIND_DEFAULT, name, anonymous, attributes, private_attributes)
end

#
# @param data [Hash]
# @param kind [String]
Expand Down
6 changes: 5 additions & 1 deletion lib/ldclient-rb/evaluation_detail.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

module LaunchDarkly
# An object returned by {LDClient#variation_detail}, combining the result of a flag evaluation with
# an explanation of how it was calculated.
Expand All @@ -13,6 +12,7 @@ class EvaluationDetail
def initialize(value, variation_index, reason)
raise ArgumentError.new("variation_index must be a number") if !variation_index.nil? && !(variation_index.is_a? Numeric)
raise ArgumentError.new("reason must be an EvaluationReason") unless reason.is_a? EvaluationReason

@value = value
@variation_index = variation_index
@reason = reason
Expand Down Expand Up @@ -100,6 +100,10 @@ class EvaluationReason
# a rule specified a nonexistent variation. An error message will always be logged in this case.
ERROR_MALFORMED_FLAG = :MALFORMED_FLAG

# Value for {#error_kind} indicating that there was an inconsistency between the expected type of the flag, and the
# actual type of the variation evaluated.
ERROR_WRONG_TYPE = :WRONG_TYPE

# Value for {#error_kind} indicating that the caller passed `nil` for the context parameter, or the
# context was invalid.
ERROR_USER_NOT_SPECIFIED = :USER_NOT_SPECIFIED
Expand Down
Loading