/[collab-qa]/udd/web/bugs.cgi
ViewVC logotype

Diff of /udd/web/bugs.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

udd/web/cgi-bin/bugs.cgi revision 1786 by lucas, Mon Sep 13 09:15:56 2010 UTC udd/web/bugs.cgi revision 1907 by lucas, Tue Feb 8 22:24:57 2011 UTC
# Line 7  require 'cgi' Line 7  require 'cgi'
7  puts "Content-type: text/html\n\n"  puts "Content-type: text/html\n\n"
8    
9  RELEASE_RESTRICT = [  RELEASE_RESTRICT = [
10    ['squeeze', 'squeeze', 'id in (select id from bugs_rt_affects_testing)'],    ['wheezy', 'wheezy', 'id in (select id from bugs_rt_affects_testing)'],
11    ['sid', 'sid', 'id in (select id from bugs_rt_affects_unstable)'],    ['sid', 'sid', 'id in (select id from bugs_rt_affects_unstable)'],
12    ['squeeze_and_sid', 'squeeze and sid', 'id in (select id from bugs_rt_affects_testing_and_unstable)'],    ['wheezy_and_sid', 'wheezy and sid', 'id in (select id from bugs_rt_affects_testing) and id in (select id from bugs_rt_affects_unstable)'],
13    ['squeeze_or_sid', 'squeeze or sid', 'id in (select id from bugs_rt_affects_testing union select id from bugs_rt_affects_unstable)'],    ['wheezy_or_sid', 'wheezy or sid', 'id in (select id from bugs_rt_affects_testing union select id from bugs_rt_affects_unstable)'],
14    ['squeeze_not_sid', 'squeeze, not sid', 'id in (select id from bugs_rt_affects_testing) and id not in (select id from bugs_rt_affects_unstable)'],    ['wheezy_not_sid', 'wheezy, not sid', 'id in (select id from bugs_rt_affects_testing) and id not in (select id from bugs_rt_affects_unstable)'],
15    ['sid_not_squeeze', 'sid, not squeeze', 'id in (select id from bugs_rt_affects_unstable) and id not in (select id from bugs_rt_affects_testing)']    ['sid_not_wheezy', 'sid, not wheezy', 'id in (select id from bugs_rt_affects_unstable) and id not in (select id from bugs_rt_affects_testing)'],
16      ['squeeze', 'squeeze', 'id in (select id from bugs_rt_affects_stable)'],
17      ['lenny', 'lenny', 'id in (select id from bugs_rt_affects_oldstable)'],
18      ['any', 'any', 'id in (select id from bugs where status!=\'done\')'],
19  ]  ]
20    
21  FILTERS = [  FILTERS = [
22   ['fpatch', 'tagged patch', 'id in (select id from bugs_tags where tag=\'patch\')'],   ['patch', 'tagged patch', 'id in (select id from bugs_tags where tag=\'patch\')'],
23   ['fsecurity', 'tagged security', 'id in (select id from bugs_tags where tag=\'security\')'],   ['pending', 'tagged pending', 'id in (select id from bugs_tags where tag=\'pending\')'],
24   ['fdone', 'marked as done', 'status = \'done\''],   ['security', 'tagged security', 'id in (select id from bugs_tags where tag=\'security\')'],
25   ['fpending', 'tagged pending', 'id in (select id from bugs_tags where tag=\'pending\')'],   ['wontfix', 'tagged wontfix', 'id in (select id from bugs_tags where tag=\'wontfix\')'],
26     ['upstream', 'tagged upstream', 'id in (select id from bugs_tags where tag=\'upstream\')'],
27     ['unreproducible', 'tagged unreproducible', 'id in (select id from bugs_tags where tag=\'unreproducible\')'],
28     ['forwarded', 'forwarded upstream', 'forwarded != \'\''],
29     ['claimed', 'claimed bugs', "id in (select id from bugs_usertags where email='bugsquash@qa.debian.org')"],
30     ['deferred', 'fixed in deferred/delayed', "id in (select id from deferred_closes)"],
31     ['notmain', 'packages not in main', 'id not in (select id from bugs_packages, sources where bugs_packages.source = sources.source and component=\'main\')'],
32     ['notwheezy', 'packages not in wheezy', 'id not in (select id from bugs_packages, sources where bugs_packages.source = sources.source and release=\'wheezy\')'],
33     ['base', 'packages in base system', 'bugs.source in (select source from sources where priority=\'required\' or priority=\'important\')'],
34     ['standard', 'packages in standard installation', 'bugs.source in (select source from sources where priority=\'standard\')'],
35     ['orphaned', 'orphaned packages', 'bugs.source in (select source from orphaned_packages where type in (\'ITA\', \'O\'))'],
36     ['merged', 'merged bugs', 'id in (select id from bugs_merged_with where id > merged_with)'],
37     ['done', 'marked as done', 'status = \'done\''],
38     ['outdatedwheezy', 'outdated binaries in wheezy', "bugs.source in (select distinct p1.source from packages_summary p1, packages_summary p2 where p1.source = p2.source and p1.release='wheezy' and p2.release='wheezy' and p1.source_version != p2.source_version)"],
39     ['outdatedsid', 'outdated binaries in sid', "bugs.source in (select distinct p1.source from packages_summary p1, packages_summary p2 where p1.source = p2.source and p1.release='sid' and p2.release='sid' and p1.source_version != p2.source_version)"],
40     ['needmig', 'different versions in wheezy and sid', "bugs.source in (select s1.source from sources s1, sources s2 where s1.source = s2.source and s1.release = 'wheezy' and s2.release='sid' and s1.version != s2.version)"],
41     ['newerubuntu', 'newer in Ubuntu than in sid', "bugs.source in (select s1.source from sources_uniq s1, ubuntu_sources s2 where s1.source = s2.source and s1.release = 'sid' and s2.release='natty' and s1.version < s2.version)"],
42     ['rtwheezy-will-remove', 'RT tag for wheezy: will-remove', "id in (select id from bugs_usertags where email='release.debian.org@packages.debian.org' and tag='wheezy-will-remove')"],
43     ['rtwheezy-can-defer', 'RT tag for wheezy: can-defer', "id in (select id from bugs_usertags where email='release.debian.org@packages.debian.org' and tag='wheezy-can-defer')"],
44     ['rtwheezy-is-blocker', 'RT tag for wheezy: is-blocker', "id in (select id from bugs_usertags where email='release.debian.org@packages.debian.org' and tag='wheezy-is-blocker')"],
45  ]  ]
46    
47  # ignore merged bugs ['fmerged', 'merged bugs', 'id in (select id from bugs_merged_with where id > merged_with)'],  TYPES = [
48      ['rc', 'release-critical bugs', 'severity >= \'serious\'', true ],
49      ['ipv6', 'release goal: IPv6 support', 'id in (select id from bugs_tags where tag=\'ipv6\')', false ],
50      ['lfs', 'release goal: Large File Support', 'id in (select id from bugs_tags where tag=\'lfs\')', false ],
51      ['boot', 'release goal: boot performance (init.d dependencies)', 'id in (select id from bugs_usertags where email = \'initscripts-ng-devel@lists.alioth.debian.org\')', false],
52      ['oldgnome', 'release goal: remove obsolete GNOME libraries', 'id in (select id from bugs_usertags where email = \'pkg-gnome-maintainers@lists.alioth.debian.org\' and tag=\'oldlibs\')', false],
53      ['ruby', 'Ruby bugs', "bugs.source in (select source from sources where maintainer ~ 'ruby' or uploaders ~ 'ruby')\nOR bugs.package in (select source from packages where (package ~ 'ruby' or depends ~ 'ruby') and source != 'subversion')\nOR title ~ 'ruby'"],
54      ['l10n', 'Localisation bugs', 'id in (select id from bugs_tags where tag=\'l10n\')', false],
55      ['xsf', 'X Strike Force bugs', "bugs.source in (select source from sources where maintainer ~ 'debian-x@lists.debian.org')\n"],
56      ['allbugs', 'All bugs', 'true', false],
57    ]
58    
 # not in squeeze  
 # ['fnotmain', 'not in main', 'FIXME'],  
 # ['fnewer', 'newer than 7 days', 'FIXME'],  
