jira-auto-tool 1.1.5 → 1.2.1
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/README.md +72 -18
- data/config/examples/jira-auto-tool.env.yaml.erb +4 -1
- data/ext/no_wrappers_win.rb +6 -0
- data/features/configure_environment.feature +59 -14
- data/features/control_http_request_rate_limit.feature +19 -7
- data/features/create_sprints_using_existing_ones_as_reference.feature +32 -4
- data/lib/jira/auto/tool/environment_loader.rb +25 -1
- data/lib/jira/auto/tool/helpers/environment_based_value.rb +6 -1
- data/lib/jira/auto/tool/performer/planning_increment_sprint_creator.rb +4 -3
- data/lib/jira/auto/tool/rate_limited_jira_client/in_process_based.rb +26 -0
- data/lib/jira/auto/tool/rate_limited_jira_client/redis_based.rb +40 -0
- data/lib/jira/auto/tool/rate_limited_jira_client.rb +28 -28
- data/lib/jira/auto/tool/version.rb +1 -1
- data/lib/jira/auto/tool.rb +35 -27
- data/lib/tasks/version.rake +1 -1
- data/spec/jira/auto/tool/environment_loader_spec.rb +64 -9
- data/spec/jira/auto/tool/performer/planning_increment_sprint_creator_spec.rb +76 -13
- data/spec/jira/auto/tool/rate_limited_jira_client/in_process_based_spec.rb +65 -0
- data/spec/jira/auto/tool/rate_limited_jira_client/redis_based_spec.rb +56 -0
- data/spec/jira/auto/tool/rate_limited_jira_client_spec.rb +69 -48
- data/spec/jira/auto/tool_spec.rb +27 -24
- metadata +20 -4
- data/bin/setup +0 -8
- data/bin/setup-dev-win.bat +0 -3
data/spec/jira/auto/tool_spec.rb
CHANGED
@@ -16,7 +16,10 @@ module Jira
|
|
16
16
|
end
|
17
17
|
|
18
18
|
describe "#board_controller" do
|
19
|
-
before
|
19
|
+
before do
|
20
|
+
allow(tool)
|
21
|
+
.to receive_messages(jira_client: instance_double(RateLimitedJiraClient))
|
22
|
+
end
|
20
23
|
|
21
24
|
it { expect(tool.board_controller).to be_a(BoardController) }
|
22
25
|
end
|
@@ -118,7 +121,9 @@ module Jira
|
|
118
121
|
end
|
119
122
|
|
120
123
|
describe "#project" do
|
121
|
-
let(:jira_client)
|
124
|
+
let(:jira_client) do
|
125
|
+
instance_double(RateLimitedJiraClient, Project: project_query)
|
126
|
+
end
|
122
127
|
let(:jira_project) { instance_double(JIRA::Resource::Project) }
|
123
128
|
let(:jira_project_key) { "JIRA_PROJECT_KEY" }
|
124
129
|
let(:project_query) { double("project_query", find: jira_project) } # rubocop:disable RSpec/VerifiedDoubles
|
@@ -131,7 +136,7 @@ module Jira
|
|
131
136
|
end
|
132
137
|
|
133
138
|
# TODO: move that to environment_based_value_spec
|
134
|
-
RSpec.shared_examples "an overridable environment based value" do |method_name|
|
139
|
+
RSpec.shared_examples "an overridable environment based value" do |method_name, holds_a_secret_expectation|
|
135
140
|
let(:env_var_name) { method_name.to_s.upcase }
|
136
141
|
let(:method_name?) { :"#{method_name}_defined?" }
|
137
142
|
let(:config) { Config.new(object_with_overridable_value) }
|
@@ -141,6 +146,13 @@ module Jira
|
|
141
146
|
allow(config).to receive_messages(value_store: {})
|
142
147
|
end
|
143
148
|
|
149
|
+
context "when dealing with sensitive information" do
|
150
|
+
it "defines a predicate informing about the value being a secret or not" do
|
151
|
+
expect(object_with_overridable_value.send("#{method_name}_holds_a_secret?"))
|
152
|
+
.to eq(holds_a_secret_expectation)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
144
156
|
context "when the environment variable is set" do
|
145
157
|
let(:expected_value) { "#{env_var_name} env_value" }
|
146
158
|
|
@@ -217,25 +229,13 @@ module Jira
|
|
217
229
|
end
|
218
230
|
end
|
219
231
|
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
jat_rate_limit_in_seconds
|
225
|
-
jat_rate_interval_in_seconds
|
226
|
-
jira_api_token
|
227
|
-
jira_board_name
|
228
|
-
jira_board_name_regex
|
229
|
-
jira_context_path
|
230
|
-
jira_http_debug
|
231
|
-
jira_project_key
|
232
|
-
jira_site_url jira_username
|
233
|
-
jira_sprint_field_name
|
234
|
-
].each do |method_name|
|
235
|
-
describe "environment based values" do
|
232
|
+
described_class::ENVIRONMENT_BASED_VALUE_SYMBOLS.each do |method_name, holds_a_secret|
|
233
|
+
holds_a_secret ||= false
|
234
|
+
|
235
|
+
describe "environment based values - #{method_name} - holds_a_secret = #{holds_a_secret}}" do
|
236
236
|
let(:object_with_overridable_value) { tool }
|
237
237
|
|
238
|
-
it_behaves_like "an overridable environment based value", method_name
|
238
|
+
it_behaves_like "an overridable environment based value", method_name, holds_a_secret
|
239
239
|
end
|
240
240
|
end
|
241
241
|
|
@@ -277,21 +277,24 @@ module Jira
|
|
277
277
|
}
|
278
278
|
end
|
279
279
|
|
280
|
+
let(:expected_jira_client) { instance_double(RateLimitedJiraClient) }
|
281
|
+
|
280
282
|
before do
|
281
283
|
allow(tool)
|
282
284
|
.to receive_messages(jira_username: "jira_username_value", jira_site_url: "https://jira_site_url_value",
|
283
285
|
jira_api_token: "jira_api_token_value",
|
284
286
|
jira_context_path_when_defined_else: "/context_path_value",
|
285
287
|
jira_http_debug?: false,
|
286
|
-
|
288
|
+
jat_rate_limit_per_interval_when_defined_else: "10",
|
287
289
|
jat_rate_interval_in_seconds_when_defined_else: "60")
|
288
290
|
end
|
289
291
|
|
290
292
|
it "has a jira client" do
|
291
|
-
expected_jira_client = instance_double(RateLimitedJiraClient)
|
292
|
-
|
293
293
|
allow(RateLimitedJiraClient)
|
294
|
-
.to receive(:
|
294
|
+
.to receive(:implementation_class_for).with(tool).and_return(RateLimitedJiraClient::InProcessBased)
|
295
|
+
|
296
|
+
allow(RateLimitedJiraClient::InProcessBased)
|
297
|
+
.to receive(:new).with(client_options, rate_limit_per_interval: 10, rate_interval_in_seconds: 60)
|
295
298
|
.and_return(expected_jira_client)
|
296
299
|
|
297
300
|
expect(tool.jira_client).to equal(expected_jira_client)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jira-auto-tool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christophe Broult
|
@@ -163,6 +163,20 @@ dependencies:
|
|
163
163
|
- - ">="
|
164
164
|
- !ruby/object:Gem::Version
|
165
165
|
version: '0'
|
166
|
+
- !ruby/object:Gem::Dependency
|
167
|
+
name: ruby-limiter
|
168
|
+
requirement: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
173
|
+
type: :runtime
|
174
|
+
prerelease: false
|
175
|
+
version_requirements: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0'
|
166
180
|
- !ruby/object:Gem::Dependency
|
167
181
|
name: syslog
|
168
182
|
requirement: !ruby/object:Gem::Requirement
|
@@ -195,7 +209,6 @@ email:
|
|
195
209
|
- cbroult@yahoo.com
|
196
210
|
executables:
|
197
211
|
- jira-auto-tool
|
198
|
-
- setup
|
199
212
|
extensions: []
|
200
213
|
extra_rdoc_files: []
|
201
214
|
files:
|
@@ -209,13 +222,12 @@ files:
|
|
209
222
|
- Rakefile
|
210
223
|
- bin/jira-auto-tool
|
211
224
|
- bin/jira-auto-tool.bat
|
212
|
-
- bin/setup
|
213
|
-
- bin/setup-dev-win.bat
|
214
225
|
- config/examples/jira-auto-tool.env.yaml.erb
|
215
226
|
- cucumber.yml
|
216
227
|
- documentation/JiraToolClassDiagram.uml
|
217
228
|
- documentation/class_diagram.md
|
218
229
|
- documentation/principle.md
|
230
|
+
- ext/no_wrappers_win.rb
|
219
231
|
- features/align_sprint_time_in_dates.feature
|
220
232
|
- features/assign_tickets_to_team_sprints.feature
|
221
233
|
- features/cache_boards.feature
|
@@ -276,6 +288,8 @@ files:
|
|
276
288
|
- lib/jira/auto/tool/project/options.rb
|
277
289
|
- lib/jira/auto/tool/project/ticket_fields.rb
|
278
290
|
- lib/jira/auto/tool/rate_limited_jira_client.rb
|
291
|
+
- lib/jira/auto/tool/rate_limited_jira_client/in_process_based.rb
|
292
|
+
- lib/jira/auto/tool/rate_limited_jira_client/redis_based.rb
|
279
293
|
- lib/jira/auto/tool/request_builder.rb
|
280
294
|
- lib/jira/auto/tool/request_builder/field_context_fetcher.rb
|
281
295
|
- lib/jira/auto/tool/request_builder/field_option_fetcher.rb
|
@@ -327,6 +341,8 @@ files:
|
|
327
341
|
- spec/jira/auto/tool/performer/sprint_time_in_dates_aligner_spec.rb
|
328
342
|
- spec/jira/auto/tool/project/ticket_fields_spec.rb
|
329
343
|
- spec/jira/auto/tool/project_spec.rb
|
344
|
+
- spec/jira/auto/tool/rate_limited_jira_client/in_process_based_spec.rb
|
345
|
+
- spec/jira/auto/tool/rate_limited_jira_client/redis_based_spec.rb
|
330
346
|
- spec/jira/auto/tool/rate_limited_jira_client_spec.rb
|
331
347
|
- spec/jira/auto/tool/request_builder/field_context_fetcher_spec.rb
|
332
348
|
- spec/jira/auto/tool/request_builder/field_option_fetcher_spec.rb
|
data/bin/setup
DELETED
data/bin/setup-dev-win.bat
DELETED