shiftzilla 0.2.11 → 0.2.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/shiftzilla +2 -1
- data/lib/shiftzilla/bug.rb +25 -23
- data/lib/shiftzilla/engine.rb +4 -3
- data/lib/shiftzilla/org_data.rb +12 -11
- data/lib/shiftzilla/source.rb +14 -3
- data/lib/shiftzilla/version.rb +1 -1
- data/template.haml +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecca05f2efb7dc60cd977affe6bfc7e48edb0e515787caabd1b27d911c293193
|
4
|
+
data.tar.gz: 59c344e58a8e310063df6655cd377bb1a690ac0bd0cd29d61fe55f47dbf8eddb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 139a102ddff266faf520ebecc7439e4c6c2a77884d5b83514cd3269aa837146f08bf1538c23b1845f93a541111861b1ce0d38141dac7e80a827208d3e2acb984
|
7
|
+
data.tar.gz: 8840df886a38558543d2b76a2e179ae6c2cb26d1bdcecc0efaf4e46dba1b1adb5d7d9e11b38037d2157fc897bbe012e51e714b52dd62e9845f5c0bd7b5efcf7f
|
data/bin/shiftzilla
CHANGED
@@ -45,6 +45,7 @@ Description:
|
|
45
45
|
|
46
46
|
Options:
|
47
47
|
EOF
|
48
|
+
opt :purge, "After querying for bug data - if we already have data ffor today, clear it out before loading new data", :default => false
|
48
49
|
end
|
49
50
|
when 'build'
|
50
51
|
Trollop::options do
|
@@ -98,7 +99,7 @@ check_config
|
|
98
99
|
|
99
100
|
case cmd
|
100
101
|
when 'load'
|
101
|
-
load_records
|
102
|
+
load_records(cmd_opts)
|
102
103
|
when 'build'
|
103
104
|
build_reports(cmd_opts)
|
104
105
|
when 'purge'
|
data/lib/shiftzilla/bug.rb
CHANGED
@@ -1,33 +1,35 @@
|
|
1
1
|
module Shiftzilla
|
2
2
|
class Bug
|
3
|
-
attr_reader :id, :first_seen, :last_seen, :test_blocker, :ops_blocker, :owner, :component, :pm_score, :cust_cases, :tgt_release, :summary, :status
|
3
|
+
attr_reader :id, :first_seen, :last_seen, :test_blocker, :ops_blocker, :online_blocker, :owner, :component, :pm_score, :cust_cases, :tgt_release, :summary, :status
|
4
4
|
|
5
5
|
def initialize(bzid,binfo)
|
6
|
-
@id
|
7
|
-
@first_seen
|
8
|
-
@last_seen
|
9
|
-
@test_blocker
|
10
|
-
@ops_blocker
|
11
|
-
@
|
12
|
-
@
|
13
|
-
@
|
14
|
-
@
|
15
|
-
@
|
16
|
-
@
|
17
|
-
@
|
6
|
+
@id = bzid
|
7
|
+
@first_seen = binfo[:snapdate]
|
8
|
+
@last_seen = binfo[:snapdate]
|
9
|
+
@test_blocker = binfo[:test_blocker]
|
10
|
+
@ops_blocker = binfo[:ops_blocker]
|
11
|
+
@online_blocker = binfo[:online_blocker]
|
12
|
+
@owner = binfo[:owner]
|
13
|
+
@summary = binfo[:summary]
|
14
|
+
@status = binfo[:status]
|
15
|
+
@component = binfo[:component]
|
16
|
+
@pm_score = binfo[:pm_score]
|
17
|
+
@cust_cases = binfo[:cust_cases]
|
18
|
+
@tgt_release = binfo[:tgt_release]
|
18
19
|
end
|
19
20
|
|
20
21
|
def update(binfo)
|
21
|
-
@last_seen
|
22
|
-
@test_blocker
|
23
|
-
@ops_blocker
|
24
|
-
@
|
25
|
-
@
|
26
|
-
@
|
27
|
-
@
|
28
|
-
@
|
29
|
-
@
|
30
|
-
@
|
22
|
+
@last_seen = binfo[:snapdate]
|
23
|
+
@test_blocker = binfo[:test_blocker]
|
24
|
+
@ops_blocker = binfo[:ops_blocker]
|
25
|
+
@online_blocker = binfo[:online_blocker]
|
26
|
+
@owner = binfo[:owner]
|
27
|
+
@summary = binfo[:summary]
|
28
|
+
@status = binfo[:status]
|
29
|
+
@component = binfo[:component]
|
30
|
+
@pm_score = binfo[:pm_score]
|
31
|
+
@cust_cases = binfo[:cust_cases]
|
32
|
+
@tgt_release = binfo[:tgt_release]
|
31
33
|
end
|
32
34
|
|
33
35
|
def age
|
data/lib/shiftzilla/engine.rb
CHANGED
@@ -64,14 +64,15 @@ module Shiftzilla
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
def load_records
|
67
|
+
def load_records(options)
|
68
68
|
sources.each do |s|
|
69
|
-
|
69
|
+
proceed = true
|
70
|
+
if s.has_records_for_today? and not options[:purge]
|
70
71
|
puts "Skipping query for #{s.id}; it already has records for today."
|
71
72
|
else
|
72
73
|
backup_db
|
73
74
|
puts "Querying bugzilla for #{s.id}"
|
74
|
-
added_count = s.load_records
|
75
|
+
added_count = s.load_records(options)
|
75
76
|
puts "Added #{added_count} records to #{s.table}"
|
76
77
|
end
|
77
78
|
end
|
data/lib/shiftzilla/org_data.rb
CHANGED
@@ -43,16 +43,17 @@ module Shiftzilla
|
|
43
43
|
|
44
44
|
# Package up bug data
|
45
45
|
binfo = {
|
46
|
-
:snapdate
|
47
|
-
:test_blocker
|
48
|
-
:ops_blocker
|
49
|
-
:
|
50
|
-
:
|
51
|
-
:
|
52
|
-
:
|
53
|
-
:
|
54
|
-
:
|
55
|
-
:
|
46
|
+
:snapdate => snapdate,
|
47
|
+
:test_blocker => keyw.include?('TestBlocker'),
|
48
|
+
:ops_blocker => keyw.include?('OpsBlocker'),
|
49
|
+
:online_blocker => keyw.include?('OnlineStarter'),
|
50
|
+
:owner => owns,
|
51
|
+
:summary => summ,
|
52
|
+
:status => stat,
|
53
|
+
:component => comp,
|
54
|
+
:pm_score => pmsc,
|
55
|
+
:cust_cases => (cust == 1),
|
56
|
+
:tgt_release => tgtr,
|
56
57
|
}
|
57
58
|
|
58
59
|
tgt_release = @config.release_by_target(tgtr)
|
@@ -85,7 +86,7 @@ module Shiftzilla
|
|
85
86
|
|
86
87
|
# Add info to the snapshot
|
87
88
|
snapdata.bug_ids << bzid
|
88
|
-
if bug.test_blocker or bug.ops_blocker
|
89
|
+
if bug.test_blocker or bug.ops_blocker or bug.online_blocker
|
89
90
|
snapdata.tb_ids << bzid
|
90
91
|
end
|
91
92
|
if bug.cust_cases
|
data/lib/shiftzilla/source.rb
CHANGED
@@ -21,13 +21,14 @@ module Shiftzilla
|
|
21
21
|
return count > 0
|
22
22
|
end
|
23
23
|
|
24
|
-
def load_records
|
24
|
+
def load_records(options)
|
25
25
|
output_format = @fields.map{ |fld| "%{#{fld.to_s}}" }.join("\x1F")
|
26
26
|
table_fields = @fields.map{ |fld| "\"#{field_map[fld]}\"" }.join(',')
|
27
27
|
insert_frame = @fields.map{ |fld| '?' }.join(', ')
|
28
28
|
bz_command = "bugzilla query --savedsearch #{@search} --savedsearch-sharer-id=#{@sharer} --outputformat='#{output_format}'"
|
29
29
|
bz_csv = `#{bz_command}`
|
30
30
|
row_count = 0
|
31
|
+
retrieved = []
|
31
32
|
bz_csv.split("\n").each do |row|
|
32
33
|
values = row.split("\x1F")
|
33
34
|
if not @external_bugs_idx.nil?
|
@@ -36,10 +37,20 @@ module Shiftzilla
|
|
36
37
|
else
|
37
38
|
values[@external_bugs_idx] = 0
|
38
39
|
end
|
39
|
-
end
|
40
|
-
|
40
|
+
end
|
41
|
+
retrieved << values
|
41
42
|
row_count += 1
|
42
43
|
end
|
44
|
+
puts "Retrieved #{retrieved.length} rows"
|
45
|
+
if options[:purge] and retrieved.length > 0
|
46
|
+
# We know we have new data, so it is okay to nuke the old data
|
47
|
+
puts "Purging old records"
|
48
|
+
purge_records
|
49
|
+
end
|
50
|
+
puts "Loading new records"
|
51
|
+
retrieved.each do |values|
|
52
|
+
dbh.execute("INSERT INTO #{@table} (#{table_fields}) VALUES (#{insert_frame})", values)
|
53
|
+
end
|
43
54
|
dbh.execute("UPDATE #{@table} SET Snapshot = date('now') WHERE Snapshot ISNULL")
|
44
55
|
return row_count
|
45
56
|
end
|
data/lib/shiftzilla/version.rb
CHANGED
data/template.haml
CHANGED
@@ -126,7 +126,7 @@
|
|
126
126
|
%thead
|
127
127
|
%tr
|
128
128
|
%th
|
129
|
-
%abbr{ :title => 'Test Blocker or
|
129
|
+
%abbr{ :title => 'Test Blocker, Ops Blocker, or Online Blocker?' } Blocker
|
130
130
|
%th
|
131
131
|
%abbr{ :title => 'See https://mojo.redhat.com/docs/DOC-1159309' } PM
|
132
132
|
%th
|
@@ -142,8 +142,9 @@
|
|
142
142
|
- all_bugs.each do |b|
|
143
143
|
%tr
|
144
144
|
%td
|
145
|
-
= b.test_blocker ? "<span class='badge badge-danger'>
|
146
|
-
= b.ops_blocker ? "<span class='badge badge-dark'>
|
145
|
+
= b.test_blocker ? "<span class='badge badge-danger'>Test</span>" : ''
|
146
|
+
= b.ops_blocker ? "<span class='badge badge-dark'>Ops</span>" : ''
|
147
|
+
= b.online_blocker ? "<span class='badge badge-warning'>Online</span>" : ''
|
147
148
|
%td= b.pm_score
|
148
149
|
%td= b.cust_cases ? "<span class='badge badge-warning'>CC</span>" : ''
|
149
150
|
%td(data-order="#{b.semver}")= b.tgt_release
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shiftzilla
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- N. Harrison Ripps
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|