59  SORTS = [  SORTS = [
60    ['id', 'bug#'],    ['id', 'bug#'],
61    ['source', 'source package'],    ['source', 'source package'],
62    ['package', 'binary package'],    ['package', 'binary package'],
63    ['last_modified', 'last modified']    ['last_modified', 'last modified'],
64      ['severity', 'severity'],
65      ['popcon', 'popularity contest'],
66    ]
67    
68    COLUMNS = [
69      ['cpopcon', 'popularity&nbsp;contest'],
70      ['chints', 'release&nbsp;team&nbsp;hints'],
71      ['cseverity', 'severity'],
72      ['ctags', 'tags'],
73      ['cclaimed', 'claimed&nbsp;by'],
74      ['cdeferred', 'deferred/delayed'],
75      ['caffected', 'affected&nbsp;releases'],
76      ['crttags', 'release&nbsp;team&nbsp;tags&nbsp;for&nbsp;wheezy'],
77  ]  ]
78    
79  cgi = CGI::new  cgi = CGI::new
 p cgi.params  
80  # releases  # releases
81  if RELEASE_RESTRICT.map { |r| r[0] }.include?(cgi.params['release'][0])  if RELEASE_RESTRICT.map { |r| r[0] }.include?(cgi.params['release'][0])
82    release = cgi.params['release'][0]    release = cgi.params['release'][0]
83  else  else
84    release = 'squeeze_or_sid'    release = 'wheezy'
85    end
86    # columns
87    cols = {}
88    COLUMNS.map { |r| r[0] }.each do |r|
89      if cgi.params[r][0]
90        cols[r] = true
91      else
92        cols[r] = false
93      end
94  end  end
95  # sorts  # sorts
96  if SORTS.map { |r| r[0] }.include?(cgi.params['sortby'][0])  if SORTS.map { |r| r[0] }.include?(cgi.params['sortby'][0])
# Line 53  if ['asc', 'desc'].include?(cgi.params[' Line 103  if ['asc', 'desc'].include?(cgi.params['
103  else  else
104    sorto = 'asc'    sorto = 'asc'
105  end  end
106    # hack to enable popcon column if sortby = popcon
107    cols['cpopcon'] = true if sortby == 'popcon'
108    cols['cseverity'] = true if sortby == 'severity'
109  # filters  # filters
110  filters = {}  filters = {}
111  FILTERS.map { |r| r[0] }.each do |e|  FILTERS.map { |r| r[0] }.each do |e|
112    if ['notconsidered', 'only', 'ign'].include?(cgi.params[e][0])    if ['', 'only', 'ign'].include?(cgi.params[e][0])
113      filters[e] = cgi.params[e][0]      filters[e] = cgi.params[e][0]
114    else    else
115      filters[e] = 'notconsidered'      filters[e] = (e == 'merged' ? 'ign' : '')
116      end
117    end
118    # filter: newer than X days
119    if ['', 'only', 'ign'].include?(cgi.params['fnewer'][0])
120      fnewer = cgi.params['fnewer'][0]
121    else
122      fnewer = ''
123    end
124    if cgi.params['fnewerval'][0] =~ /^[0-9]+$/
125      fnewerval = cgi.params['fnewerval'][0].to_i
126    else
127      fnewerval = 7
128    end
129    # types
130    types = {}
131    TYPES.each do |t|
132      if cgi.params == {}
133        types[t[0]] = t[3]
134      else
135        if cgi.params[t[0]][0] == '1'
136          types[t[0]] = true
137        else
138          types[t[0]] = false
139        end
140    end    end
141  end  end
142    
# Line 67  puts <<-EOF Line 144  puts <<-EOF
144  <html>  <html>
145  <head>  <head>
146  <style type="text/css">  <style type="text/css">
147    td, th {  
148      body {
149        font-family : "DejaVu Sans", "Bitstream Vera Sans", sans-serif;"
150      }
151    
152      table.buglist td, table.buglist th {
153      border: 1px solid gray;      border: 1px solid gray;
154      padding-left: 3px;      padding-left: 3px;
155      padding-right: 3px;      padding-right: 3px;
156    }    }
157    tr:hover  {    table.buglist tr:hover  {
158      background-color: #ccc;      background-color: #ccc;
159        color: #000;
160    }    }
161    table {    table {
162      border-collapse: collapse;      border-collapse: collapse;
163    }    }
164    
165    div#body {
166      border-top: 2px solid #d70751;
167    }
168    
169    div.footer {
170        padding: 0.3em 0;
171        background-color: #fff;
172        color: #000;
173        text-align: center;
174        border-top: 2px solid #d70751;
175        margin: 0 0 0 0;
176        border-bottom: 0;
177        font-size: 85%;
178    }
179  </style>  </style>
180  <title>RC Bugs List @ UDD</title>  <title>Debian Bugs Search @ UDD</title>
181    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
182    <script type="text/javascript">
183    function removeBlankFields(form) {
184            var inputs = form.getElementsByTagName("input");
185            var removeList = new Array();
186            for (var i=0; i<inputs.length; i++) {
187                    if (inputs[i].value == "") {
188                            removeList.push(inputs[i]);
189                    }
190            }
191            for (x in removeList) {
192                    removeList[x].parentNode.removeChild(removeList[x]);
193            }
194    }
195    </script>
196  </head>  </head>
197  <body>  <body>
198  <h1>Release Critical Bugs List</h1>  <h1 style="margin-bottom : 5px"><img src="http://qa.debian.org/debian.png" alt="Debian logo" width="188" height="52" style="vertical-align : -13px; ">Bugs Search <span style="color :#c70036">@</span> UDD</h1>
199    <div id="body">
200    
201  <form action="bugs.cgi" method="get">  <form action="bugs.cgi" method="get" onsubmit="removeBlankFields(this);">
202  <p><b>Bugs affecting:</b>  <p><b>Bugs affecting:</b>
203  EOF  EOF
204    
# Line 93  RELEASE_RESTRICT.each do |r| Line 207  RELEASE_RESTRICT.each do |r|
207    puts "<input type='radio' name='release' value='#{r[0]}' #{checked}/>#{r[1]}&nbsp;&nbsp;"    puts "<input type='radio' name='release' value='#{r[0]}' #{checked}/>#{r[1]}&nbsp;&nbsp;"
208  end  end
209  puts <<-EOF  puts <<-EOF
210  </p>  <br/>(This already uses release tags ('sid', 'wheezy') and xxx-ignore ('wheezy-ignore') to include/exclude bugs)</p>
211  <table>  <table class="invisible"><tr><td>
212    <table class="buglist">
213  <tr><th colspan='4'>FILTERS</th></tr>  <tr><th colspan='4'>FILTERS</th></tr>
214  <tr><th>not considered</th><th>only</th><th>ignore</th><th>type</th></tr>  <tr><th>not considered</th><th>only</th><th>ignore</th><th>type</th></tr>
215  EOF  EOF
216  FILTERS.each do |r|  FILTERS.each do |r|
217    puts <<-EOF    puts <<-EOF
218    <tr>    <tr>
219    <td style='text-align: center;'><input type='radio' name='#{r[0]}' value='' #{filters[r[0]]=='notconsidered'?'CHECKED=\'1\'':''}/></td>    <td style='text-align: center;'><input type='radio' name='#{r[0]}' value='' #{filters[r[0]]==''?'CHECKED=\'1\'':''}/></td>
220    <td style='text-align: center;'><input type='radio' name='#{r[0]}' value='only' #{filters[r[0]]=='only'?'CHECKED=\'1\'':''}/></td>    <td style='text-align: center;'><input type='radio' name='#{r[0]}' value='only' #{filters[r[0]]=='only'?'CHECKED=\'1\'':''}/></td>
221    <td style='text-align: center;'><input type='radio' name='#{r[0]}' value='ign #{filters[r[0]]=='ign'?'CHECKED=\'1\'':''}'/></td>    <td style='text-align: center;'><input type='radio' name='#{r[0]}' value='ign' #{filters[r[0]]=='ign'?'CHECKED=\'1\'':''}/></td>
222    <td>#{r[1]}</td>    <td>#{r[1]}</td>
223    </tr>    </tr>
224    EOF    EOF
225  end  end
226    # newer than
227  puts "</table>"  puts <<-EOF
228      <tr>
229      <td style='text-align: center;'><input type='radio' name='fnewer' value='' #{fnewer==''?'CHECKED=\'1\'':''}/></td>
230      <td style='text-align: center;'><input type='radio' name='fnewer' value='only' #{fnewer=='only'?'CHECKED=\'1\'':''}/></td>
231      <td style='text-align: center;'><input type='radio' name='fnewer' value='ign' #{fnewer=='ign'?'CHECKED=\'1\'':''}/></td>
232      <td>newer than <input type='text' size='3' name='fnewerval' value='#{fnewerval}'/> days</td>
233      </tr>
234    EOF
235    puts "</table></td><td style='padding-left: 20px'><table class='buglist'>"
236    puts "<tr><th colspan='2'>Bug types</th></tr>"
237    TYPES.each do |t|
238      checked = types[t[0]]?" checked='1'":""
239      puts "<tr><td><input type='checkbox' name='#{t[0]}' value='1'#{checked}/></td><td>#{t[1]}</td></tr>"
240    end
241    puts "</table></td></tr></table>"
242  puts "<p><b>Sort by:</b> "  puts "<p><b>Sort by:</b> "
243  SORTS.each do |r|  SORTS.each do |r|
244    checked = (sortby == r[0] ? 'CHECKED=\'1\'':'')    checked = (sortby == r[0] ? 'CHECKED=\'1\'':'')
# Line 120  puts "<b> -- </b>" Line 249  puts "<b> -- </b>"
249    checked = (sorto == r[0] ? 'CHECKED=\'1\'':'')    checked = (sorto == r[0] ? 'CHECKED=\'1\'':'')
250    puts "<input type='radio' name='sorto' value='#{r[0]}' #{checked}/>#{r[1]}&nbsp;&nbsp;"    puts "<input type='radio' name='sorto' value='#{r[0]}' #{checked}/>#{r[1]}&nbsp;&nbsp;"
251  end  end
252    puts "<br/>\n<b>Additional information:</b> "
253    COLUMNS.each do |r|
254      checked = cols[r[0]] ? 'checked':''
255      puts "<input type='checkbox' name='#{r[0]}' value='1' #{checked}/>#{r[1]}&nbsp;&nbsp;"
256    end
257  puts <<-EOF  puts <<-EOF
258  </p><input type='submit'/>  <br/>\n<input type='submit' value='Search'/></p>
259  </form>  </form>
260  EOF  EOF
261  if cgi.params != {}  if cgi.params != {}
262    
263    # Generate and execute query
264  tstart = Time::now  tstart = Time::now
   
