shiftzilla 0.2.28 → 0.2.32

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56f266589322ef96d40237c0e55372228faf4e228196aa27c75f7982041e234f
4
- data.tar.gz: 3dff610f59c918d39dc3ccdca5b4f3261c66c4ff1f31dfa3595a156882a22b06
3
+ metadata.gz: 357448b678ecf7a3ed4cc51f16b3b7d3b56a74000a02fdb8852197b736a884ed
4
+ data.tar.gz: 3e710abb67f1954f46876923377cf4a98a87c7c16378f34d743938fabfe5c722
5
5
  SHA512:
6
- metadata.gz: 39951d877c9e252396229c0f9cd08ecfdc72aaf1045393a2b4b96faac9065bcf7b21db8d41d2adae36a9c945d5cb5cff5e0c8744a8f592bd6e46dad161f3a96a
7
- data.tar.gz: a4241ab5f9b78cec206b8b758a57b2c33bbf1bd5f03ea70e85cc6463a656d1f628d52f1be93b4c25545ddfc601e9b3ab07980701349f4067f1a823ad0fe0fcdb
6
+ metadata.gz: 5807bea1a9c395df1eb9de16a89ef9234dc09c6aa497d9bd8f91471c6928a3472d51420532ea755c3fbe2e4b2c83343723ac3edbec7e6c785db52045bc4359a3
7
+ data.tar.gz: 555ede112e9652153dff9354cbbc8839c2e0f6f29350a6b04ccb32747783caeaa649cf3ccb7d5d6eb7169ca408f34e02a3c3b4b712d84f890d72ded076eb8f09
@@ -1,37 +1,37 @@
1
1
  module Shiftzilla
2
2
  class Bug
3
- attr_reader :id, :first_seen, :last_seen, :beta_blocker, :test_blocker, :ops_blocker, :online_blocker, :owner, :component, :pm_score, :cust_cases, :tgt_release, :summary, :status
3
+ attr_reader :id, :first_seen, :last_seen, :blocker_plus, :blocker_unknown, :test_blocker, :ops_blocker, :owner, :component, :pm_score, :cust_cases, :tgt_release, :summary, :status
4
4
 
5
5
  def initialize(bzid,binfo)
6
- @id = bzid
7
- @first_seen = binfo[:snapdate]
8
- @last_seen = binfo[:snapdate]
9
- @beta_blocker = binfo[:beta_blocker]
10
- @test_blocker = binfo[:test_blocker]
11
- @ops_blocker = binfo[:ops_blocker]
12
- @online_blocker = binfo[:online_blocker]
13
- @owner = binfo[:owner]
14
- @summary = binfo[:summary]
15
- @status = binfo[:status]
16
- @component = binfo[:component]
17
- @pm_score = binfo[:pm_score]
18
- @cust_cases = binfo[:cust_cases]
19
- @tgt_release = binfo[:tgt_release]
6
+ @id = bzid
7
+ @first_seen = binfo[:snapdate]
8
+ @last_seen = binfo[:snapdate]
9
+ @blocker_plus = binfo[:blocker_plus]
10
+ @blocker_unknown = binfo[:blocker_unknown]
11
+ @test_blocker = binfo[:test_blocker]
12
+ @ops_blocker = binfo[:ops_blocker]
13
+ @owner = binfo[:owner]
14
+ @summary = binfo[:summary]
15
+ @status = binfo[:status]
16
+ @component = binfo[:component]
17
+ @pm_score = binfo[:pm_score]
18
+ @cust_cases = binfo[:cust_cases]
19
+ @tgt_release = binfo[:tgt_release]
20
20
  end
21
21
 
22
22
  def update(binfo)
23
- @last_seen = binfo[:snapdate]
24
- @beta_blocker = binfo[:beta_blocker]
25
- @test_blocker = binfo[:test_blocker]
26
- @ops_blocker = binfo[:ops_blocker]
27
- @online_blocker = binfo[:online_blocker]
28
- @owner = binfo[:owner]
29
- @summary = binfo[:summary]
30
- @status = binfo[:status]
31
- @component = binfo[:component]
32
- @pm_score = binfo[:pm_score]
33
- @cust_cases = binfo[:cust_cases]
34
- @tgt_release = binfo[:tgt_release]
23
+ @last_seen = binfo[:snapdate]
24
+ @blocker_plus = binfo[:blocker_plus]
25
+ @blocker_unknown = binfo[:blocker_unknown]
26
+ @test_blocker = binfo[:test_blocker]
27
+ @ops_blocker = binfo[:ops_blocker]
28
+ @owner = binfo[:owner]
29
+ @summary = binfo[:summary]
30
+ @status = binfo[:status]
31
+ @component = binfo[:component]
32
+ @pm_score = binfo[:pm_score]
33
+ @cust_cases = binfo[:cust_cases]
34
+ @tgt_release = binfo[:tgt_release]
35
35
  end
36
36
 
37
37
  def age
@@ -66,4 +66,4 @@ module Shiftzilla
66
66
  val.to_f.to_s == val.to_s || val.to_i.to_s == val.to_s
67
67
  end
68
68
  end
