launchdarkly-server-sdk 6.2.4 → 6.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/lib/ldclient-rb/config.rb +3 -3
  4. data/lib/ldclient-rb/integrations/dynamodb.rb +1 -1
  5. data/lib/ldclient-rb/integrations/redis.rb +1 -1
  6. data/lib/ldclient-rb/interfaces.rb +1 -1
  7. data/lib/ldclient-rb/ldclient.rb +5 -5
  8. data/lib/ldclient-rb/version.rb +1 -1
  9. metadata +6 -121
  10. data/.circleci/config.yml +0 -43
  11. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -37
  12. data/.github/ISSUE_TEMPLATE/config.yml +0 -5
  13. data/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  14. data/.github/pull_request_template.md +0 -21
  15. data/.gitignore +0 -16
  16. data/.hound.yml +0 -2
  17. data/.ldrelease/build-docs.sh +0 -18
  18. data/.ldrelease/circleci/linux/execute.sh +0 -18
  19. data/.ldrelease/circleci/mac/execute.sh +0 -18
  20. data/.ldrelease/circleci/template/build.sh +0 -19
  21. data/.ldrelease/circleci/template/gems-setup.sh +0 -16
  22. data/.ldrelease/circleci/template/prepare.sh +0 -17
  23. data/.ldrelease/circleci/template/publish.sh +0 -19
  24. data/.ldrelease/circleci/template/test.sh +0 -10
  25. data/.ldrelease/circleci/template/update-version.sh +0 -8
  26. data/.ldrelease/circleci/windows/execute.ps1 +0 -19
  27. data/.ldrelease/config.yml +0 -29
  28. data/.rspec +0 -2
  29. data/.rubocop.yml +0 -600
  30. data/.simplecov +0 -4
  31. data/CHANGELOG.md +0 -371
  32. data/CODEOWNERS +0 -1
  33. data/CONTRIBUTING.md +0 -37
  34. data/Gemfile +0 -3
  35. data/azure-pipelines.yml +0 -51
  36. data/docs/Makefile +0 -26
  37. data/docs/index.md +0 -9
  38. data/launchdarkly-server-sdk.gemspec +0 -43
  39. data/spec/config_spec.rb +0 -63
  40. data/spec/diagnostic_events_spec.rb +0 -165
  41. data/spec/evaluation_detail_spec.rb +0 -135
  42. data/spec/event_sender_spec.rb +0 -197
  43. data/spec/event_summarizer_spec.rb +0 -63
  44. data/spec/events_spec.rb +0 -607
  45. data/spec/expiring_cache_spec.rb +0 -76
  46. data/spec/feature_store_spec_base.rb +0 -213
  47. data/spec/file_data_source_spec.rb +0 -283
  48. data/spec/fixtures/feature.json +0 -37
  49. data/spec/fixtures/feature1.json +0 -36
  50. data/spec/fixtures/user.json +0 -9
  51. data/spec/flags_state_spec.rb +0 -81
  52. data/spec/http_util.rb +0 -132
  53. data/spec/impl/evaluator_bucketing_spec.rb +0 -216
  54. data/spec/impl/evaluator_clause_spec.rb +0 -55
  55. data/spec/impl/evaluator_operators_spec.rb +0 -141
  56. data/spec/impl/evaluator_rule_spec.rb +0 -128
  57. data/spec/impl/evaluator_segment_spec.rb +0 -125
  58. data/spec/impl/evaluator_spec.rb +0 -349
  59. data/spec/impl/evaluator_spec_base.rb +0 -75
  60. data/spec/impl/event_factory_spec.rb +0 -108
  61. data/spec/impl/model/serialization_spec.rb +0 -41
  62. data/spec/in_memory_feature_store_spec.rb +0 -12
  63. data/spec/integrations/consul_feature_store_spec.rb +0 -40
  64. data/spec/integrations/dynamodb_feature_store_spec.rb +0 -103
  65. data/spec/integrations/store_wrapper_spec.rb +0 -276
  66. data/spec/launchdarkly-server-sdk_spec.rb +0 -13
  67. data/spec/launchdarkly-server-sdk_spec_autoloadtest.rb +0 -9
  68. data/spec/ldclient_end_to_end_spec.rb +0 -157
  69. data/spec/ldclient_spec.rb +0 -635
  70. data/spec/newrelic_spec.rb +0 -5
  71. data/spec/polling_spec.rb +0 -120
  72. data/spec/redis_feature_store_spec.rb +0 -121
  73. data/spec/requestor_spec.rb +0 -209
  74. data/spec/segment_store_spec_base.rb +0 -95
  75. data/spec/simple_lru_cache_spec.rb +0 -24
  76. data/spec/spec_helper.rb +0 -9
  77. data/spec/store_spec.rb +0 -10
  78. data/spec/stream_spec.rb +0 -45
  79. data/spec/user_filter_spec.rb +0 -91
  80. data/spec/util_spec.rb +0 -17
  81. data/spec/version_spec.rb +0 -7