265  dbh = DBI::connect('DBI:Pg:dbname=udd;port=5441;host=localhost', 'guest')  dbh = DBI::connect('DBI:Pg:dbname=udd;port=5441;host=localhost', 'guest')
266  q = "select id, bugs.package, bugs.source, title, last_modified from bugs \n"  dbh.execute("SET statement_timeout TO 90000")
267    if cols['cpopcon']
268      q = "select id, bugs.package, bugs.source, severity, title, last_modified, affects_stable, affects_testing, affects_unstable, affects_experimental, coalesce(popcon_src.insts, 0) as popcon\nfrom bugs left join popcon_src on (bugs.source = popcon_src.source) \n"
269    else
270      q = "select id, bugs.package, bugs.source, severity, title, last_modified, affects_stable, affects_testing, affects_unstable, affects_experimental from bugs \n"
271    end
272  q += "where #{RELEASE_RESTRICT.select { |r| r[0] == release }[0][2]} \n"  q += "where #{RELEASE_RESTRICT.select { |r| r[0] == release }[0][2]} \n"
 q += "and severity >= 'serious' \n" # hack hack hack  
273  FILTERS.each do |f|  FILTERS.each do |f|
274    if filters[f[0]] == 'only'    if filters[f[0]] == 'only'
275      q += "and #{f[2]} \n"      q += "and #{f[2]} \n"
# Line 139  FILTERS.each do |f| Line 277  FILTERS.each do |f|
277      q += "and not (#{f[2]}) \n"      q += "and not (#{f[2]}) \n"
278    end    end
279  end  end
280    if fnewer == 'only'
281      q += "and (current_timestamp - interval '#{fnewerval} days' <= arrival) \n"
282    elsif fnewer == 'ign'
283      q += "and (current_timestamp - interval '#{fnewerval} days' > arrival) \n"
284    end
285    q2 = TYPES.select { |t| types[t[0]] }.map { |t| t[2] }.join("\n OR ")
286    if q2 != ""
287      q += "AND (#{q2})\n"
288    else
289      puts "<p><b>Must select at least one bug type!</b></p>"
290      q += "AND FALSE\n"
291    end
292  q += "order by #{sortby} #{sorto}"  q += "order by #{sortby} #{sorto}"
 sth = dbh.prepare(q)  
 sth.execute  
 rows = sth.fetch_all  
