jirametrics 2.20.2pre4 → 2.20.2pre6

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.

Potentially problematic release.


This version of jirametrics might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93ae352f7deca80a2a7ff5fab4ec688d905fd487c33b9ffa39a787ff72a8ca80
4
- data.tar.gz: c29116608631b84d59b6f2ec3b5975df9d63b37952f98313be9a7885b4be1f13
3
+ metadata.gz: 63b99b8edec3e017c9ef1be6ad6d7e9c4fa94038126a4fb84cf8d90face9ed9e
4
+ data.tar.gz: c2df48cad225aa8c270dfd3c8f04dc049d3c48642eaa971b885258d58f230a61
5
5
  SHA512:
6
- metadata.gz: d5a663461c702628f764614d9484848da7baf83ed82d617a191f224781587ecc6f449e9faf6b72ce2cc4e048e877a49cc62eb7f47e20f8ecafd41acfbbbec117
7
- data.tar.gz: 98712a0b752ff6b01674ee9ba15078e35595f3546a10a514a95a840f0bcc4334be7adc25e2ef879622f6fdeebf901fb5a32b92569f6b875122d10ea86753b9b6
6
+ metadata.gz: 50dcdb60c3626a3faa6260313fed8a015f24eb757b9f7f338218f7e789b5d0be242e390d9e56b51b2f2f7289eebe6d64df2e195af04a1ecec8acd2fff782772b
7
+ data.tar.gz: 6608ebbefbd28943fed9ab39fa8611a0948e523f76f9f3b37777fdef0a7f0d001df8db2ef4d7d936c588077ba45f27639e8273af279e74291fdbfa638941a9e9
@@ -116,4 +116,8 @@ class Board
116
116
  def estimation_configuration
117
117
  EstimationConfiguration.new raw: raw['estimation']
118
118
  end
119
+
120
+ def inspect
121
+ "Board(id:#{id}, name:#{name.inspect}, board_type:#{board_type.inspect})"
122
+ end
119
123
  end
@@ -218,6 +218,10 @@ class Issue
218
218
  # for 'ready' in cases where the team doesn't have an explicit 'ready' status.
219
219
  # You'd be better off with an explicit 'ready' but sometimes that's not an option.
220
220
  def first_time_added_to_active_sprint
221
+ unless board.scrum?
222
+ raise 'first_time_added_to_active_sprint() can only be used with Scrum boards: ' \
223
+ "issue=#{key}, board=#{board.inspect}"
224
+ end
221
225
  data_clazz = Struct.new(:sprint_id, :sprint_start, :sprint_stop, :change)
222
226
 
223
227
  matching_changes = []
@@ -231,13 +235,7 @@ class Issue
231
235
  data = data_clazz.new
232
236
  data.sprint_id = id
233
237
  data.change = change
234
- sprint_data = raw['fields'][change.field_id].find { |sd| sd['id'].to_i == id }
235
- if sprint_data.nil?
236
- puts "Can't find sprint data for issue #{issue.key} in field #{change.field_id}"
237
- next
238
- end
239
- data.sprint_start = parse_time(sprint_data['startDate'])
240
- data.sprint_stop = parse_time(sprint_data['completeDate'])
238
+ data.sprint_start, data.sprint_stop = find_sprint_start_end(sprint_id: id, change: change)
241
239
  all_datas << data
242
240
  end
243
241
 
@@ -259,7 +257,28 @@ class Issue
259
257
  matching_changes << data.change if data.sprint_start
260
258
  end
261
259
 
262
- matching_changes.min(&:time)
260
+ matching_changes.min_by(&:time)
261
+ end
262
+
263
+ def find_sprint_start_end sprint_id:, change:
264
+ start = nil
265
+ stop = nil
266
+
267
+ sprint = board.sprints.find { |s| s.id == sprint_id }
268
+ if sprint
269
+ start = sprint.start_time
270
+ stop = sprint.completed_time
271
+ puts "#{key}: Found sprint. values: #{start}/#{stop} from sprints file"
272
+ end
273
+
274
+ sprint_data = raw['fields'][change.field_id].find { |sd| sd['id'].to_i == sprint_id }
275
+ if sprint_data
276
+ start = parse_time(sprint_data['startDate'])
277
+ stop = parse_time(sprint_data['completeDate'])
278
+ puts "#{key}: Found sprint. values: #{start}/#{stop} from field: #{change.field_id}"
279
+ end
280
+
281
+ [start, stop]
263
282
  end
264
283
 
265
284
  def parse_time text
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jirametrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.20.2pre4
4
+ version: 2.20.2pre6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Bowler