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 6.1.0 release #172

Merged
merged 306 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
306 commits
Select commit Hold shift + click to select a range
2d29388
Merge pull request #82 from launchdarkly/eb/ch25289/file-source
eli-darkly Nov 2, 2018
38f534f
don't use Thread.raise to stop PollingProcessor thread; add test for …
eli-darkly Nov 2, 2018
4966136
Merge pull request #83 from launchdarkly/eb/ch19334/no-thread-raise
eli-darkly Nov 3, 2018
af2c98c
merge from public after release
LaunchDarklyCI Nov 3, 2018
457e85b
Merge branch 'master' of github.com:launchdarkly/ruby-client
eli-darkly Nov 5, 2018
4ad6a9b
merge from public after release
LaunchDarklyCI Nov 5, 2018
5a875c8
test on most recent patch version of each Ruby minor version
eli-darkly Dec 10, 2018
cf7d900
factor common logic out of RedisFeatureStore, add integrations module
eli-darkly Dec 15, 2018
4d34bc4
fix method reference
eli-darkly Dec 15, 2018
19182ad
misc cleanup
eli-darkly Dec 15, 2018
5941638
comment
eli-darkly Dec 15, 2018
b4cf610
re-add test file
eli-darkly Dec 15, 2018
3f9ef3b
misc cleanup
eli-darkly Dec 15, 2018
fa831f9
misc cleanup
eli-darkly Dec 15, 2018
ea68da4
initial DynamoDB implementation
eli-darkly Dec 15, 2018
bde2274
fix exception name
eli-darkly Dec 15, 2018
4e49317
fix test setup
eli-darkly Dec 15, 2018
c71bbec
comments
eli-darkly Dec 15, 2018
cfe3b18
readme
eli-darkly Dec 15, 2018
69cf890
fix doc comment
eli-darkly Dec 15, 2018
321eb6e
greatly improve documentation comments
eli-darkly Dec 15, 2018
5975954
comment fixes
eli-darkly Dec 15, 2018
414af99
change name of "update processor" to "data source"
eli-darkly Dec 15, 2018
c62c49e
Merge pull request #85 from launchdarkly/eb/ch28328/feature-store-sup…
eli-darkly Dec 18, 2018
81dcbf1
Merge pull request #86 from launchdarkly/eb/ch28328/dynamodb
eli-darkly Dec 18, 2018
216a1e8
Merge pull request #87 from launchdarkly/eb/docs
eli-darkly Dec 18, 2018
0fc71a8
Merge pull request #88 from launchdarkly/eb/data-source
eli-darkly Dec 18, 2018
fdb0291
default dynamodb_opts to {}
eli-darkly Dec 21, 2018
65ee009
fix Unicode handling in polling requests
eli-darkly Dec 21, 2018
86820ea
initial Consul implementation
eli-darkly Jan 3, 2019
485a73d
use new SSE gem
eli-darkly Jan 3, 2019
8567439
numerous Ruby SDK documentation fixes
eli-darkly Jan 4, 2019
63c3680
fix bundler version
eli-darkly Jan 4, 2019
008331b
fix build
eli-darkly Jan 4, 2019
c09c166
make some dependencies less strict and remove some unused ones
eli-darkly Jan 4, 2019
a4ced95
not using thread_safe
eli-darkly Jan 4, 2019
806bb8e
add bundler version (still not sure why we need to)
eli-darkly Jan 4, 2019
9d446c8
don't need bundler version for all rubies
eli-darkly Jan 4, 2019
5516745
fix bundler version again
eli-darkly Jan 4, 2019
54add1d
try to fix bundler version again
eli-darkly Jan 4, 2019
3d4b080
yet another build fix
eli-darkly Jan 5, 2019
635adf4
commit lock file to get correct bundler
eli-darkly Jan 5, 2019
3b5b08e
update lockfile
eli-darkly Jan 5, 2019
97bb302
Merge pull request #91 from launchdarkly/eb/ch29193/dependencies
eli-darkly Jan 5, 2019
5f28ecd
merge from public after release
eli-darkly Jan 5, 2019
b346917
Merge branch '5.4.x'
eli-darkly Jan 5, 2019
6342423
Merge branch 'eb/ruby-patch-versions' into eb/ch29137/sse-gem
eli-darkly Jan 5, 2019
e7f5f55
Merge branch 'master' into eb/ch29137/sse-gem
eli-darkly Jan 5, 2019
8656f25
use ruby-eventsource
eli-darkly Jan 6, 2019
1ced67e
uninstall unwanted bundler upgrade in CI
eli-darkly Jan 6, 2019
e11bf4b
allow net-http-persistent 3.x
eli-darkly Jan 6, 2019
cb2193e
uninstall unwanted bundler upgrade in CI
eli-darkly Jan 6, 2019
4b1167a
Merge branch '5.4.x' into eb/net-http-version
eli-darkly Jan 6, 2019
3f4e432
rewrite requestor without Faraday - don't have proxy yet
eli-darkly Jan 7, 2019
b250437
reduce intermittent HTTP errors on stub server by not reusing ports
eli-darkly Jan 7, 2019
c874db3
Merge branch 'master' into eb/ch25288/utf-8
eli-darkly Jan 7, 2019
5b4b855
fix charset handling
eli-darkly Jan 7, 2019
7a7c273
add test for proxy support, remove obsolete property
eli-darkly Jan 7, 2019
1502e61
rm duplicate test code
eli-darkly Jan 7, 2019
4857842
change event sending to use Net::HTTP; completely remove Faraday
eli-darkly Jan 7, 2019
277a0ce
Merge branch 'master' into eb/ch22514/docs
eli-darkly Jan 7, 2019
d658715
implement dependency ordering for feature store data
eli-darkly Jan 9, 2019
ed302ad
fix incomplete test
eli-darkly Jan 9, 2019
34c7418
Merge branch 'master' into eb/ch28430/consul
eli-darkly Jan 10, 2019
230a7f8
Merge pull request #94 from launchdarkly/eb/ch29137/sse-gem
eli-darkly Jan 10, 2019
065a348
Merge branch 'master' of github.com:launchdarkly/ruby-client
eli-darkly Jan 11, 2019
9d33cda
Merge branch 'master' of github.com:launchdarkly/ruby-client into 5.4.x
eli-darkly Jan 11, 2019
f18794d
Merge branch '5.4.x'
eli-darkly Jan 11, 2019
6be20c3
Merge branch 'master' into eb/ch22514/docs
eli-darkly Jan 11, 2019
f8b8d34
Merge branch 'master' into eb/ch29197/dependency-order
eli-darkly Jan 11, 2019
f8997d4
Merge branch 'master' into eb/no-faraday
eli-darkly Jan 11, 2019
8f6a68a
Merge branch 'master' into eb/ch25288/utf-8
eli-darkly Jan 15, 2019
8436be4
use Hash.first
eli-darkly Jan 15, 2019
aee1a3b
Merge pull request #93 from launchdarkly/eb/ch29197/dependency-order
eli-darkly Jan 15, 2019
23606bc
Merge pull request #89 from launchdarkly/eb/ch25288/utf-8
eli-darkly Jan 15, 2019
e84fbe7
add test for Unicode in feature store serialization
eli-darkly Jan 15, 2019
dd61579
Merge branch 'master' into eb/ch28430/consul
eli-darkly Jan 15, 2019
8920923
fill in the rest of the Consul implementation
eli-darkly Jan 15, 2019
21c79fe
minor doc fixes
eli-darkly Jan 15, 2019
7ea110f
rm debugging
eli-darkly Jan 15, 2019
5136187
fix initialized check
eli-darkly Jan 15, 2019
46ebc1f
improve feature store tests + minor Redis fixes
eli-darkly Jan 15, 2019
2a4064c
Merge pull request #95 from launchdarkly/eb/feature-store-unicode
eli-darkly Jan 16, 2019
7691723
Merge pull request #96 from launchdarkly/eb/ch28430/consul
eli-darkly Jan 16, 2019
97ee2da
test fix: we can't use Unicode in flag keys anyway
eli-darkly Jan 16, 2019
3061a42
Merge branch 'master' into eb/better-feature-store-tests
eli-darkly Jan 16, 2019
be4523c
Merge branch 'master' into eb/ch22514/docs
eli-darkly Jan 16, 2019
621ef03
Merge pull request #90 from launchdarkly/eb/ch22514/docs
eli-darkly Jan 16, 2019
dbbd033
Merge branch 'master' into eb/better-feature-store-tests
eli-darkly Jan 16, 2019
21a505e
test fix
eli-darkly Jan 16, 2019
9dcbda8
Merge pull request #97 from launchdarkly/eb/better-feature-store-tests
eli-darkly Jan 17, 2019
784eb07
misc prerelease fixes
eli-darkly Jan 17, 2019
a6490eb
merge from public after release
LaunchDarklyCI Jan 18, 2019
e9b06c6
fix doc comments
eli-darkly Jan 18, 2019
7812be4
merge from public after release
LaunchDarklyCI Jan 18, 2019
6389a26
add YARD config so our docs show up correctly everywhere
eli-darkly Jan 18, 2019
3406a03
don't need markup-provider option
eli-darkly Jan 18, 2019
2175108
Merge pull request #98 from launchdarkly/eb/ch17821/yard-config
eli-darkly Jan 18, 2019
76fa71e
merge from public after release
LaunchDarklyCI Jan 18, 2019
207e8fd
Merge branch 'master' into eb/no-faraday
eli-darkly Jan 29, 2019
d38973a
rm obsolete proxy param
eli-darkly Jan 29, 2019
0405d3d
Merge pull request #92 from launchdarkly/eb/no-faraday
eli-darkly Jan 29, 2019
def22fc
remove net-http-persistent
eli-darkly Jan 31, 2019
f5ef9a4
fix concurrent-ruby usage that breaks on Windows
eli-darkly Jan 31, 2019
e725a2c
Merge pull request #99 from launchdarkly/eb/ch30984/no-http-persistent
eli-darkly Feb 1, 2019
d4081a9
Merge pull request #100 from launchdarkly/eb/ch30999/atomic-value
eli-darkly Feb 1, 2019
9b4d75b
add pipeline and clean up with with rm_rf instead of rm
hroederld Feb 4, 2019
09ee839
Merge pull request #101 from launchdarkly/hr/azure2
hroederld Feb 4, 2019
eb4ad97
fix highlight blocks
hroederld Feb 4, 2019
d1190f5
Merge pull request #102 from launchdarkly/hr/blockfix
hroederld Feb 4, 2019
4aa6272
Hr/azure3 (#103)
hroederld Feb 5, 2019
fd143d7
add dynamo (#104)
hroederld Feb 5, 2019
e8860ba
Merge branch 'master' of github.com:launchdarkly/ruby-client
eli-darkly Feb 14, 2019
6a20ff1
add experimentation event overrides for rules and fallthrough
eli-darkly Feb 22, 2019
12f541a
warn & don't send event if identify or track has no valid user
eli-darkly Feb 22, 2019
2800db8
include user in prereq flag events
eli-darkly Feb 22, 2019
47106d9
rm unnecessary logic
eli-darkly Feb 26, 2019
763a222
more factory methods
eli-darkly Feb 26, 2019
0d0086b
Merge pull request #107 from launchdarkly/eb/ch32577/prereq-event-user
eli-darkly Mar 1, 2019
0cbb8cd
Merge branch 'experiment' into eb/ch32304/experiment
eli-darkly Mar 2, 2019
70cacc9
Merge pull request #106 from launchdarkly/eb/ch32176-ch31956/bad-user
eli-darkly Mar 5, 2019
1c7a349
Merge pull request #105 from launchdarkly/eb/ch32304/experiment
eli-darkly Mar 5, 2019
4c23461
update readme to refer to docs
bwoskow-ld Mar 6, 2019
43d39c0
Merge pull request #108 from launchdarkly/bw/ch33438/update-readme-to…
bwoskow-ld Mar 8, 2019
0f91442
Merge commit '72ba633b4f9b34507b5aaad61d0e0541e83df3ad'
eli-darkly Mar 13, 2019
232f419
add Ruby 2.6.2 to CI
eli-darkly Mar 20, 2019
20d109b
fix missing require for net/http
eli-darkly Mar 20, 2019
9e218c2
Merge pull request #109 from launchdarkly/eb/ch34549/net-http-name-error
eli-darkly Mar 21, 2019
ef0f819
merge from public after release
LaunchDarklyCI Mar 21, 2019
651dc37
stringify built-in user attributes in events, and secondary key for e…
eli-darkly Mar 28, 2019
da15bdd
make const names consistent
eli-darkly Mar 28, 2019
ecf18b2
Merge pull request #110 from launchdarkly/eb/ch35206/secondary-string
eli-darkly Mar 29, 2019
3b6bde7
merge from public after release
LaunchDarklyCI Mar 29, 2019
37f9757
Merge pull request #111 from launchdarkly/eb/ch34550/ruby-2.6
eli-darkly Apr 9, 2019
260bd1b
support metric value with track()
eli-darkly Apr 13, 2019
703ffe5
update method description
eli-darkly Apr 17, 2019
8cd7615
Merge pull request #112 from launchdarkly/eb/ch32304/metric-value
eli-darkly Apr 17, 2019
4bc671b
applying markdown templates and updating repository url references
bwoskow-ld May 6, 2019
a56ee20
Cleaning up markdown files
bwoskow-ld May 7, 2019
2bafe25
Merge pull request #114 from launchdarkly/bw/ch36771/applying-markdow…
eli-darkly May 9, 2019
962e729
allow skipping database tests
eli-darkly May 9, 2019
e044e81
Merge pull request #116 from launchdarkly/eb/ch37610/skip-db-tests
eli-darkly May 9, 2019
ca2f8ed
merge from public after release
LaunchDarklyCI May 10, 2019
f32b9c6
Updating the package name (#115)
bwoskow-ld May 13, 2019
650d24c
Merge branch 'master' of github.com:launchdarkly/ruby-server-sdk
bwoskow-ld May 13, 2019
746ebda
merge from public after release
LaunchDarklyCI May 13, 2019
8defb30
bump ld-eventsource version for stream logging fix
eli-darkly Jul 11, 2019
e7d27e2
Merge pull request #117 from launchdarkly/eb/ch40932/ioerror-log
eli-darkly Jul 11, 2019
8707138
merge from public after release
LaunchDarklyCI Jul 11, 2019
ed0c110
Merge branch 'master' of github.com:launchdarkly/ruby-client
eli-darkly Jul 23, 2019
f1e5b38
merge from public after release
LaunchDarklyCI Jul 23, 2019
c1aeaa3
use YAML.safe_load
eli-darkly Jul 24, 2019
f8aac44
add unit test and temporarily revert fix to demonstrate failure
eli-darkly Jul 24, 2019
8f48060
restore fix
eli-darkly Jul 24, 2019
b5af713
Merge pull request #118 from launchdarkly/eb/ch44118/safe-yaml
eli-darkly Jul 24, 2019
8fa005f
add comment about not using FileDataSource in production
eli-darkly Jul 24, 2019
6a89b0f
Merge pull request #119 from launchdarkly/eb/file-data-warning
eli-darkly Jul 24, 2019
c1bcd04
merge from public after release
LaunchDarklyCI Jul 24, 2019
bb543ad
merge from public after release
LaunchDarklyCI Jul 25, 2019
963e4eb
drop events if inbox is full
eli-darkly Jul 25, 2019
26933ab
Merge pull request #120 from launchdarkly/eb/ch42975/event-bottleneck
eli-darkly Jul 26, 2019
039efed
merge from public after release
LaunchDarklyCI Aug 5, 2019
77acf35
Merge branch 'master' into experiment
eli-darkly Aug 19, 2019
f0581a0
update doc comment for track with metric_value
eli-darkly Aug 19, 2019
c4c2cc1
Merge branch 'master' of github.com:launchdarkly/ruby-client
eli-darkly Aug 19, 2019
c742fda
Merge branch 'master' of github.com:launchdarkly/ruby-server-sdk
eli-darkly Aug 19, 2019
f8622a7
Merge pull request #121 from launchdarkly/eb/ch32304/track-comment
eli-darkly Aug 19, 2019
162b0fe
Merge branch 'master' of github.com:launchdarkly/ruby-server-sdk
eli-darkly Aug 19, 2019
032cd5e
Merge branch 'master' into experiment
eli-darkly Aug 20, 2019
1b25d98
Merge branch 'master' of github.com:launchdarkly/ruby-server-sdk
eli-darkly Aug 20, 2019
e3bd340
Merge branch 'master' of github.com:launchdarkly/ruby-server-sdk
eli-darkly Aug 29, 2019
db27402
Merge branch 'master' of github.com:launchdarkly/ruby-server-sdk
eli-darkly Nov 1, 2019
62518e4
Merge branch 'master' of github.com:launchdarkly/ruby-server-sdk
bwoskow-ld Nov 7, 2019
7620721
don't let user fall outside of last bucket in rollout
eli-darkly Dec 30, 2019
fbf8eb9
refactor evaluation logic and move it out of the main namespace
eli-darkly Jan 2, 2020
45ea437
comments
eli-darkly Jan 2, 2020
575352c
fix type coercion behavior
eli-darkly Jan 2, 2020
62548d1
make type coercion behavior consistent with earlier versions for now
eli-darkly Jan 2, 2020
fd1d837
whitespace
eli-darkly Jan 2, 2020
3c52897
break up Evaluator tests further
eli-darkly Jan 3, 2020
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
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: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
launchdarkly-server-sdk (5.8.2)
launchdarkly-server-sdk (6.0.0)
concurrent-ruby (~> 1.1)
http (~> 4.4.1)
json (~> 2.3.1)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,3 @@ About LaunchDarkly
* [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides
* [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
* [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
* [Feature Flagging Guide](https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
workingDirectory: $(System.DefaultWorkingDirectory)
script: |
ruby -v
gem install bundler
gem install bundler:2.2.7
bundle install
mkdir rspec
bundle exec rspec --format progress --format RspecJunitFormatter -o ./rspec/rspec.xml spec
2 changes: 2 additions & 0 deletions lib/ldclient-rb/events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ def make_output_event(event)
out[:variation] = event[:variation] if event.has_key?(:variation)
out[:version] = event[:version] if event.has_key?(:version)
out[:prereqOf] = event[:prereqOf] if event.has_key?(:prereqOf)
out[:contextKind] = event[:contextKind] if event.has_key?(:contextKind)
if @inline_users || is_debug
out[:user] = process_user(event)
else
Expand Down Expand Up @@ -466,6 +467,7 @@ def make_output_event(event)
out[:userKey] = event[:user].nil? ? nil : event[:user][:key]
end
out[:metricValue] = event[:metricValue] if event.has_key?(:metricValue)
out[:contextKind] = event[:contextKind] if event.has_key?(:contextKind)
out
when "index"
{
Expand Down
22 changes: 22 additions & 0 deletions lib/ldclient-rb/impl/event_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def new_eval_event(flag, user, detail, default_value, prereq_of_flag = nil)
e[:debugEventsUntilDate] = flag[:debugEventsUntilDate] if flag[:debugEventsUntilDate]
e[:prereqOf] = prereq_of_flag[:key] if !prereq_of_flag.nil?
e[:reason] = detail.reason if add_experiment_data || @with_reasons
e[:contextKind] = context_to_context_kind(user) if !user.nil? && user[:anonymous]
e
end

Expand All @@ -43,6 +44,7 @@ def new_default_event(flag, user, default_value, reason)
e[:trackEvents] = true if flag[:trackEvents]
e[:debugEventsUntilDate] = flag[:debugEventsUntilDate] if flag[:debugEventsUntilDate]
e[:reason] = reason if @with_reasons
e[:contextKind] = context_to_context_kind(user) if !user.nil? && user[:anonymous]
e
end

Expand All @@ -55,6 +57,7 @@ def new_unknown_flag_event(key, user, default_value, reason)
default: default_value
}
e[:reason] = reason if @with_reasons
e[:contextKind] = context_to_context_kind(user) if !user.nil? && user[:anonymous]
e
end

Expand All @@ -66,6 +69,16 @@ def new_identify_event(user)
}
end

def new_alias_event(current_context, previous_context)
{
kind: 'alias',
key: current_context[:key],
contextKind: context_to_context_kind(current_context),
previousKey: previous_context[:key],
previousContextKind: context_to_context_kind(previous_context)
}
end

def new_custom_event(event_name, user, data, metric_value)
e = {
kind: 'custom',
Expand All @@ -74,11 +87,20 @@ def new_custom_event(event_name, user, data, metric_value)
}
e[:data] = data if !data.nil?
e[:metricValue] = metric_value if !metric_value.nil?
e[:contextKind] = context_to_context_kind(user) if !user.nil? && user[:anonymous]
e
end

private

def context_to_context_kind(user)
if !user.nil? && user[:anonymous]
return "anonymousUser"
else
return "user"
end
end

def is_experiment(flag, reason)
return false if !reason
case reason[:kind]
Expand Down
17 changes: 17 additions & 0 deletions lib/ldclient-rb/ldclient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,23 @@ def track(event_name, user, data = nil, metric_value = nil)
@event_processor.add_event(@event_factory_default.new_custom_event(event_name, user, data, metric_value))
end

#
# Associates a new and old user object for analytics purposes via an alias event.
#
# @param current_context [Hash] The current version of a user.
# @param previous_context [Hash] The previous version of a user.
# @return [void]
#
def alias(current_context, previous_context)
if !current_context || current_context[:key].nil? || !previous_context || previous_context[:key].nil?
@config.logger.warn("Alias called with nil user or nil user key!")
return
end
sanitize_user(current_context)
sanitize_user(previous_context)
@event_processor.add_event(@event_factory_default.new_alias_event(current_context, previous_context))
end

#
# Returns all feature flag values for the given user.
#
Expand Down
10 changes: 10 additions & 0 deletions spec/events_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,16 @@ def with_processor_and_sender(config)
end
end

it "queues alias event" do
with_processor_and_sender(default_config) do |ep, sender|
e = { kind: "alias", key: "a", contextKind: "user", previousKey: "b", previousContextKind: "user" }
ep.add_event(e)

output = flush_and_get_events(ep, sender)
expect(output).to contain_exactly(e)
end
end

it "treats nil value for custom the same as an empty hash" do
with_processor_and_sender(default_config) do |ep, sender|
user_with_nil_custom = { key: "userkey", custom: nil }
Expand Down
50 changes: 50 additions & 0 deletions spec/ldclient_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
}
}
end
let(:user_anonymous) do
{
key: "anonymous@test.com",
anonymous: true
}
end
let(:numeric_key_user) do
{
key: 33,
Expand Down Expand Up @@ -155,6 +161,24 @@ def event_processor
client.variation("key", nil, "default")
end

it "queues a feature event for an existing feature when user is anonymous" do
config.feature_store.init({ LaunchDarkly::FEATURES => {} })
config.feature_store.upsert(LaunchDarkly::FEATURES, feature_with_value)
expect(event_processor).to receive(:add_event).with(hash_including(
kind: "feature",
key: "key",
version: 100,
contextKind: "anonymousUser",
user: user_anonymous,
variation: 0,
value: "value",
default: "default",
trackEvents: true,
debugEventsUntilDate: 1000
))
client.variation("key", user_anonymous, "default")
end

it "queues a feature event for an existing feature when user key is nil" do
config.feature_store.init({ LaunchDarkly::FEATURES => {} })
config.feature_store.upsert(LaunchDarkly::FEATURES, feature_with_value)
Expand Down Expand Up @@ -455,6 +479,12 @@ def event_processor
client.track("custom_event_name", user, nil, 1.5)
end

it "includes contextKind with anonymous user" do
expect(event_processor).to receive(:add_event).with(hash_including(
kind: "custom", key: "custom_event_name", user: user_anonymous, metricValue: 2.2, contextKind: "anonymousUser"))
client.track("custom_event_name", user_anonymous, nil, 2.2)
end

it "sanitizes the user in the event" do
expect(event_processor).to receive(:add_event).with(hash_including(user: sanitized_numeric_key_user))
client.track("custom_event_name", numeric_key_user, nil)
Expand All @@ -473,6 +503,26 @@ def event_processor
end
end

describe '#alias' do
it "queues up an alias event" do
expect(event_processor).to receive(:add_event).with(hash_including(
kind: "alias", key: user[:key], contextKind: "user", previousKey: user_anonymous[:key], previousContextKind: "anonymousUser"))
client.alias(user, user_anonymous)
end

it "does not send an event, and logs a warning, if user is nil" do
expect(event_processor).not_to receive(:add_event)
expect(logger).to receive(:warn)
client.alias(nil, nil)
end

it "does not send an event, and logs a warning, if user key is nil" do
expect(event_processor).not_to receive(:add_event)
expect(logger).to receive(:warn)
client.alias(user_without_key, user_without_key)
end
end

describe '#identify' do
it "queues up an identify event" do
expect(event_processor).to receive(:add_event).with(hash_including(kind: "identify", key: user[:key], user: user))
Expand Down