293    
294  puts "<p><b>#{rows.length} bugs found.</b></p>"  load = IO::read('/proc/loadavg').split[1].to_f
295  puts <<-EOF  if load > 20
296  <table>    puts "<p><b>Current system load (#{load}) is too high. Please retry later!</b></p>"
297  <tr><th>bug#</th><th>source pkg</th><th>binary pkg</th><th>title</th><th>last&nbsp;modified</th></tr>    puts "<pre>#{q}</pre>"
298  EOF    exit(0)
299  rows.each do |r|  end
300    puts <<-EOF  
301    <tr>  begin
302    <td style='text-align: center;'><a href="http://bugs.debian.org/#{r['id']}">##{r['id']}</a></td>    sth = dbh.prepare(q)
303    <td style='text-align: center;'>#{r['source']}</td>    sth.execute
304    <td style='text-align: center;'>#{r['package']}</td>    rows = sth.fetch_all
305    <td>#{r['title']}</td>  rescue DBI::ProgrammingError => e
306    <td style='text-align: center;'>#{r['last_modified'].to_date}</td>    puts "<p>The query generated an error, please report it to lucas@debian.org: #{e.message}</p>"
307    </tr>    puts "<pre>#{q}</pre>"
308    EOF    exit(0)
309    end
310    
311    if cols['chints']
312      sthh = dbh.prepare("select distinct source, type, argument, version, file, comment from relevant_hints order by type")
313      sthh.execute
314      rowsh = sthh.fetch_all
315      hints = {}
316      rowsh.each do |r|
317        hints[r['source']] ||= []
318        hints[r['source']] << r
319      end
320  end  end
 =begin  
 release goals:  
 all  
 include / only  
   
 columns:  
 id  
 source  
 package  
 title  
