jirametrics 2.17 → 2.18pre2
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/lib/jirametrics/anonymizer.rb +8 -6
- data/lib/jirametrics/change_item.rb +2 -2
- data/lib/jirametrics/exporter.rb +3 -3
- data/lib/jirametrics.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fcb6a3e3f3392e027dcd9d4309d571aeb5eda4caf62fd089efb9de6b5b7a18a
|
4
|
+
data.tar.gz: 49eb2f05769e83983394e1437d5d261047a5a06dbaa666cca06d680120c40a16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ac85b372b641387e66bcb777f4ef12454f9b3ad59d75013c23899a895a1ab09ddfad96a93215c5bbdf22b88654ff2902a2902f2d632726358752b2236bd059e
|
7
|
+
data.tar.gz: 27242bfb64c7e22ef97c9d26b24f056d46b27eb77a3f18de2b83918e3ef48c8f13302de6d14cd90c47fbfe9d9415c5b76d62487452237db1283b1d6f05e8e6a7
|
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
require 'random-word'
|
4
4
|
|
5
|
-
class Anonymizer
|
5
|
+
class Anonymizer < ChartBase
|
6
6
|
# needed for testing
|
7
7
|
attr_reader :project_config, :issues
|
8
8
|
|
9
9
|
def initialize project_config:, date_adjustment: -200
|
10
|
+
super()
|
10
11
|
@project_config = project_config
|
11
12
|
@issues = @project_config.issues
|
12
13
|
@all_boards = @project_config.all_boards
|
@@ -130,18 +131,19 @@ class Anonymizer
|
|
130
131
|
end
|
131
132
|
end
|
132
133
|
|
133
|
-
def shift_all_dates
|
134
|
-
|
134
|
+
def shift_all_dates date_adjustment: @date_adjustment
|
135
|
+
adjustment_in_seconds = 60 * 60 * 24 * date_adjustment
|
136
|
+
@file_system.log "Shifting all dates by #{label_days date_adjustment}"
|
135
137
|
@issues.each do |issue|
|
136
138
|
issue.changes.each do |change|
|
137
|
-
change.time = change.time +
|
139
|
+
change.time = change.time + adjustment_in_seconds
|
138
140
|
end
|
139
141
|
|
140
|
-
issue.raw['fields']['updated'] = (issue.updated +
|
142
|
+
issue.raw['fields']['updated'] = (issue.updated + adjustment_in_seconds).to_s
|
141
143
|
end
|
142
144
|
|
143
145
|
range = @project_config.time_range
|
144
|
-
@project_config.time_range = (range.begin +
|
146
|
+
@project_config.time_range = (range.begin + date_adjustment)..(range.end + date_adjustment)
|
145
147
|
end
|
146
148
|
|
147
149
|
def random_name
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class ChangeItem
|
4
|
-
attr_reader :field, :value_id, :old_value_id, :raw, :
|
5
|
-
attr_accessor :value, :old_value
|
4
|
+
attr_reader :field, :value_id, :old_value_id, :raw, :author_raw
|
5
|
+
attr_accessor :value, :old_value, :time
|
6
6
|
|
7
7
|
def initialize raw:, author_raw:, time:, artificial: false
|
8
8
|
@raw = raw
|
data/lib/jirametrics/exporter.rb
CHANGED
@@ -65,14 +65,14 @@ class Exporter
|
|
65
65
|
puts "Full output from downloader in #{file_system.logfile_name}"
|
66
66
|
end
|
67
67
|
|
68
|
-
def info
|
68
|
+
def info key, name_filter:
|
69
69
|
selected = []
|
70
70
|
each_project_config(name_filter: name_filter) do |project|
|
71
71
|
project.evaluate_next_level
|
72
72
|
|
73
73
|
project.run load_only: true
|
74
74
|
project.issues.each do |issue|
|
75
|
-
selected << [project, issue] if
|
75
|
+
selected << [project, issue] if key == issue.key
|
76
76
|
end
|
77
77
|
rescue => e # rubocop:disable Style/RescueStandardError
|
78
78
|
# This happens when we're attempting to load an aggregated project because it hasn't been
|
@@ -81,7 +81,7 @@ class Exporter
|
|
81
81
|
end
|
82
82
|
|
83
83
|
if selected.empty?
|
84
|
-
file_system.log "No issues found to match #{
|
84
|
+
file_system.log "No issues found to match #{key.inspect}"
|
85
85
|
else
|
86
86
|
selected.each do |project, issue|
|
87
87
|
file_system.log "\nProject #{project.name}", also_write_to_stderr: true
|
data/lib/jirametrics.rb
CHANGED
@@ -47,9 +47,9 @@ class JiraMetrics < Thor
|
|
47
47
|
|
48
48
|
option :config
|
49
49
|
desc 'info', 'Dump information about one issue'
|
50
|
-
def info
|
50
|
+
def info key
|
51
51
|
load_config options[:config]
|
52
|
-
Exporter.instance.info(
|
52
|
+
Exporter.instance.info(key, name_filter: options[:name] || '*')
|
53
53
|
end
|
54
54
|
|
55
55
|
no_commands do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jirametrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.18pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Bowler
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: random-word
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
|
-
rubygems_version: 3.
|
162
|
+
rubygems_version: 3.7.2
|
163
163
|
specification_version: 4
|
164
164
|
summary: Extract Jira metrics
|
165
165
|
test_files: []
|