data/CHANGELOG.md DELETED
@@ -1,371 +0,0 @@
1
- # Change log
2
-
3
- All notable changes to the LaunchDarkly Ruby SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
4
-
5
- ## [6.2.3] - 2021-08-06
6
- ### Fixed:
7
- - Diagnostic events did not properly set the `usingProxy` attribute when a proxy was configured with the `HTTPS_PROXY` environment variable. ([#182](https://github.com/launchdarkly/ruby-server-sdk/issues/182))
8
-
9
- ## [6.2.2] - 2021-07-23
10
- ### Fixed:
11
- - Enabling debug logging in polling mode could cause polling to fail with a `NameError`. (Thanks, [mmurphy-notarize](https://github.com/launchdarkly/ruby-server-sdk/pull/180)!)
12
-
13
- ## [6.2.1] - 2021-07-15
14
- ### Changed:
15
- - If `variation` or `variation_detail` is called with a user object that has no `key` (an invalid condition that will always result in the default value being returned), the SDK now logs a `warn`-level message to alert you to this incorrect usage. This makes the Ruby SDK's logging behavior consistent with the other server-side LaunchDarkly SDKs. ([#177](https://github.com/launchdarkly/ruby-server-sdk/issues/177))
16
-
17
- ## [6.2.0] - 2021-06-17
18
- ### Added:
19
- - The SDK now supports the ability to control the proportion of traffic allocation to an experiment. This works in conjunction with a new platform feature now available to early access customers.
20
-
21
- ## [6.1.1] - 2021-05-27
22
- ### Fixed:
23
- - Calling `variation` with a nil user parameter is invalid, causing the SDK to log an error and return a fallback value, but the SDK was still sending an analytics event for this. An event without a user is meaningless and can't be processed by LaunchDarkly. This is now fixed so the SDK will not send one.
24
-
25
- ## [6.1.0] - 2021-02-04
26
- ### Added:
27
- - Added the `alias` method. This can be used to associate two user objects for analytics purposes by generating an alias event.
28
-
29
-
30
- ## [6.0.0] - 2021-01-26
31
- ### Added:
32
- - Added a `socket_factory` configuration option which can be used for socket creation by the HTTP client if provided. The value of `socket_factory` must be an object providing an `open(uri, timeout)` method and returning a connected socket.
33
-
34
- ### Changed:
35
- - Switched to the `http` gem instead of `socketry` (with a custom http client) for streaming, and instead of `Net::HTTP` for polling / events.
36
- - Dropped support for Ruby < version 2.5
37
- - Dropped support for JRuby < version 9.2
38
- - Switched the default polling domain from `app.launchdarkly.com` to `sdk.launchdarkly.com`.
39
-
40
- ## [5.8.2] - 2021-01-19
41
- ### Fixed:
42
- - Fixed a warning within the Redis integration when run with version 4.3 or later of the `redis` gem. (Thanks, [emancu](https://github.com/launchdarkly/ruby-server-sdk/pull/167)!)
43
-
44
-
45
- ## [5.8.1] - 2020-11-09
46
- ### Fixed:
47
- - Updated `json` gem to patch [CVE-2020-10663](https://nvd.nist.gov/vuln/detail/CVE-2020-10663).
48
-
49
-
50
- ## [5.8.0] - 2020-05-27
51
- ### Added:
52
- - In `LaunchDarkly::Integrations::Redis::new_feature_store`, if you pass in an externally created `pool`, you can now set the new option `pool_shutdown_on_close` to `false` to indicate that the SDK should _not_ shut down this pool if the SDK is shut down. The default behavior, as before, is that it will be shut down. (Thanks, [jacobthemyth](https://github.com/launchdarkly/ruby-server-sdk/pull/158)!)
53
-
54
- ## [5.7.4] - 2020-05-04
55
- ### Fixed:
56
- - Setting a user's `custom` property explicitly to `nil`, rather than omitting it entirely or setting it to an empty hash, would cause the SDK to log an error and drop the current batch of analytics events. Now, it will be treated the same as an empty hash. ([#147](https://github.com/launchdarkly/ruby-server-sdk/issues/147))
57
-
58
- ## [5.7.3] - 2020-04-27
59
- ### Changed:
60
- - Previously, installing the SDK in an environment that did not have `openssl` would cause a failure at build time. The SDK still requires `openssl` at runtime, but this check has been removed because it caused the `rake` problem mentioned below, and because `openssl` is normally bundled in modern Ruby versions.
61
-
62
- ### Fixed:
63
- - The `LDClient` constructor will fail immediately with a descriptive `ArgumentError` if you provide a `nil` SDK key in a configuration that requires an SDK key (that is, a configuration that _will_ require communicating with LaunchDarkly services). Previously, it would still fail, but without a clear error message. You are still allowed to omit the SDK key in an offline configuration. ([#154](https://github.com/launchdarkly/ruby-server-sdk/issues/154))
64
- - Removed a hidden dependency on `rake` which could cause your build to fail if you had a dependency on this SDK and you did not have `rake` installed. ([#155](https://github.com/launchdarkly/ruby-server-sdk/issues/155))
65
- - Previously a clause in a feature flag rule that used a string operator (such as "starts with") or a numeric operator (such as "greater than") could cause evaluation of the flag to completely fail and return a default value if the value on the right-hand side of the expression did not have the right data type-- for instance, "greater than" with a string value. The LaunchDarkly dashboard does not allow creation of such a rule, but it might be possible to do so via the REST API; the correct behavior of the SDK is to simply treat the expression as a non-match.
66
-
67
- ## [5.7.2] - 2020-03-27
68
- ### Fixed:
69
- - Fixed a bug in the 5.7.0 and 5.7.1 releases that caused analytics events not to be sent unless diagnostic events were explicitly disabled. This also caused an error to be logged: `undefined method started?`.
70
-
71
- ## [5.7.1] - 2020-03-18
72
- ### Fixed:
73
- - The backoff delay logic for reconnecting after a stream failure was broken so that if a failure occurred after a stream had been active for at least 60 seconds, retries would use _no_ delay, potentially causing a flood of requests and a spike in CPU usage. This bug was introduced in version 5.5.0 of the SDK.
74
-
75
- ## [5.7.0] - 2020-03-10
76
- ### Added:
77
- - The SDK now periodically sends diagnostic data to LaunchDarkly, describing the version and configuration of the SDK, the architecture and version of the runtime platform, and performance statistics. No credentials, hostnames, or other identifiable values are included. This behavior can be disabled with `Config.diagnostic_opt_out` or configured with `Config.diagnostic_recording_interval`.
78
- - New `Config` properties `wrapper_name` and `wrapper_version` allow a library that uses the Ruby SDK to identify itself for usage data if desired.
79
-
80
- ### Removed:
81
- - Removed an unused dependency on `rake`.
82
-
83
- ## [5.6.2] - 2020-01-15
84
- ### Fixed:
85
- - The SDK now specifies a uniquely identifiable request header when sending events to LaunchDarkly to ensure that events are only processed once, even if the SDK sends them two times due to a failed initial attempt.
86
-
87
- ## [5.6.1] - 2020-01-06
88
- ### Fixed:
89
- - In rare circumstances (depending on the exact data in the flag configuration, the flag's salt value, and the user properties), a percentage rollout could fail and return a default value, logging the error "Data inconsistency in feature flag ... variation/rollout object with no variation or rollout". This would happen if the user's hashed value fell exactly at the end of the last "bucket" (the last variation defined in the rollout). This has been fixed so that the user will get the last variation.
90
-
91
- ## [5.6.0] - 2019-08-28
92
- ### Added:
93
- - Added support for upcoming LaunchDarkly experimentation features. See `LDClient.track()`.
94
-
95
- ## [5.5.12] - 2019-08-05
96
- ### Fixed:
97
- - Under conditions where analytics events are being generated at an extremely high rate (for instance, if an application is evaluating a flag repeatedly in a tight loop on many threads), it was possible for the internal event processing logic to fall behind on processing the events, causing them to use more and more memory. The logic has been changed to drop events if necessary so that besides the existing limit on the number of events waiting to be sent to LaunchDarkly (`config.capacity`), the same limit also applies on the number of events that are waiting to be processed by the worker thread that decides whether or not to send them to LaunchDarkly. If that limit is exceeded, this warning message will be logged once: "Events are being produced faster than they can be processed; some events will be dropped". Under normal conditions this should never happen; this change is meant to avoid a concurrency bottleneck in applications that are already so busy that thread starvation is likely.
98
-
99
- ## [5.5.11] - 2019-07-24
100
- ### Fixed:
101
- - `FileDataSource` was using `YAML.load`, which has a known [security vulnerability](https://trailofbits.github.io/rubysec/yaml/index.html). This has been changed to use `YAML.safe_load`, which will refuse to parse any files that contain the `!` directives used in this type of attack. This issue does not affect any applications that do not use `FileDataSource` (which is meant for testing purposes, not production use). ([#139](https://github.com/launchdarkly/ruby-server-sdk/issues/139))
102
-
103
-
104
- ## [5.5.10] - 2019-07-24
105
- This release was an error; it is identical to 5.5.9.
106
-
107
- ## [5.5.9] - 2019-07-23
108
- ### Fixed:
109
- - Due to the gem name no longer being the same as the `require` name, Bundler autoloading was no longer working in versions 5.5.7 and 5.5.8 of the SDK. This has been fixed. (Thanks, [tonyta](https://github.com/launchdarkly/ruby-server-sdk/pull/137)!)
110
-
111
- ## [5.5.8] - 2019-07-11
112
- ### Fixed:
113
- - In streaming mode, depending on the Ruby version, calling `close` on the client could cause a misleading warning message in the log, such as `Unexpected error from event source: #<IOError: stream closed in another thread>`. ([#135](https://github.com/launchdarkly/ruby-server-sdk/issues/135))
114
-
115
- ## [5.5.7] - 2019-05-13
116
- ### Changed:
117
- - Changed the gem name from `ldclient-rb` to `launchdarkly-server-sdk`.
118
-
119
- There are no other changes in this release. Substituting `ldclient-rb` version 5.5.6 with `launchdarkly-server-sdk` version 5.5.7 will not affect functionality.
120
-
121
- ## [5.5.6] - 2019-05-08
122
- ### Fixed:
123
- - CI tests now include Ruby 2.6.x.
124
- - Running the SDK unit tests is now simpler, as the database integrations can be skipped. See `CONTRIBUTING.md`.
125
-
126
- # Note on future releases
127
-
128
- The LaunchDarkly SDK repositories are being renamed for consistency. This repository is now `ruby-server-sdk` rather than `ruby-client`.
129
-
130
- The gem name will also change. In the 5.5.6 release, it is still `ldclient-rb`; in all future releases, it will be `launchdarkly-server-sdk`. No further updates to the `ldclient-rb` gem will be published after this release.
131
-
132
-
133
- ## [5.5.5] - 2019-03-28
134
- ### Fixed:
135
- - Setting user attributes to non-string values when a string was expected would cause analytics events not to be processed. Also, in the case of the `secondary` attribute, this could cause evaluations to fail for a flag with a percentage rollout. The SDK will now convert attribute values to strings as needed. ([#131](https://github.com/launchdarkly/ruby-server-sdk/issues/131))
136
-
137
- ## [5.5.4] - 2019-03-29
138
- ### Fixed:
139
- - Fixed a missing `require` that could sometimes cause a `NameError` to be thrown when starting the client, depending on what other gems were installed. This bug was introduced in version 5.5.3. ([#129](https://github.com/launchdarkly/ruby-server-sdk/issues/129))
140
- - When an analytics event was generated for a feature flag because it is a prerequisite for another flag that was evaluated, the user data was being omitted from the event. ([#128](https://github.com/launchdarkly/ruby-server-sdk/issues/128))
141
- - If `track` or `identify` is called without a user, the SDK now logs a warning, and does not send an analytics event to LaunchDarkly (since it would not be processed without a user).
142
- - Added a link from the SDK readme to the guide regarding the client initialization.
143
-
144
- ## [5.5.3] - 2019-02-13
145
- ### Changed:
146
- - The SDK previously used the `faraday` and `net-http-persistent` gems for all HTTP requests other than streaming connections. Since `faraday` lacks a stable version and has a known issue with character encoding, and `net-http-persistent` is no longer maintained, these have both been removed. This should not affect any SDK functionality.
147
-
148
- ### Fixed:
149
- - The SDK was not usable in Windows because of `net-http-persistent`. That gem has been removed.
150
- - When running in Windows, the event-processing thread threw a `RangeError` due to a difference in the Windows implementation of `concurrent-ruby`. This has been fixed.
151
- - Windows incompatibilities were undetected before because we were not running a Windows CI job. We are now testing on Windows with Ruby 2.5.
152
-
153
- ## [5.5.2] - 2019-01-18
154
- ### Fixed:
155
- - Like 5.5.1, this release contains only documentation fixes. Implementation classes that are not part of the supported API are now hidden from the [generated documentation](https://www.rubydoc.info/gems/ldclient-rb).
156
-
157
-
158
- ## [5.5.1] - 2019-01-17
159
- ### Fixed:
160
- - Fixed several documentation comments that had the wrong parameter names. There are no other changes in this release; it's only to correct the documentation.
161
-
162
- ## [5.5.0] - 2019-01-17
163
- ### Added:
164
- - It is now possible to use Consul or DynamoDB as a persistent feature store, similar to the existing Redis integration. See the `LaunchDarkly::Integrations::Consul` and `LaunchDarkly::Integrations::DynamoDB` modules, and the reference guide [Using a persistent feature store](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store).
165
- - There is now a `LaunchDarkly::Integrations::Redis` module, which is the preferred method for creating a Redis feature store.
166
- - All of the database feature stores now support local caching not only for individual feature flag queries, but also for `all_flags_state`.
167
- - The `Config` property `data_source` is the new name for `update_processor` and `update_processor_factory`.
168
-
169
- ### Changed:
170
- - The implementation of the SSE protocol for streaming has been moved into a separate gem, [`ld-eventsource`](https://github.com/launchdarkly/ruby-eventsource). This has no effect on streaming functionality.
171
-
172
- ### Fixed:
173
- - Added or corrected a large number of documentation comments. All API classes and methods are now documented, and internal implementation details have been hidden from the documentation. You can view the latest documentation on [RubyDoc](https://www.rubydoc.info/gems/ldclient-rb).
174
- - Fixed a problem in the Redis feature store that would only happen under unlikely circumstances: trying to evaluate a flag when the LaunchDarkly client had not yet been fully initialized and the store did not yet have data in it, and then trying again when the client was still not ready but the store _did_ have data (presumably put there by another process). Previously, the second attempt would fail.
175
- - In polling mode, the SDK did not correctly handle non-ASCII Unicode characters in feature flag data. ([#90](https://github.com/launchdarkly/ruby-server-sdk/issues/90))
176
-
177
- ### Deprecated:
178
- - `RedisFeatureStore.new`. This implementation class may be changed or moved in the future; use `LaunchDarkly::Integrations::Redis::new_feature_store`.
179
- - `Config.update_processor` and `Config.update_processor_factory`; use `Config.data_source`.
180
-
181
- ## [5.4.3] - 2019-01-11
182
- ### Changed:
183
- - The SDK is now compatible with `net-http-persistent` 3.x. (Thanks, [CodingAnarchy](https://github.com/launchdarkly/ruby-server-sdk/pull/113)!)
184
-
185
- ## [5.4.2] - 2019-01-04
186
- ### Fixed:
187
- - Fixed overly specific dependency versions of `concurrent-ruby` and `semantic`. ([#115](https://github.com/launchdarkly/ruby-server-sdk/issues/115))
188
- - Removed obsolete dependencies on `hashdiff` and `thread_safe`.
189
-
190
- ## [5.4.1] - 2018-11-05
191
- ### Fixed:
192
- - Fixed a `LoadError` in `file_data_source.rb`, which was added in 5.4.0. (Thanks, [kbarrette](https://github.com/launchdarkly/ruby-server-sdk/pull/110)!)
193
-
194
-
195
- ## [5.4.0] - 2018-11-02
196
- ### Added:
197
- - It is now possible to inject feature flags into the client from local JSON or YAML files, replacing the normal LaunchDarkly connection. This would typically be for testing purposes. See `file_data_source.rb`.
198
-
199
- ### Fixed:
200
- - When shutting down an `LDClient`, if in polling mode, the client was using `Thread.raise` to make the polling thread stop sleeping. `Thread.raise` can cause unpredictable behavior in a worker thread, so it is no longer used.
201
-
202
- ## [5.3.0] - 2018-10-24
203
- ### Added:
204
- - The `all_flags_state` method now accepts a new option, `details_only_for_tracked_flags`, which reduces the size of the JSON representation of the flag state by omitting some metadata. Specifically, it omits any data that is normally used for generating detailed evaluation events if a flag does not have event tracking or debugging turned on.
205
-
206
- ### Fixed:
207
- - JSON data from `all_flags_state` is now slightly smaller even if you do not use the new option described above, because it omits the flag property for event tracking unless that property is true.
208
-
209
- ## [5.2.0] - 2018-08-29
210
- ### Added:
211
- - The new `LDClient` method `variation_detail` allows you to evaluate a feature flag (using the same parameters as you would for `variation`) and receive more information about how the value was calculated. This information is returned in an `EvaluationDetail` object, which contains both the result value and a "reason" object which will tell you, for instance, if the user was individually targeted for the flag or was matched by one of the flag's rules, or if the flag returned the default value due to an error.
212
-
213
- ### Fixed:
214
- - Evaluating a prerequisite feature flag did not produce an analytics event if the prerequisite flag was off.
215
-
216
-
217
- ## [5.1.0] - 2018-08-27
218
- ### Added:
219
- - The new `LDClient` method `all_flags_state()` should be used instead of `all_flags()` if you are passing flag data to the front end for use with the JavaScript SDK. It preserves some flag metadata that the front end requires in order to send analytics events correctly. Versions 2.5.0 and above of the JavaScript SDK are able to use this metadata, but the output of `all_flags_state()` will still work with older versions.
220
- - The `all_flags_state()` method also allows you to select only client-side-enabled flags to pass to the front end, by using the option `client_side_only: true`.
221
-
222
- ### Changed:
223
- - Unexpected exceptions are now logged at `ERROR` level, and exception stacktraces at `DEBUG` level. Previously, both were being logged at `WARN` level.
224
-
225
- ### Deprecated:
226
- - `LDClient.all_flags()`
227
-
228
-
229
- ## [5.0.1] - 2018-07-02
230
- ### Fixed:
231
- Fixed a regression in version 5.0.0 that could prevent the client from reconnecting if the stream connection was dropped by the server.
232
-
233
-
234
- ## [5.0.0] - 2018-06-26
235
- ### Changed:
236
- - The client no longer uses Celluloid for streaming I/O. Instead, it uses [socketry](https://github.com/socketry/socketry).
237
- - The client now treats most HTTP 4xx errors as unrecoverable: that is, after receiving such an error, it will not make any more HTTP requests for the lifetime of the client instance, in effect taking the client offline. This is because such errors indicate either a configuration problem (invalid SDK key) or a bug, which is not likely to resolve without a restart or an upgrade. This does not apply if the error is 400, 408, 429, or any 5xx error.
238
- - During initialization, if the client receives any of the unrecoverable errors described above, the client constructor will return immediately; previously it would continue waiting until a timeout. The `initialized?` method will return false in this case.
239
-
240
- ### Removed:
241
- - The SDK no longer supports Ruby versions below 2.2.6, or JRuby below 9.1.16.
242
-
243
- ## [4.0.0] - 2018-05-10
244
-
245
- ### Changed:
246
- - To reduce the network bandwidth used for analytics events, feature request events are now sent as counters rather than individual events, and user details are now sent only at intervals rather than in each event. These behaviors can be modified through the LaunchDarkly UI and with the new configuration option `inline_users_in_events`. For more details, see [Analytics Data Stream Reference](https://docs.launchdarkly.com/v2.0/docs/analytics-data-stream-reference).
247
-
248
- ### Removed:
249
- - JRuby 1.7 is no longer supported.
250
- - Greatly reduced the number of indirect gem dependencies by removing `moneta`, which was previously a requirement for the Redis feature store.
251
-
252
-
253
- ## [3.0.3] - 2018-03-23
254
- ## Fixed
255
- - In the Redis feature store, fixed a synchronization problem that could cause a feature flag update to be missed if several of them happened in rapid succession.
256
-
257
- ## [3.0.2] - 2018-03-06
258
- ## Fixed
259
- - Improved efficiency of logging by not constructing messages that won't be visible at the current log level. (Thanks, [julik](https://github.com/launchdarkly/ruby-server-sdk/pull/98)!)
260
-
261
-
262
- ## [3.0.1] - 2018-02-26
263
- ### Fixed
264
- - Fixed a bug that could prevent very large feature flags from being updated in streaming mode.
265
-
266
-
267
- ## [3.0.0] - 2018-02-22
268
- ### Added
269
- - Support for a new LaunchDarkly feature: reusable user segments.
270
-
271
- ### Changed
272
- - The feature store interface has been changed to support user segment data as well as feature flags. Existing code that uses `InMemoryFeatureStore` or `RedisFeatureStore` should work as before, but custom feature store implementations will need to be updated.
273
-
274
-
275
- ## [2.5.0] - 2018-02-12
276
-
277
- ## Added
278
- - Adds support for a future LaunchDarkly feature, coming soon: semantic version user attributes.
279
-
280
- ## Changed
281
- - It is now possible to compute rollouts based on an integer attribute of a user, not just a string attribute.
282
-
283
- ## [2.4.1] - 2018-01-23
284
- ## Changed
285
- - Reduce logging level for missing flags
286
- - Relax json and faraday dependencies
287
- ## Fixed
288
- - Wrap redis bulk updates in a transaction
289
- - Fixed documentation links
290
-
291
- ## [2.4.0] - 2018-01-12
292
- ## Changed
293
- - Will use feature store if already initialized even if connection to service could not be established. This is useful when flags have been initialized in redis.
294
- - Increase default and minimum polling interval to 30s
295
- - Strip out unknown top-level attributes
296
-
297
- ## [2.3.2] - 2017-12-02
298
-
299
- ### Fixed
300
- - Make sure redis store initializations are atomic
301
-
302
-
303
- ## [2.3.1] - 2017-11-16
304
-
305
- ### Changed
306
- - Include source code for changes described in 2.3.0
307
-
308
-
309
- ## [2.3.0] - 2017-11-16
310
- ## Added
311
- - Add `close` method to Ruby client to stop processing events
312
- - Add support for Redis feature store
313
- - Add support for LDD mode
314
- - Allow user to disable outgoing event stream.
315
-
316
- ## Changed
317
- - Stop retrying on 401 responses (due to bad sdk keys)
318
-
319
- ## [2.2.7] - 2017-07-26
320
- ## Changed
321
- - Update Readme to fix instructions on installing gem using command line
322
- - Cleaned up formatting on various files (Rubocop)
323
- ## [2.2.5] - 2017-05-08
324
- ## Changed
325
- - Added proxy support to streaming and http connections. Respects `HTTP_PROXY` and `http_proxy` environment variables as well as the `:proxy => protocol://user:pass@host` configuration parameter.
326
-
327
- ## [2.1.5] - 2017-03-28
328
- ## Changed
329
- - Updated changelog
330
-
331
- ## [2.1.1] - 2017-03-28
332
- ## Changed
333
- - Bumped nio4r to 2.0
334
-
335
- ## [2.0.6] - 2017-02-10
336
- ## Changed
337
- - Improved handling of http status codes that may not be integers.
338
-
339
- ## [2.0.5] - 2017-01-31
340
- ## Changed
341
- - Improved error handling when connected to flag update stream.
342
-
343
- ## [2.0.3] - 2016-10-21
344
- ## Fixed
345
- - Indirect stream events are now correctly processed
346
-
347
- ## [2.0.2] - 2016-08-08
348
- ## Changed
349
- - The default logger now logs at `info` level
350
-
351
- ## [2.0.0] - 2016-08-08
352
- ### Added
353
- - Support for multivariate feature flags. In addition to booleans, feature flags can now return numbers, strings, dictionaries, or arrays via the `variation` method.
354
- - New `all_flags` method returns all flag values for a specified user.
355
- - If streaming is disabled, the client polls for feature flag changes. If streaming is disabled, the client will default to polling LaunchDarkly every second for updates. The poll interval is configurable via `poll_interval`.
356
- - New `secure_mode_hash` function computes a hash suitable for the new LaunchDarkly JavaScript client's secure mode feature.
357
- - Support for extremely large feature flags. When a large feature flag changes, the stream will include a directive to fetch the updated flag.
358
-
359
- ### Changed
360
- - You can now initialize the LaunchDarkly client with an optional timeout (specified in seconds). This will block initialization until the client has finished bootstrapping and is able to serve feature flags.
361
- - The streaming implementation (`StreamProcessor`) uses [Celluloid](https://github.com/celluloid/celluloid) under the hood instead of [EventMachine](https://github.com/eventmachine/eventmachine). The dependency on EventMachine has been removed.
362
- - The `store` option has been renamed to `cache_store`.
363
- - Offline mode can no longer be set dynamically. Instead, at configuration time, the `offline` parameter can be set to put the client in offline mode. It is no longer possible to dynamically change whether the client is online and offline (via `set_online` and `set_offline`). Call `offline?` to determine whether or not the client is offline.
364
- - The `debug_stream` configuration option has been removed.
365
- - The `log_timings` configuration option has been removed.
366
-
367
- ### Deprecated
368
- - The `toggle` call has been deprecated in favor of `variation`.
369
-
370
- ### Removed
371
- - `update_user_flag_setting` has been removed. To change user settings, use the LaunchDarkly REST API.
data/CODEOWNERS DELETED
@@ -1 +0,0 @@
1
-
data/CONTRIBUTING.md DELETED
@@ -1,37 +0,0 @@
1
- Contributing to the LaunchDarkly Server-side SDK for Ruby
2
- ================================================
3
-
4
- LaunchDarkly has published an [SDK contributor's guide](https://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work. See below for additional information on how to contribute to this SDK.
5
-
6
- Submitting bug reports and feature requests
7
- ------------------
8
-
9
- The LaunchDarkly SDK team monitors the [issue tracker](https://github.com/launchdarkly/ruby-server-sdk/issues) in the SDK repository. Bug reports and feature requests specific to this SDK should be filed in this issue tracker. The SDK team will respond to all newly filed issues within two business days.
10
-
11
- Submitting pull requests
12
- ------------------
13
-
14
- We encourage pull requests and other contributions from the community. Before submitting pull requests, ensure that all temporary or unintended code is removed. Don't worry about adding reviewers to the pull request; the LaunchDarkly SDK team will add themselves. The SDK team will acknowledge all pull requests within two business days.
15
-
16
- Build instructions
17
- ------------------
18
-
19
- ### Prerequisites
20
-
21
- This SDK is built with [Bundler](https://bundler.io/). To install Bundler, run `gem install bundler`. You might need `sudo` to execute the command successfully.
22
-
23
- To install the runtime dependencies:
24
-
25
- ```
26
- bundle install
27
- ```
28
-
29
- ### Testing
30
-
31
- To run all unit tests:
32
-
33
- ```
34
- bundle exec rspec spec
35
- ```
36
-
37
- By default, the full unit test suite includes live tests of the integrations for Consul, DynamoDB, and Redis. Those tests expect you to have instances of all of those databases running locally. To skip them, set the environment variable `LD_SKIP_DATABASE_TESTS=1` before running the tests.
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
data/azure-pipelines.yml DELETED
@@ -1,51 +0,0 @@
1
- jobs:
2
- - job: build
3
- pool:
4
- vmImage: 'vs2017-win2016'
5
- steps:
6
- - task: PowerShell@2
7
- displayName: 'Setup Dynamo'
8
- inputs:
9
- targetType: inline
10
- workingDirectory: $(System.DefaultWorkingDirectory)
11
- script: |
12
- iwr -outf dynamo.zip https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.zip
13
- mkdir dynamo
14
- Expand-Archive -Path dynamo.zip -DestinationPath dynamo
15
- cd dynamo
16
- javaw -D"java.library.path=./DynamoDBLocal_lib" -jar DynamoDBLocal.jar
17
- - task: PowerShell@2
18
- displayName: 'Setup Consul'
19
- inputs:
20
- targetType: inline
21
- workingDirectory: $(System.DefaultWorkingDirectory)
22
- script: |
23
- iwr -outf consul.zip https://releases.hashicorp.com/consul/1.4.2/consul_1.4.2_windows_amd64.zip
24
- mkdir consul
25
- Expand-Archive -Path consul.zip -DestinationPath consul
26
- cd consul
27
- sc.exe create "Consul" binPath="$(System.DefaultWorkingDirectory)/consul/consul.exe agent -dev"
28
- sc.exe start "Consul"
29
- - task: PowerShell@2
30
- displayName: 'Setup Redis'
31
- inputs:
32
- targetType: inline
33
- workingDirectory: $(System.DefaultWorkingDirectory)
34
- script: |
35
- iwr -outf redis.zip https://github.com/MicrosoftArchive/redis/releases/download/win-3.0.504/Redis-x64-3.0.504.zip
36
- mkdir redis
37
- Expand-Archive -Path redis.zip -DestinationPath redis
38
- cd redis
39
- ./redis-server --service-install
40
- ./redis-server --service-start
41
- - task: PowerShell@2
42
- displayName: 'Setup SDK and Test'
43
- inputs:
44
- targetType: inline
45
- workingDirectory: $(System.DefaultWorkingDirectory)
46
- script: |
47
- ruby -v
48
- gem install bundler
49
- bundle install
50
- mkdir rspec
51
- bundle exec rspec --format progress --format RspecJunitFormatter -o ./rspec/rspec.xml spec
data/docs/Makefile DELETED
@@ -1,26 +0,0 @@
1
-
2
- ifeq ($(LD_RELEASE_VERSION),)
3
- TITLE=LaunchDarkly Ruby SDK
4
- else
5
- TITLE=LaunchDarkly Ruby SDK ($(LD_RELEASE_VERSION))
6
- endif
7
-
8
- .PHONY: dependencies html
9
-
10
- html: dependencies
11
- rm -rf ./build
12
- cd .. && yard doc \
13
- -o docs/build/html \
14
- --title "$(TITLE)" \
15
- --no-private \
16
- --markup markdown \
17
- --embed-mixins \
18
- -r docs/index.md \
19
- lib/*.rb \
20
- lib/**/*.rb \
21
- lib/**/**/*.rb \
22
- lib/**/**/**/*.rb
23
-
24
- dependencies:
25
- gem install --conservative yard
26
- gem install --conservative redcarpet # provides Markdown formatting
data/docs/index.md DELETED
@@ -1,9 +0,0 @@
1
- # LaunchDarkly Server-side SDK for Ruby
2
-
3
- This generated API documentation lists all types and methods in the SDK.
4
-
5
- The API documentation for the most recent SDK release is hosted on [GitHub Pages](https://launchdarkly.github.io/ruby-server-sdk). API documentation for current and past releases is hosted on [RubyDoc.info](https://www.rubydoc.info/gems/launchdarkly-server-sdk).
6
-
7
- Source code and readme: [GitHub](https://github.com/launchdarkly/ruby-server-sdk)
8
-
9
- SDK reference guide: [docs.launchdarkly.com](https://docs.launchdarkly.com/sdk/server-side/ruby)
@@ -1,43 +0,0 @@
1
- # coding: utf-8
2
-
3
- lib = File.expand_path("../lib", __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require "ldclient-rb/version"
6
-
7
- # rubocop:disable Metrics/BlockLength
8
- Gem::Specification.new do |spec|
9
- spec.name = "launchdarkly-server-sdk"
10
- spec.version = LaunchDarkly::VERSION
11
- spec.authors = ["LaunchDarkly"]
12
- spec.email = ["team@launchdarkly.com"]
13
- spec.summary = "LaunchDarkly SDK for Ruby"
14
- spec.description = "Official LaunchDarkly SDK for Ruby"
15
- spec.homepage = "https://github.com/launchdarkly/ruby-server-sdk"
16
- spec.license = "Apache-2.0"
17
-
18
- spec.files = `git ls-files -z`.split("\x0")
19
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
- spec.require_paths = ["lib"]
22
- spec.required_ruby_version = ">= 2.5.0"
23
-
24
- spec.add_development_dependency "aws-sdk-dynamodb", "~> 1.57"
25
- spec.add_development_dependency "bundler", "2.2.10"
26
- spec.add_development_dependency "rspec", "~> 3.10"
27
- spec.add_development_dependency "diplomat", "~> 2.4.2"
28
- spec.add_development_dependency "redis", "~> 4.2"
29
- spec.add_development_dependency "connection_pool", "~> 2.2.3"
30
- spec.add_development_dependency "rspec_junit_formatter", "~> 0.4"
31
- spec.add_development_dependency "timecop", "~> 0.9"
32
- spec.add_development_dependency "listen", "~> 3.3" # see file_data_source.rb
33
- spec.add_development_dependency "webrick", "~> 1.7"
34
- # required by dynamodb
35
- spec.add_development_dependency "oga", "~> 2.2"
36
-
37
- spec.add_runtime_dependency "semantic", "~> 1.6"
38
- spec.add_runtime_dependency "concurrent-ruby", "~> 1.1"
39
- spec.add_runtime_dependency "ld-eventsource", "2.0.1"
40
-
41
- spec.add_runtime_dependency "json", "~> 2.3"
42
- spec.add_runtime_dependency "http", ">= 4.4.0", "< 6.0.0"
43
- end
data/spec/config_spec.rb DELETED
@@ -1,63 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe LaunchDarkly::Config do
4
- subject { LaunchDarkly::Config }
5
- describe ".initialize" do
6
- it "can be initialized with default settings" do
7
- expect(subject).to receive(:default_capacity).and_return 1234
8
- expect(subject.new.capacity).to eq 1234
9
- end
10
- it "accepts custom arguments" do
11
- expect(subject).to_not receive(:default_capacity)
12
- expect(subject.new(capacity: 50).capacity).to eq 50
13
- end
14
- it "will chomp base_url and stream_uri" do
15
- uri = "https://test.launchdarkly.com"
16
- config = subject.new(base_uri: uri + "/")
17
- expect(config.base_uri).to eq uri
18
- end
19
- end
20
- describe "@base_uri" do
21
- it "can be read" do
22
- expect(subject.new.base_uri).to eq subject.default_base_uri
23
- end
24
- end
25
- describe "@events_uri" do
26
- it "can be read" do
27
- expect(subject.new.events_uri).to eq subject.default_events_uri
28
- end
29
- end
30
- describe "@stream_uri" do
31
- it "can be read" do
32
- expect(subject.new.stream_uri).to eq subject.default_stream_uri
33
- end
34
- end
35
- describe ".default_cache_store" do
36
- it "uses Rails cache if it is available" do
37
- rails = instance_double("Rails", cache: :cache)
38
- stub_const("Rails", rails)
39
- expect(subject.default_cache_store).to eq :cache
40
- end
41
- it "uses memory store if Rails is not available" do
42
- expect(subject.default_cache_store).to be_an_instance_of LaunchDarkly::ThreadSafeMemoryStore
43
- end
44
- end
45
- describe ".default_logger" do
46
- it "uses Rails logger if it is available" do
47
- rails = instance_double("Rails", logger: :logger)
48
- stub_const("Rails", rails)
49
- expect(subject.default_logger).to eq :logger
50
- end
51
- it "Uses logger if Rails is not available" do
52
- expect(subject.default_logger).to be_an_instance_of Logger
53
- end
54
- end
55
- describe ".poll_interval" do
56
- it "can be set to greater than the default" do
57
- expect(subject.new(poll_interval: 31).poll_interval).to eq 31
58
- end
59
- it "cannot be set to less than the default" do
60
- expect(subject.new(poll_interval: 29).poll_interval).to eq 30
61
- end
62
- end
63
- end