unleash 3.2.2 → 4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/add-to-project.yml +14 -0
- data/.github/workflows/pull_request.yml +79 -0
- data/.gitignore +5 -1
- data/.rubocop.yml +114 -6
- data/README.md +263 -27
- data/bin/unleash-client +15 -5
- data/examples/bootstrap.rb +51 -0
- data/examples/default-toggles.json +42 -0
- data/examples/simple.rb +5 -4
- data/lib/unleash/bootstrap/configuration.rb +25 -0
- data/lib/unleash/bootstrap/handler.rb +22 -0
- data/lib/unleash/bootstrap/provider/base.rb +14 -0
- data/lib/unleash/bootstrap/provider/from_file.rb +14 -0
- data/lib/unleash/bootstrap/provider/from_url.rb +19 -0
- data/lib/unleash/client.rb +27 -17
- data/lib/unleash/configuration.rb +41 -19
- data/lib/unleash/constraint.rb +88 -10
- data/lib/unleash/context.rb +3 -2
- data/lib/unleash/feature_toggle.rb +26 -19
- data/lib/unleash/metrics_reporter.rb +18 -4
- data/lib/unleash/scheduled_executor.rb +5 -2
- data/lib/unleash/strategy/application_hostname.rb +1 -0
- data/lib/unleash/strategy/flexible_rollout.rb +5 -5
- data/lib/unleash/strategy/remote_address.rb +17 -1
- data/lib/unleash/toggle_fetcher.rb +51 -42
- data/lib/unleash/util/http.rb +7 -6
- data/lib/unleash/variant_definition.rb +5 -4
- data/lib/unleash/version.rb +1 -1
- data/lib/unleash.rb +0 -5
- data/unleash-client.gemspec +3 -2
- metadata +35 -13
- data/.travis.yml +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f05a01bdf6013184b6948fb5c38f6b1da1cde9d18f9a0eeecd69b54cbed8ff18
|
4
|
+
data.tar.gz: 6343830fd945d00decd331acade205d605e0d496ed1d4afd4736affcb2f538ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ac4a4b89f787b5ae27acda02865def0eb68f261da10b83c01a6b34f6706b1b29443375eb82418b9834db555fbe54c1a1dfe49e9bf4c761556145edce88f76c9
|
7
|
+
data.tar.gz: c7a2332c7e6ab54872b08432af4c5c2cf092b7586664eb0267e45e416fb9a72c46246dd6cdedf68b4a9421678e4cb9f9507365e40fc5c2113b9fba8e703a19dd
|
@@ -0,0 +1,79 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
pull_request:
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
lint:
|
9
|
+
name: RuboCop
|
10
|
+
timeout-minutes: 30
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- name: Set up Ruby
|
15
|
+
uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: "2.7"
|
18
|
+
bundler-cache: true
|
19
|
+
- name: Run RuboCop
|
20
|
+
run: bundle exec rubocop
|
21
|
+
|
22
|
+
test:
|
23
|
+
runs-on: ${{ matrix.os }}-latest
|
24
|
+
|
25
|
+
strategy:
|
26
|
+
matrix:
|
27
|
+
os:
|
28
|
+
- ubuntu
|
29
|
+
- macos
|
30
|
+
ruby-version:
|
31
|
+
- jruby-9.2
|
32
|
+
- jruby-9.3
|
33
|
+
- 3.1
|
34
|
+
- '3.0'
|
35
|
+
- 2.7
|
36
|
+
- 2.6
|
37
|
+
- 2.5
|
38
|
+
|
39
|
+
steps:
|
40
|
+
- uses: actions/checkout@v2
|
41
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
42
|
+
uses: ruby/setup-ruby@v1
|
43
|
+
with:
|
44
|
+
bundler-cache: true
|
45
|
+
ruby-version: ${{ matrix.ruby-version }}
|
46
|
+
- name: Install dependencies
|
47
|
+
run: bundle install
|
48
|
+
- name: Download test cases
|
49
|
+
run: git clone --depth 5 --branch v4.1.0 https://github.com/Unleash/client-specification.git client-specification
|
50
|
+
- name: Run tests
|
51
|
+
run: bundle exec rake
|
52
|
+
env:
|
53
|
+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
54
|
+
- name: Coveralls Parallel
|
55
|
+
uses: coverallsapp/github-action@master
|
56
|
+
with:
|
57
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
58
|
+
flag-name: run-${{ matrix.test_number }}
|
59
|
+
parallel: true
|
60
|
+
- name: Notify Slack of pipeline completion
|
61
|
+
uses: 8398a7/action-slack@v3
|
62
|
+
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
|
63
|
+
with:
|
64
|
+
status: ${{ job.status }}
|
65
|
+
text: Built on ${{ matrix.os }} - Ruby ${{ matrix.ruby-version }}
|
66
|
+
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
|
67
|
+
env:
|
68
|
+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
69
|
+
|
70
|
+
finish:
|
71
|
+
needs: test
|
72
|
+
runs-on: ubuntu-latest
|
73
|
+
steps:
|
74
|
+
- name: Coveralls Finished
|
75
|
+
uses: coverallsapp/github-action@master
|
76
|
+
with:
|
77
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
78
|
+
parallel-finished: true
|
79
|
+
|
data/.gitignore
CHANGED
@@ -1,15 +1,19 @@
|
|
1
1
|
/.bundle/
|
2
2
|
/.yardoc
|
3
|
-
/Gemfile.lock
|
4
3
|
/_yardoc/
|
5
4
|
/coverage/
|
6
5
|
/doc/
|
7
6
|
/pkg/
|
8
7
|
/spec/reports/
|
9
8
|
/tmp/
|
9
|
+
/vendor
|
10
|
+
|
11
|
+
# IntelliJ
|
12
|
+
.idea/
|
10
13
|
|
11
14
|
# rspec failure tracking
|
12
15
|
.rspec_status
|
16
|
+
Gemfile.lock
|
13
17
|
|
14
18
|
# Clone of the client-specification
|
15
19
|
/client-specification/
|
data/.rubocop.yml
CHANGED
@@ -7,24 +7,24 @@ Naming/PredicateName:
|
|
7
7
|
AllowedMethods:
|
8
8
|
- is_enabled?
|
9
9
|
|
10
|
+
|
10
11
|
Metrics/ClassLength:
|
11
|
-
Max:
|
12
|
+
Max: 125
|
12
13
|
Layout/LineLength:
|
13
14
|
Max: 140
|
14
15
|
Metrics/MethodLength:
|
15
16
|
Max: 20
|
16
17
|
Metrics/BlockLength:
|
17
|
-
Max:
|
18
|
+
Max: 110
|
18
19
|
Exclude:
|
19
|
-
- 'spec
|
20
|
-
- 'spec/unleash/feature_toggle_spec.rb'
|
20
|
+
- 'spec/**/*.rb'
|
21
21
|
|
22
22
|
Metrics/AbcSize:
|
23
|
-
Max:
|
23
|
+
Max: 30
|
24
24
|
Metrics/CyclomaticComplexity:
|
25
25
|
Max: 9
|
26
26
|
Metrics/PerceivedComplexity:
|
27
|
-
Max:
|
27
|
+
Max: 10
|
28
28
|
|
29
29
|
Style/Documentation:
|
30
30
|
Enabled: false
|
@@ -51,6 +51,12 @@ Style/HashTransformKeys:
|
|
51
51
|
Enabled: true
|
52
52
|
Style/HashTransformValues:
|
53
53
|
Enabled: true
|
54
|
+
Style/EmptyElse:
|
55
|
+
Exclude:
|
56
|
+
- 'lib/unleash/strategy/flexible_rollout.rb'
|
57
|
+
|
58
|
+
Style/DoubleNegation:
|
59
|
+
Enabled: false
|
54
60
|
|
55
61
|
Style/IfInsideElse:
|
56
62
|
Exclude:
|
@@ -60,6 +66,61 @@ Style/Next:
|
|
60
66
|
Exclude:
|
61
67
|
- 'lib/unleash/scheduled_executor.rb'
|
62
68
|
|
69
|
+
|
70
|
+
Style/AccessorGrouping:
|
71
|
+
Enabled: true
|
72
|
+
Style/BisectedAttrAccessor:
|
73
|
+
Enabled: true
|
74
|
+
Style/CaseLikeIf:
|
75
|
+
Enabled: true
|
76
|
+
#Style/ClassEqualityComparison:
|
77
|
+
# Enabled: true
|
78
|
+
Style/CombinableLoops:
|
79
|
+
Enabled: true
|
80
|
+
Style/ExplicitBlockArgument:
|
81
|
+
Enabled: true
|
82
|
+
Style/ExponentialNotation:
|
83
|
+
Enabled: true
|
84
|
+
#Style/GlobalStdStream:
|
85
|
+
# Enabled: true
|
86
|
+
Style/HashAsLastArrayItem:
|
87
|
+
Enabled: true
|
88
|
+
Style/HashLikeCase:
|
89
|
+
Enabled: true
|
90
|
+
Style/KeywordParametersOrder:
|
91
|
+
Enabled: true
|
92
|
+
#Style/OptionalBooleanParameter:
|
93
|
+
# Enabled: false
|
94
|
+
Style/RedundantAssignment:
|
95
|
+
Enabled: true
|
96
|
+
Style/RedundantFetchBlock:
|
97
|
+
Enabled: true
|
98
|
+
Style/RedundantFileExtensionInRequire:
|
99
|
+
Enabled: true
|
100
|
+
Style/RedundantRegexpCharacterClass:
|
101
|
+
Enabled: true
|
102
|
+
Style/RedundantRegexpEscape:
|
103
|
+
Enabled: true
|
104
|
+
Style/RedundantSelfAssignment:
|
105
|
+
Enabled: true
|
106
|
+
Style/SingleArgumentDig:
|
107
|
+
Enabled: true
|
108
|
+
Style/SlicingWithRange:
|
109
|
+
Enabled: true
|
110
|
+
Style/SoleNestedConditional:
|
111
|
+
Enabled: true
|
112
|
+
Style/StringConcatenation:
|
113
|
+
Enabled: false
|
114
|
+
Style/TrailingCommaInHashLiteral:
|
115
|
+
Enabled: true
|
116
|
+
# EnforcedStyleForMultiline: consistent_comma
|
117
|
+
|
118
|
+
Layout/BeginEndAlignment:
|
119
|
+
Enabled: true
|
120
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
121
|
+
Enabled: true
|
122
|
+
Layout/SpaceAroundMethodCallOperator:
|
123
|
+
Enabled: true
|
63
124
|
Layout/MultilineMethodCallIndentation:
|
64
125
|
EnforcedStyle: indented
|
65
126
|
|
@@ -68,3 +129,50 @@ Layout/SpaceBeforeBlockBraces:
|
|
68
129
|
Exclude:
|
69
130
|
- 'unleash-client.gemspec'
|
70
131
|
- 'spec/**/*.rb'
|
132
|
+
|
133
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
134
|
+
Enabled: true
|
135
|
+
Lint/ConstantDefinitionInBlock:
|
136
|
+
Enabled: false
|
137
|
+
Lint/DeprecatedOpenSSLConstant:
|
138
|
+
Enabled: true
|
139
|
+
Lint/DuplicateElsifCondition:
|
140
|
+
Enabled: true
|
141
|
+
Lint/DuplicateRequire:
|
142
|
+
Enabled: true
|
143
|
+
Lint/DuplicateRescueException:
|
144
|
+
Enabled: true
|
145
|
+
Lint/EmptyConditionalBody:
|
146
|
+
Enabled: true
|
147
|
+
Lint/EmptyFile:
|
148
|
+
Enabled: true
|
149
|
+
Lint/FloatComparison:
|
150
|
+
Enabled: true
|
151
|
+
Lint/HashCompareByIdentity:
|
152
|
+
Enabled: true
|
153
|
+
Lint/IdentityComparison:
|
154
|
+
Enabled: true
|
155
|
+
Lint/MissingSuper:
|
156
|
+
Enabled: false
|
157
|
+
Lint/MixedRegexpCaptureTypes:
|
158
|
+
Enabled: true
|
159
|
+
Lint/OutOfRangeRegexpRef:
|
160
|
+
Enabled: true
|
161
|
+
Lint/RaiseException:
|
162
|
+
Enabled: true
|
163
|
+
Lint/RedundantSafeNavigation:
|
164
|
+
Enabled: true
|
165
|
+
Lint/SelfAssignment:
|
166
|
+
Enabled: true
|
167
|
+
Lint/StructNewOverride:
|
168
|
+
Enabled: true
|
169
|
+
Lint/TopLevelReturnWithArgument:
|
170
|
+
Enabled: true
|
171
|
+
Lint/TrailingCommaInAttributeDeclaration:
|
172
|
+
Enabled: true
|
173
|
+
Lint/UnreachableLoop:
|
174
|
+
Enabled: true
|
175
|
+
Lint/UselessMethodDefinition:
|
176
|
+
Enabled: true
|
177
|
+
Lint/UselessTimes:
|
178
|
+
Enabled: true
|