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.
@@ -16,7 +16,10 @@ module Jira
16
16
  end
17
17
 
18
18
  describe "#board_controller" do
19
- before { allow(tool).to receive_messages(jira_client: instance_double(RateLimitedJiraClient)) }
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) { instance_double(RateLimitedJiraClient, Project: project_query) }
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
- %i[
221
- expected_start_date_field_name
222
- implementation_team_field_name
223
- jat_tickets_for_team_sprint_ticket_dispatcher_jql
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
- jat_rate_limit_in_seconds_when_defined_else: "10",
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(:new).with(client_options, rate_limit: 10, rate_interval: 60)
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.5
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
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,3 +0,0 @@
1
-
2
-
3
- choco install act-cli