unleash 4.4.3 → 4.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 910ddad70479cae68918b7400b4ddc6d0c71f9448d8524072c318d6c353c4f52
4
- data.tar.gz: 1d75ed31736627ea30c2bbc9be7903c9dfa19dc4691c07de885dd87a8eb94c85
3
+ metadata.gz: f59bcc61a5b2adc71f82f31ee80d02e8957854b86b85147fa33ad1f8bd3ee3ab
4
+ data.tar.gz: 691a79a57aba051ab5111d71a038e6c8f2d21ee747ee39fdb6676108fc1ef777
5
5
  SHA512:
6
- metadata.gz: aec46ef764fcb138d34baa7c6832ff1865be4dac1f6f004ab928e8447ecde701ec82bf2069c69e62b2404706bf029c1743a3dc2322b5e7409135aba498cdf80e
7
- data.tar.gz: d1a529a53cbd934c4aae24919352fc670b27b8cb0a9ccb2bde20deafa3eb3adf679e7c49ced246258547f68a400a10a1da214bc07a19e153ffb0af60fcea8961
6
+ metadata.gz: c6d4c9efc598b2eae5958c7c68c362832988d6ed8cc4f51d47e0ede588b37599c0d104d4a7c08060761564653bdb68d1c6a20dedafc7b6d3bbb22c489ac8c4ec
7
+ data.tar.gz: 003b0d345c5f1ccc22361ddce4213e40054ec57a7e3404ca8d99ce3b120fb072b506a75f1fe64053e7b57c67688ed0b6aa6532dd99f3f7bfaa729c520d2c290c
data/CHANGELOG.md ADDED
@@ -0,0 +1,108 @@
1
+
2
+ # Changelog
3
+
4
+ All notable changes to this project will be documented in this file.
5
+
6
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
7
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
+
9
+ Note: These changes are not considered notable:
10
+ - build
11
+ - documentation
12
+ - dependencies
13
+
14
+ ## [Unreleased]
15
+
16
+ ## [4.4.4] - 2023-07-05
17
+ ### Fixed
18
+ - flexible rollout strategy without context (#146)
19
+ - The flexible rollout strategy should evaluate default and random stickiness even if context is not provided.
20
+
21
+ ## [4.4.3] - 2023-06-14
22
+ ### Added
23
+ - Add Context#to_h method (#136)
24
+
25
+ ### Fixed
26
+ - Bootstrapped variants now work when client is disabled (#138)
27
+ - Variant metrics are now sent correctly to Unleash. Fixed a typo in the payload name. (#145)
28
+
29
+ ### Changed
30
+ - Automatically disable metrics/MetricsReporter when client is disabled (#139) (#140)
31
+
32
+ ## [4.4.2] - 2023-01-05
33
+ ### Added
34
+ - Add Client#disabled? method (#130)
35
+
36
+ ## [4.4.1] - 2022-12-07
37
+ ### Fixed
38
+ - exception no longer bubbles up in constraints when context is nil (#127)
39
+ - variants metrics did count toggles correctly (#126)
40
+ - prevent race condition when manipulating metrics data (#122)
41
+ - allow passing user_id as integer (#119)
42
+
43
+ ## [4.4.0] - 2022-09-19
44
+ ### Added
45
+ - Allow custom strategies (#96)
46
+ - Global segments (#114)
47
+
48
+ ### Fixed
49
+ - Initializing client configuration from constructor (#117)
50
+ - Support int context in set comparison (#115)
51
+
52
+ ## [4.3.0] - 2023-07-14
53
+ ### Added
54
+ - dynamic http headers via Proc or Lambda (#107)
55
+
56
+ ### Fixed
57
+ - Fixed ToggleFetcher#save! to close opened files on failure. (#97)
58
+
59
+ ### Changed
60
+ - Refactored ToggleFetcher#read! (#106)
61
+
62
+ ## [4.2.1] - 2022-03-29
63
+ ### Fixed
64
+ - correct logic for default values on feature toggles so toggle value respected when toggle exists and default is true (#93)
65
+
66
+ ## [4.2.0] - 2022-03-18
67
+ ### Added
68
+ - Advanced constraints operators (#92)
69
+
70
+ ### Changed
71
+ - Default to the client never giving up trying to reach the server even after repeated failures (#91)
72
+
73
+ ## [4.1.0] - 2022-02-11
74
+ ### Added
75
+ - feat: Implement custom bootstrapping on startup (#88)
76
+ - feat: add support for cidr in `RemoteAddress` strategy (#77)
77
+
78
+ ### Changed
79
+ - default values for `metrics_interval` to `60s` and `retry_limit` to `5` (#78)
80
+
81
+ ## [4.0.0] - 2021-12-16
82
+ ### Added
83
+ - Support for projects query (requires unleash 4.x) (#38)
84
+ - Allow passing blocks to is_enabled? to determine default_result (#33)
85
+ - Implement custom stickiness (#69)
86
+ - Allow using custom_http_headers from the CLI utility (#75)
87
+
88
+ ### Fixed
89
+ - Allow context to correctly resolve camelCase property values (#74)
90
+ - Avoid unlikely situation of config changing under the read operation due to backup path file being incorrectly set (#63)
91
+
92
+ ### Changed
93
+ - change how we handle the server api url (avoid double slashes in urls used for API calls.)
94
+ - default values: refresh_interval => 10, metrics_interval=> 30 (#59)
95
+ - changed metrics reporting behavior (#66)
96
+ - only send metrics if there is data to send. (#58)
97
+ - in Client#get_variant() allow context and fallback_variant as nil (#51)
98
+
99
+ [unreleased]: https://git1hub.com/unleash/unleash-client-ruby/compare/v4.4.3...HEAD
100
+ [4.4.3]: https://github.com/unleash/unleash-client-ruby/compare/v4.4.2...v4.4.3
101
+ [4.4.2]: https://github.com/unleash/unleash-client-ruby/compare/v4.4.1...v4.4.2
102
+ [4.4.1]: https://github.com/unleash/unleash-client-ruby/compare/v4.4.0...v4.4.1
103
+ [4.4.0]: https://github.com/unleash/unleash-client-ruby/compare/v4.3.0...v4.4.0
104
+ [4.3.0]: https://github.com/unleash/unleash-client-ruby/compare/v4.2.1...v4.3.0
105
+ [4.2.1]: https://github.com/unleash/unleash-client-ruby/compare/v4.2.0...v4.2.1
106
+ [4.2.0]: https://github.com/unleash/unleash-client-ruby/compare/v4.1.0...v4.2.0
107
+ [4.1.0]: https://github.com/unleash/unleash-client-ruby/compare/v4.0.0...v4.1.0
108
+ [4.0.0]: https://github.com/unleash/unleash-client-ruby/compare/v3.2.5...v4.0.0
data/README.md CHANGED
@@ -25,7 +25,7 @@ Leverage the [Unleash Server](https://github.com/Unleash/unleash) for powerful f
25
25
  Add this line to your application's Gemfile:
26
26
 
27
27
  ```ruby
28
- gem 'unleash', '~> 4.4.0'
28
+ gem 'unleash', '~> 4.4.4'
29
29
  ```
30
30
 
31
31
  And then execute:
@@ -533,11 +533,25 @@ To run the Ruby SDK against this test suite, you'll need to have a copy on your
533
533
  After doing this, `rake spec` will also run the client specification tests.
534
534
 
535
535
  To install this gem onto your local machine, run `bundle exec rake install`.
536
- To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
536
+
537
+ ## Releasing
538
+
539
+ Choose a new version number following [Semantic Versioning](https://semver.org/spec/v2.0.0.html) semantics and then:
540
+
541
+ - update the version number in [./lib/unleash/version.rb](./lib/unleash/version.rb),
542
+ - if a major or minor version bump, update the [Installation section](#Installation) in [README.md](README.md)
543
+ - update [CHANGELOG.md](CHANGELOG.md) following the format on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
544
+ - commit with message `chore: bump version to x.y.z`
545
+ - then run `bundle exec rake release`
546
+ - This will create a git tag for the version on the current commit,
547
+ - push git commits and tags to origin and
548
+ - push the `.gem` file to [rubygems.org](https://rubygems.org)
537
549
 
538
550
 
539
551
  ## Contributing
540
552
 
541
553
  Bug reports and pull requests are welcome on GitHub at https://github.com/unleash/unleash-client-ruby.
542
554
 
555
+ Be sure to run both `bundle exec rspec` and `bundle exec rubocop` in your branch before creating a pull request.
556
+
543
557
  Please include tests with any pull requests, to avoid regressions.
@@ -10,9 +10,10 @@ module Unleash
10
10
  # need: params['percentage']
11
11
  def is_enabled?(params = {}, context = nil)
12
12
  return false unless params.is_a?(Hash)
13
- return false unless context.instance_of?(Unleash::Context)
14
13
 
15
14
  stickiness = params.fetch('stickiness', 'default')
15
+ return false if context_invalid?(stickiness, context)
16
+
16
17
  stickiness_id = resolve_stickiness(stickiness, context)
17
18
 
18
19
  begin
@@ -32,6 +33,12 @@ module Unleash
32
33
 
33
34
  private
34
35
 
36
+ def context_invalid?(stickiness, context)
37
+ return false if ['random', 'default'].include?(stickiness)
38
+
39
+ !context.instance_of?(Unleash::Context)
40
+ end
41
+
35
42
  def random
36
43
  Random.rand(0..100)
37
44
  end
@@ -41,7 +48,9 @@ module Unleash
41
48
  when 'random'
42
49
  random
43
50
  when 'default'
44
- context.user_id || context.session_id || random
51
+ return random unless context.instance_of?(Unleash::Context)
52
+
53
+ context&.user_id || context&.session_id || random
45
54
  else
46
55
  begin
47
56
  context.get_by_name(stickiness)
@@ -1,3 +1,3 @@
1
1
  module Unleash
2
- VERSION = "4.4.3".freeze
2
+ VERSION = "4.4.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unleash
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.3
4
+ version: 4.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renato Arruda
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-14 00:00:00.000000000 Z
11
+ date: 2023-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: murmurhash3
@@ -152,6 +152,7 @@ files:
152
152
  - ".gitignore"
153
153
  - ".rspec"
154
154
  - ".rubocop.yml"
155
+ - CHANGELOG.md
155
156
  - Gemfile
156
157
  - LICENSE
157
158
  - README.md
@@ -199,7 +200,7 @@ homepage: https://github.com/unleash/unleash-client-ruby
199
200
  licenses:
200
201
  - Apache-2.0
201
202
  metadata: {}
202
- post_install_message:
203
+ post_install_message:
203
204
  rdoc_options: []
204
205
  require_paths:
205
206
  - lib
@@ -214,8 +215,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
215
  - !ruby/object:Gem::Version
215
216
  version: '0'
216
217
  requirements: []
217
- rubygems_version: 3.4.10
218
- signing_key:
218
+ rubygems_version: 3.3.15
219
+ signing_key:
219
220
  specification_version: 4
220
221
  summary: Unleash feature toggle client.
221
222
  test_files: []