321    
322  time  if cols['ctags']
323  data last refreshed    ids = rows.map { |r| r['id'] }.join(',')
324  EOF    stht = dbh.prepare("select id, tag from bugs_tags where id in (#{ids})")
325  =end    stht.execute
326      rowst = stht.fetch_all
327      tags = {}
328      rowst.each do |r|
329        tags[r['id']] ||= []
330        tags[r['id']] << r['tag']
331      end
332    end
333    
334  =begin  if cols['cclaimed']
335  sth = dbh.prepare("select id, bugs.package, bugs.source, insts, title from bugs, popcon_src where bugs.source = popcon_src.source and id in (select id from bugs_rt_affects_testing_and_unstable) and id in (select id from bugs_tags where tag='patch') and id not in (select id from bugs_tags where tag='pending') and severity >= 'serious' order by id")    ids = rows.map { |r| r['id'] }.join(',')
336  sth.execute ; rows = sth.fetch_all    stht = dbh.prepare("select distinct id, tag from bugs_usertags where email='bugsquash@qa.debian.org' and id in (#{ids})")
337      stht.execute
338  puts "<h2>RC bugs tagged patch (and not pending)</h2>"    rowst = stht.fetch_all
339  puts "<table>"    claimedbugs = {}
340  puts "<tr><th>bug</th><th>package</th><th>source</th><th>popcon</th><th>title</th></tr>"    rowst.each do |r|
341  rows.each do |r|      claimedbugs[r['id']] ||= []
342     puts "<tr><td><a href=\"http://bugs.debian.org/#{r['id']}\">#{r['id']}</a></td>"      claimedbugs[r['id']] << r['tag']
343     puts "<td>#{r['package']}</td>"    end
    puts "<td><a href=\"http://packages.qa.debian.org/#{r['source']}\">#{r['source']}</a></td>"  
    puts "<td>#{r['insts']}</td>"  
    puts "<td>#{r['title']}</td>"  
