unleash 6.2.0.pre.alpha.0 → 6.2.0
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 +4 -4
- data/.github/workflows/pull_request.yml +0 -9
- data/CHANGELOG.md +8 -0
- data/lib/unleash/client.rb +1 -0
- data/lib/unleash/configuration.rb +7 -5
- data/lib/unleash/metrics_reporter.rb +4 -1
- data/lib/unleash/toggle_fetcher.rb +3 -1
- data/lib/unleash/util/http.rb +2 -2
- data/lib/unleash/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4370c29490f14c2ece25f21614db57de48b748cea8215da748d7635bd9d27bbf
|
4
|
+
data.tar.gz: eb2cdff78e994647a70fca33497d144f0e4366d75612670077c1689d6d37dcac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63a24dbca52e439f57c24a4c1f6894f172386ee898704e4570877c59b3a2b542e98eff9463b75a01fb54f5aa37ecab43e98b12119dbe03cf87be4e0e6792cae6
|
7
|
+
data.tar.gz: caa9b7b541d60b3ab99f5cbf270adac69211fe4424e80202ad12c4882f49295829a3aeb267cd7400fee5dbe393fcd355cc8db7fb9ebf419ee04a31dc1c0840ba
|
@@ -70,15 +70,6 @@ jobs:
|
|
70
70
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
71
71
|
flag-name: run-${{ matrix.test_number }}
|
72
72
|
parallel: true
|
73
|
-
- name: Notify Slack of pipeline completion
|
74
|
-
uses: 8398a7/action-slack@v3
|
75
|
-
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
|
76
|
-
with:
|
77
|
-
status: ${{ job.status }}
|
78
|
-
text: Built on ${{ matrix.os }} - Ruby ${{ matrix.ruby-version }}
|
79
|
-
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
|
80
|
-
env:
|
81
|
-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
82
73
|
|
83
74
|
finish:
|
84
75
|
needs: test
|
data/CHANGELOG.md
CHANGED
@@ -13,6 +13,14 @@ Note: These changes are not considered notable:
|
|
13
13
|
|
14
14
|
## [Unreleased]
|
15
15
|
|
16
|
+
## [6.2.0] - 2024-02-28
|
17
|
+
### Added
|
18
|
+
- unleash-interval header (#236)
|
19
|
+
- connectionId in metrics and registration payload (#236)
|
20
|
+
- default interval changed from 10s to 15s (#236)
|
21
|
+
- update Yggdrasil engine (#228)
|
22
|
+
- delta API configuration option (#228)
|
23
|
+
|
16
24
|
## [6.1.2] - 2024-01-30
|
17
25
|
### Fixed
|
18
26
|
- drop x- header prefix (#229)
|
data/lib/unleash/client.rb
CHANGED
@@ -116,6 +116,7 @@ module Unleash
|
|
116
116
|
{
|
117
117
|
'appName': Unleash.configuration.app_name,
|
118
118
|
'instanceId': Unleash.configuration.instance_id,
|
119
|
+
'connectionId': Unleash.configuration.connection_id,
|
119
120
|
'sdkVersion': "unleash-client-ruby:" + Unleash::VERSION,
|
120
121
|
'strategies': Unleash.strategies.known_strategies,
|
121
122
|
'started': Time.now.iso8601(Unleash::TIME_RESOLUTION),
|
@@ -23,6 +23,7 @@ module Unleash
|
|
23
23
|
:bootstrap_config,
|
24
24
|
:strategies,
|
25
25
|
:use_delta_api
|
26
|
+
attr_reader :connection_id
|
26
27
|
|
27
28
|
def initialize(opts = {})
|
28
29
|
validate_custom_http_headers!(opts[:custom_http_headers]) if opts.has_key?(:custom_http_headers)
|
@@ -51,14 +52,15 @@ module Unleash
|
|
51
52
|
end
|
52
53
|
|
53
54
|
def http_headers
|
54
|
-
{
|
55
|
+
headers = {
|
55
56
|
'User-Agent' => "UnleashClientRuby/#{Unleash::VERSION} #{RUBY_ENGINE}/#{RUBY_VERSION} [#{RUBY_PLATFORM}]",
|
56
57
|
'UNLEASH-INSTANCEID' => self.instance_id,
|
57
58
|
'UNLEASH-APPNAME' => self.app_name,
|
58
|
-
'
|
59
|
-
'UNLEASH-SDK' => "unleash-client-ruby:#{Unleash::VERSION}"
|
60
|
-
'Unleash-Client-Spec' => CLIENT_SPECIFICATION_VERSION
|
59
|
+
'Unleash-Client-Spec' => CLIENT_SPECIFICATION_VERSION,
|
60
|
+
'UNLEASH-SDK' => "unleash-client-ruby:#{Unleash::VERSION}"
|
61
61
|
}.merge!(generate_custom_http_headers)
|
62
|
+
headers['UNLEASH-CONNECTION-ID'] = @connection_id
|
63
|
+
headers
|
62
64
|
end
|
63
65
|
|
64
66
|
def fetch_toggles_uri
|
@@ -101,7 +103,7 @@ module Unleash
|
|
101
103
|
self.project_name = nil
|
102
104
|
self.disable_client = false
|
103
105
|
self.disable_metrics = false
|
104
|
-
self.refresh_interval =
|
106
|
+
self.refresh_interval = 15
|
105
107
|
self.metrics_interval = 60
|
106
108
|
self.timeout = 30
|
107
109
|
self.retry_limit = Float::INFINITY
|
@@ -23,6 +23,7 @@ module Unleash
|
|
23
23
|
'specVersion': Unleash::CLIENT_SPECIFICATION_VERSION,
|
24
24
|
'appName': Unleash.configuration.app_name,
|
25
25
|
'instanceId': Unleash.configuration.instance_id,
|
26
|
+
'connectionId': Unleash.configuration.connection_id,
|
26
27
|
'bucket': metrics || {}
|
27
28
|
}
|
28
29
|
end
|
@@ -37,7 +38,9 @@ module Unleash
|
|
37
38
|
return
|
38
39
|
end
|
39
40
|
|
40
|
-
|
41
|
+
headers = (Unleash.configuration.http_headers || {}).dup
|
42
|
+
headers.merge!({ 'UNLEASH-INTERVAL' => Unleash.configuration.metrics_interval.to_s })
|
43
|
+
response = Unleash::Util::Http.post(Unleash.configuration.client_metrics_uri, report.to_json, headers)
|
41
44
|
|
42
45
|
if ['200', '202'].include? response.code
|
43
46
|
Unleash.logger.debug "Report sent to unleash server successfully. Server responded with http code #{response.code}"
|
@@ -37,7 +37,9 @@ module Unleash
|
|
37
37
|
Unleash.logger.debug "fetch()"
|
38
38
|
return if Unleash.configuration.disable_client
|
39
39
|
|
40
|
-
|
40
|
+
headers = (Unleash.configuration.http_headers || {}).dup
|
41
|
+
headers.merge!({ 'UNLEASH-INTERVAL' => Unleash.configuration.refresh_interval.to_s })
|
42
|
+
response = Unleash::Util::Http.get(Unleash.configuration.fetch_toggles_uri, etag, headers)
|
41
43
|
|
42
44
|
if response.code == '304'
|
43
45
|
Unleash.logger.debug "No changes according to the unleash server, nothing to do."
|
data/lib/unleash/util/http.rb
CHANGED
@@ -12,10 +12,10 @@ module Unleash
|
|
12
12
|
http.request(request)
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.post(uri, body)
|
15
|
+
def self.post(uri, body, headers_override = nil)
|
16
16
|
http = http_connection(uri)
|
17
17
|
|
18
|
-
request = Net::HTTP::Post.new(uri.request_uri, http_headers)
|
18
|
+
request = Net::HTTP::Post.new(uri.request_uri, http_headers(nil, headers_override))
|
19
19
|
request.body = body
|
20
20
|
|
21
21
|
http.request(request)
|
data/lib/unleash/version.rb
CHANGED
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: 6.2.0
|
4
|
+
version: 6.2.0
|
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: 2025-
|
11
|
+
date: 2025-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yggdrasil-engine
|
@@ -216,7 +216,7 @@ homepage: https://github.com/unleash/unleash-client-ruby
|
|
216
216
|
licenses:
|
217
217
|
- Apache-2.0
|
218
218
|
metadata: {}
|
219
|
-
post_install_message:
|
219
|
+
post_install_message:
|
220
220
|
rdoc_options: []
|
221
221
|
require_paths:
|
222
222
|
- lib
|
@@ -231,8 +231,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
231
|
- !ruby/object:Gem::Version
|
232
232
|
version: '0'
|
233
233
|
requirements: []
|
234
|
-
rubygems_version: 3.5.
|
235
|
-
signing_key:
|
234
|
+
rubygems_version: 3.5.22
|
235
|
+
signing_key:
|
236
236
|
specification_version: 4
|
237
237
|
summary: Unleash feature toggle client.
|
238
238
|
test_files: []
|