69
- end
69
+ end
@@ -47,18 +47,18 @@ module Shiftzilla
47
47
 
48
48
  # Package up bug data
49
49
  binfo = {
50
- :snapdate => snapdate,
51
- :beta_blocker => keyw.include?('BetaBlocker'),
52
- :test_blocker => keyw.include?('TestBlocker'),
53
- :ops_blocker => keyw.include?('OpsBlocker'),
54
- :online_blocker => keyw.include?('OnlineStarter'),
55
- :owner => owns,
56
- :summary => summ,
57
- :status => stat,
58
- :component => comp,
59
- :pm_score => pmsc,
60
- :cust_cases => (cust == 1),
61
- :tgt_release => tgtr,
50
+ :snapdate => snapdate,
51
+ :blocker_plus => keyw.include?('blocker+'),
52
+ :blocker_unknown => keyw.include?('blocker?'),
53
+ :test_blocker => keyw.include?('TestBlocker'),
54
+ :ops_blocker => keyw.include?('ServiceDeliveryBlocker'),
55
+ :owner => owns,
56
+ :summary => summ,
57
+ :status => stat,
58
+ :component => comp,
59
+ :pm_score => pmsc,
60
+ :cust_cases => (cust == 1),
61
+ :tgt_release => tgtr,
62
62
  }
63
63
 
64
64
  tgt_release = @config.release_by_target(tgtr)
@@ -104,7 +104,8 @@ module Shiftzilla
104
104
 
105
105
  # Add info to the snapshot
106
106
  snapdata.bug_ids << bzid
107
- if bug.beta_blocker or bug.test_blocker or bug.ops_blocker or bug.online_blocker
107
+ # Only the blocker+ flag counts as a blocker for snapshots
108
+ if bug.blocker_plus
108
109
  snapdata.tb_ids << bzid
109
110
  end
110
111
  if bug.cust_cases
@@ -25,9 +25,31 @@ module Shiftzilla
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
- bz_command = "bugzilla query --savedsearch #{@search} --savedsearch-sharer-id=#{@sharer} --outputformat='#{output_format}||EOR'"
29
- bz_csv = `#{bz_command}`
28
+ # Previous bz_command that used the savedsearch provided by the config
29
+ #bz_command = "bugzilla query --savedsearch #{@search} --savedsearch-sharer-id=#{@sharer} --outputformat='#{output_format}\x1F%{flags}flags||EOR'"
30
30
  retrieved = []
31
+ bz_page_size = 1000
32
+ offset = 0
33
+ # Results from the query, to be split by "||EOR\n"
34
+ bz_csv = ""
35
+
36
+ # Execute the bugzilla query with pagination
37
+ begin
38
+ # Generate the query via string interpolation and execute
39
+ # Query needs to be hard-coded here for string interpolation
40
+ bz_command = "bugzilla query --from-url 'https://bugzilla.redhat.com/buglist.cgi?bug_severity=unspecified&bug_severity=urgent&bug_severity=high&bug_severity=medium&bug_status=NEW&bug_status=ASSIGNED&bug_status=POST&bug_status=ON_DEV&classification=Red%20Hat&columnlist=short_desc%2Cversion%2Cbug_severity%2Cpriority%2Ccomponent%2Creporter%2Cassigned_to%2Cqa_contact%2Cbug_status%2Cproduct%2Cchangeddate%2Ctarget_release%2Ckeywords%2Cflagtypes.name%2Cbug_file_loc%2Cext_bz_list&f1=component&f10=target_release&f11=target_release&f2=component&f3=version&f4=target_release&f5=target_release&f6=target_release&f7=short_desc&f8=target_release&f9=short_desc&limit=#{bz_page_size}&list_id=12103836&o1=notequals&o10=notsubstring&o11=notsubstring&o2=notequals&o3=notregexp&o4=notsubstring&o5=notsubstring&o6=notsubstring&o7=notsubstring&o8=notsubstring&o9=notsubstring&offset=#{offset}&order=bug_status%2Cpriority%2Cassigned_to%2Cbug_id&product=OKD&product=OpenShift%20Container%20Platform&query_format=advanced&v1=Documentation&v2=RFE&v3=%5E2%5C.' --outputformat='#{output_format}\x1F%{flags}flags||EOR'"
41
+ bz_csv_inner = `#{bz_command}`
42
+
43
+ # Shovel results into bz_csv to parse later
44
+ bz_csv << bz_csv_inner
45
+
46
+ # Increase the offset by the page limit
47
+ offset += bz_page_size
48
+
49
+ # Repeat if we got the same number of results as the limit
50
+ end while bz_csv_inner.split("||EOR\n").length == bz_page_size
51
+
52
+ # Parse the results
31
53
  bz_csv.split("||EOR\n").each do |row|
32
54
  values = row.split("\x1F").map{ |v| v.strip }
33
55
 
@@ -47,6 +69,28 @@ module Shiftzilla
47
69
  values[@external_bugs_idx] = 0
48
70
  end
49
71
  end