344  end  end
 puts "</table>"  
 sth.finish  
345    
346  puts "<h2>RC bugs on packages with a newer version in Ubuntu (possible patches), not tagged patch nor pending</h2>"  if cols['crttags']
347  puts "<table>"    ids = rows.map { |r| r['id'] }.join(',')
348  puts "<tr><th>bug</th><th>package</th><th>source</th><th>versions (D/U)</th><th>popcon</th><th>title</th></tr>"    stht = dbh.prepare("select distinct id, tag from bugs_usertags where email='release.debian.org@packages.debian.org' and id in (#{ids})")
349      stht.execute
350  sth = dbh.prepare("WITH ubudeb AS (select distinct on (d.source, u.source) d.source as dsource, u.source as usource, d.version as dversion, u.version as uversion from sources_uniq d, ubuntu_sources u where d.release = 'sid' and d.distribution = 'debian' and u.release = '#{URELEASE}' and u.distribution = 'ubuntu' and u.source = d.source and u.version > d.version order by d.source asc, u.source asc, d.version desc)    rowst = stht.fetch_all
351  select id, bugs.package, bugs.source, title, dversion, uversion, insts from bugs, ubudeb, popcon_src where popcon_src.source = bugs.source and id in (select id from bugs_rt_affects_testing_and_unstable) and id not in (select id from bugs_tags where tag='patch') and id not in (select id from bugs_tags where tag='pending') and severity >= 'serious' and ubudeb.dsource = bugs.source order by id")    rttags = {}
352  sth.execute ; rows = sth.fetch_all    rowst.each do |r|
353  rows.each do |r|      rttags[r['id']] ||= []
354     puts "<tr><td><a href=\"http://bugs.debian.org/#{r['id']}\">#{r['id']}</a></td>"      rttags[r['id']] << r['tag']
355     puts "<td>#{r['package']}</td>"    end
    puts "<td><a href=\"http://packages.qa.debian.org/#{r['source']}\">#{r['source']}</a> <a href=\"https://launchpad.net/ubuntu/#{URELEASE}/+source/#{r['source']}/+changelog\">UbCh</a></td>"  
    puts "<td>#{r['dversion']} / #{r['uversion']}</td>"  
    puts "<td>#{r['insts']}</td>"  
    puts "<td>#{r['title']}</td>"  
356  end  end
 puts "</table>"  
 sth.finish  
357    
 sth = dbh.prepare("select id, bugs.package, bugs.source, insts, title from bugs, popcon_src where bugs.source = popcon_src.source and id in (select id from bugs_rt_affects_testing) and id not in (select id from bugs_rt_affects_unstable) and severity >= 'serious' order by package")  
 sth.execute ; rows = sth.fetch_all  
358    
359  puts "<h2>RC bugs affecting only testing (not unstable, and not pending)</h2>"  if cols['cdeferred']
360  puts "<table>"    ids = rows.map { |r| r['id'] }.join(',')
361  puts "<tr><th>bug</th><th>package</th><th>source</th><th>popcon</th><th>title</th></tr>"    sthd = dbh.prepare("select id, deferred.source, deferred.version, extract (day from delay_remaining) as du from deferred, deferred_closes where deferred.source = deferred_closes.source and deferred.version = deferred_closes.version and deferred_closes.id in (#{ids})")
362      sthd.execute
363      rowsd = sthd.fetch_all
364      deferredbugs = {}
365      rowsd.each do |r|
366        d = r['du'].to_i
367        deferredbugs[r['id']] = "#{r['version']} (#{d}&nbsp;day#{d==1?'':'s'})"
368      end
369    end
370    
371    puts "<p><b>#{rows.length} bugs found.</b></p>"
372    puts '<table class="buglist">'
373    puts '<tr><th>bug#</th><th>package</th><th>title</th>'
374    puts '<th>popcon</th>' if cols['cpopcon']
375    puts '<th>severity</th>' if cols['cseverity']
376    puts '<th>hints</th>' if cols['chints']
377    puts '<th>claimed by</th>' if cols['cclaimed']
378    puts '<th>deferred</th>' if cols['cdeferred']
379    puts '<th>RT tag</th>' if cols['crttags']
380    puts '<th>last&nbsp;modified</th></tr>'
381    
382    def genhints(source, hints)
383      return '' if hints.nil?
384      s = ''
385      hints.each do |h|
386        v = h['version'] ? h['version'] + ' ' : ''
387        t = h['type'] == 'age-days' ? "age/#{h['argument']}" : h['type']
388        s += "<a href=\"http://release.debian.org/britney/hints/#{h['file']}\" title=\"#{v}#{h['file']} #{h['comment']}\">#{t}</a> "
389      end
390      s
391    end
392    
393    # copied from /org/bugs.debian.org/etc/config
394    $TagsSingleLetter = {
395      'patch' => '+',
396      'wontfix' => '☹',
397      'moreinfo' => 'M',
398      'unreproducible' => 'R',
399      'security' => 'S',
400      'pending' => 'P',
401      'fixed'   => 'F',
402      'help'    => 'H',
403      'fixed-upstream' => 'U',
404      'upstream' => 'u',
405    # Added tags
406      'confirmed' => 'C',
407      'etch-ignore' => 'etc-i',
408      'lenny-ignore' => 'len-i',
409      'sarge-ignore' => 'sar-i',
410      'squeeze-ignore' => 'squ-i',
411      'wheezy-ignore' => 'whe-i',
412      'woody' => 'wod',
413      'sarge' => 'sar',
414      'etch' => 'etc',
415      'lenny' => 'len',
416      'squeeze' => 'squ',
417      'wheezy' => 'whe',
418      'sid' => 'sid',
419      'experimental' => 'exp',
420      'l10n' => 'l10n',
421      'd-i' => 'd-i',
422      'ipv6' => 'ipv6',
423      'lfs' => 'lfs',
424      'fixed-in-experimental' => 'fie',
425    }
426    
427    def gentags(tags)
428      return '' if tags.nil?
429      tags.sort!
430      texttags = tags.map do |tag|
431        puts "unknowntag: #{tag}" if $TagsSingleLetter[tag].nil?
432        "<abbr title='#{tag}'>#{$TagsSingleLetter[tag]}</abbr>"
433      end
434      return '&nbsp;[' + texttags.join('|') + ']'
435    end
436    
437    def genaffected(r)
438      s = ""
439      s += "<abbr title='affects stable'>S</abbr>" if r['affects_stable']
440      s += "<abbr title='affects testing'>T</abbr>" if r['affects_testing']
441      s += "<abbr title='affects unstable'>U</abbr>" if r['affects_unstable']
442      s += "<abbr title='affects unstable'>E</abbr>" if r['affects_experimental']
443      return "" if s == ""
444      return "&nbsp;("+s+")"
445    end
446    
447  rows.each do |r|  rows.each do |r|
448     puts "<tr><td><a href=\"http://bugs.debian.org/#{r['id']}\">#{r['id']}</a></td>"    print "<tr><td style='text-align: left;'><a href=\"http://bugs.debian.org/#{r['id']}\">##{r['id']}</a>"
449     puts "<td>#{r['package']}</td>"    puts "#{gentags(tags[r['id']])}" if cols['ctags']
450     puts "<td><a href=\"http://packages.qa.debian.org/#{r['source']}\">#{r['source']}</a></td>"    puts "#{genaffected(r)}" if cols['caffected']
451     puts "<td>#{r['insts']}</td>"    puts "</td>"
452     puts "<td>#{r['title']}</td>"    puts "<td style='text-align: center;'>"
453      srcs = r['source'].split(/,\s*/)
454      bins = r['package'].split(/,\s*/)
455      puts (0...bins.length).map { |i| "<a href=\"http://packages.qa.debian.org/#{srcs[i]}\">#{bins[i]}</a>" }.join(', ')
456      puts "</td>"
457      puts "<td>#{CGI::escapeHTML(r['title'])}</td>"
458      puts "<td>#{r['popcon']}</td>" if cols['cpopcon']
459      puts "<td>#{r['severity']}</td>" if cols['cseverity']
460      puts "<td>#{genhints(r['source'], hints[r['source']])}</td>" if cols['chints']
461      puts "<td>#{claimedbugs[r['id']]}</td>" if cols['cclaimed']
462      puts "<td>#{deferredbugs[r['id']]}</td>" if cols['cdeferred']
463      puts "<td>#{rttags[r['id']]}</td>" if cols['crttags']
464      puts "<td style='text-align: center;'>#{r['last_modified'].to_date}</td></tr>"
465  end  end
 puts "</table>"  
 sth.finish  
466    
 =end  
467  puts "</table>"  puts "</table>"
468  sth2 = dbh.prepare("select max(start_time) from timestamps where source = 'bugs' and command = 'run'")  sth2 = dbh.prepare("select max(start_time) from timestamps where source = 'bugs' and command = 'run'")
469  sth2.execute ; r2 = sth2.fetch_all  sth2.execute ; r2 = sth2.fetch_all
470  puts "<p><b>Generated in #{Time::now - tstart} seconds. Last data update: #{r2[0][0]}</b></p>"  puts "<p><b>Generated in #{Time::now - tstart} seconds. Last data update: #{r2[0][0]}"
471    puts " (%.1f hours ago)</b></p>" % ((Time::now - r2[0][0].to_time) / 3600)
472  puts "<pre>#{q}</pre>"  puts "<pre>#{q}</pre>"
473  end # if cgi.params != {}  end # if cgi.params != {}
474  puts <<-EOF  puts <<-EOF
475    </div>
476    <div class="footer">
477    <small>Suggestions / comments / patches to lucas@debian.org. <a href="http://svn.debian.org/wsvn/collab-qa/udd/web/bugs.cgi">source code</a>.</small>
478    </div>
479  </body>  </body>
480  </html>  </html>
481  EOF  EOF

Legend:
Removed from v.1786  
changed lines
  Added in v.1907

  ViewVC Help
Powered by ViewVC 1.1.5