72
+
73
+ # Check for blocker+ flag and stub it as a keyword
74
+ if not values[-1].nil? and values[-1].include?("blocker+")
75
+ keyword_idx = @fields.index(:keywords)
76
+ if not values[keyword_idx]
77
+ values[keyword_idx] = "blocker+"
78
+ else
79
+ values[keyword_idx] = values[keyword_idx] + ",blocker+"
80
+ end
81
+ end
82
+ # Check for blocker? flag and stub it as a keyword
83
+ if not values[-1].nil? and values[-1].include?("blocker?")
84
+ keyword_idx = @fields.index(:keywords)
85
+ if not values[keyword_idx]
86
+ values[keyword_idx] = "blocker?"
87
+ else
88
+ values[keyword_idx] = values[keyword_idx] + ",blocker?"
89
+ end
90
+ end
91
+
92
+ # Remove flags, which is always the final value
93
+ values = values[0...-2]
50
94
  retrieved << values
51
95
  end
52
96
  puts "Retrieved #{retrieved.length} rows"
@@ -1,3 +1,3 @@
1
1
  module Shiftzilla
2
- VERSION = "0.2.28"
2
+ VERSION = "0.2.32"
3
3
  end
data/shiftzilla.gemspec CHANGED
@@ -6,8 +6,8 @@ require 'shiftzilla/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "shiftzilla"
8
8
  spec.version = Shiftzilla::VERSION
9
- spec.authors = ["N. Harrison Ripps"]
10
- spec.email = ["nhr@redhat.com"]
9
+ spec.authors = ["N. Harrison Ripps","Rory Thrasher"]
10
+ spec.email = ["nhr@redhat.com","rthrashe@redhat.com"]
11
11
  spec.summary = %q{Shiftzilla is a tool for providing historical reports based on Bugzilla data}
12
12
  spec.description = spec.summary
13
13
  spec.homepage = "http://github.com/nhr/shiftzilla"
data/template.haml CHANGED
@@ -153,7 +153,7 @@
153
153
  %thead
154
154
  %tr
155
155
  %th
156
- %abbr{ :title => 'Beta Blocker, Test Blocker, Ops Blocker, or Online Blocker?' } Blocker
156
+ %abbr{ :title => 'Blocker flags and keywords' } Blocker
157
157
  %th
158
158
  %abbr{ :title => 'See https://mojo.redhat.com/docs/DOC-1159309' } PM
159
159
  %th
@@ -169,10 +169,10 @@
169
169
  - all_bugs.each do |b|
170
170
  %tr
171
171
  %td
172
- = b.beta_blocker ? "<span class='badge badge-info'>&#946;eta</span>" : ''
173
- = b.test_blocker ? "<span class='badge badge-danger'>Test</span>" : ''
174
- = b.ops_blocker ? "<span class='badge badge-dark'>Ops</span>" : ''
175
- = b.online_blocker ? "<span class='badge badge-warning'>Online</span>" : ''
172
+ = b.blocker_plus ? "<span class='badge badge-danger'>&#914;locker+</span>" : ''
173
+ = b.blocker_unknown ? "<span class='badge badge-info'>blocker?</span>" : ''
174
+ = b.test_blocker ? "<span class='badge badge-warning'>Test</span>" : ''
175
+ = b.ops_blocker ? "<span class='badge badge-dark'>SD</span>" : ''
176
176
  %td= b.pm_score
177
177
  %td= b.cust_cases ? "<span class='badge badge-warning'>CC</span>" : ''
178
178
  %td(data-order="#{b.semver}")= b.tgt_release
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shiftzilla
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.28
4
+ version: 0.2.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - N. Harrison Ripps
8
- autorequire:
8
+ - Rory Thrasher
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2020-01-21 00:00:00.000000000 Z
12
+ date: 2021-09-03 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
@@ -156,6 +157,7 @@ description: Shiftzilla is a tool for providing historical reports based on Bugz
156
157
  data
157
158
  email:
158
159
  - nhr@redhat.com
160
+ - rthrashe@redhat.com
159
161
  executables:
160
162
  - shiftzilla
161
163
  extensions: []
@@ -182,14 +184,14 @@ files:
182
184
  - lib/shiftzilla/version.rb
183
185
  - shiftzilla.gemspec
184
186
  - shiftzilla.sql.tmpl
185
- - shiftzilla_cfg.yml.tmpl
187
+ - shiftzilla_cfg.yaml.tmpl
186
188
  - template.haml
187
189
  - vendor/flot/jquery.flot.min.js
188
190
  homepage: http://github.com/nhr/shiftzilla
189
191
  licenses:
190
192
  - MIT
191
193
  metadata: {}
192
- post_install_message:
194
+ post_install_message:
193
195
  rdoc_options: []
194
196
  require_paths:
195
197
  - lib
@@ -204,8 +206,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
206
  - !ruby/object:Gem::Version
205
207
  version: '0'
206
208
  requirements: []
207
- rubygems_version: 3.0.3
208
- signing_key:
209
+ rubyforge_project:
210
+ rubygems_version: 2.7.7
211
+ signing_key:
209
212
  specification_version: 4
210
213
  summary: Shiftzilla is a tool for providing historical reports based on Bugzilla data
211
214
  test_files: []