r12750 - in /scripts/qa: DebianQA/BTS.pm DebianQA/Config.pm debianqa.conf-sample templates/by_category
tincho-guest at users.alioth.debian.org
tincho-guest at users.alioth.debian.org
Mon Jan 14 20:54:12 UTC 2008
Author: tincho-guest
Date: Mon Jan 14 20:54:11 2008
New Revision: 12750
URL: http://svn.debian.org/wsvn/?sc=1&rev=12750
Log:
Implement two new configuration options for BTS: ignore_keywords and
ignore_severities. (Asked by man-di). The allow the filtering of
non-interesting bugs.
Also, new bts key in the consolidated cache: keywordsA, a parsed version of
keywords in the form of arrayref. I had to retain the old key for backwards
compatibility, will be erased.
Modified:
scripts/qa/DebianQA/BTS.pm
scripts/qa/DebianQA/Config.pm
scripts/qa/debianqa.conf-sample
scripts/qa/templates/by_category
Modified: scripts/qa/DebianQA/BTS.pm
URL: http://svn.debian.org/wsvn/scripts/qa/DebianQA/BTS.pm?rev=12750&op=diff
==============================================================================
--- scripts/qa/DebianQA/BTS.pm (original)
+++ scripts/qa/DebianQA/BTS.pm Mon Jan 14 20:54:11 2008
@@ -110,17 +110,33 @@
my %cbugs;
foreach my $pkgname (@pkglist) {
$bugs{$pkgname} ||= {};
- my @blist = keys %{ $bugs{$pkgname} };
- # Remove done bugs
- @blist = grep( { ref $bugs{$pkgname}{$_}
- and not $bugs{$pkgname}{$_}{done} } @blist );
- $cbugs{$pkgname} = {
- map( { $_ => {
- keywords => $bugs{$pkgname}{$_}{keywords},
- severity => $bugs{$pkgname}{$_}{severity},
- subject => $bugs{$pkgname}{$_}{subject},
- forwarded=> $bugs{$pkgname}{$_}{forwarded},
- } } @blist) };
+
+ # bugs to ignore if keyword present
+ my %ign_keywords = map({ $_ => 1 }
+ split(/\s*,\s*/, $CFG{bts}{ignore_keywords}));
+ # bugs to ignore if of specified severities
+ my %ign_severities = map({ $_ => 1 }
+ split(/\s*,\s*/, $CFG{bts}{ignore_severities}));
+
+ $cbugs{$pkgname} = {};
+ foreach my $bug (keys %{ $bugs{$pkgname} }) {
+ next unless(ref $bugs{$pkgname}{$bug});
+ # Remove done bugs
+ next if($bugs{$pkgname}{$bug}{done});
+ # Remove if severity match
+ next if($ign_severities{$bugs{$pkgname}{$bug}{severity}});
+ # Remove if keyword match
+ my @keywords = split(/\s+/, $bugs{$pkgname}{$bug}{keywords});
+ next if(grep({ $ign_keywords{$_} } @keywords));
+ $cbugs{$pkgname}{$bug} = {
+ keywords => $bugs{$pkgname}{$bug}{keywords},
+ # need to use a new key for compatibility
+ keywordsA => \@keywords,
+ severity => $bugs{$pkgname}{$bug}{severity},
+ subject => $bugs{$pkgname}{$bug}{subject},
+ forwarded=> $bugs{$pkgname}{$bug}{forwarded},
+ };
+ }
}
update_cache("consolidated", \%cbugs, "bts", 1, 0);
unlock_cache("bts");
Modified: scripts/qa/DebianQA/Config.pm
URL: http://svn.debian.org/wsvn/scripts/qa/DebianQA/Config.pm?rev=12750&op=diff
==============================================================================
--- scripts/qa/DebianQA/Config.pm (original)
+++ scripts/qa/DebianQA/Config.pm Mon Jan 14 20:54:11 2008
@@ -50,7 +50,9 @@
bts => {
ttl => 360, # 6 hours
soap_proxy => 'http://bugs.debian.org/cgi-bin/soap.cgi',
- soap_uri => 'Debbugs/SOAP'
+ soap_uri => 'Debbugs/SOAP',
+ ignore_keywords => "",
+ ignore_severities => ""
},
common => {
cache_dir => "$ENV{HOME}/.debianqa/yourgroup",
Modified: scripts/qa/debianqa.conf-sample
URL: http://svn.debian.org/wsvn/scripts/qa/debianqa.conf-sample?rev=12750&op=diff
==============================================================================
--- scripts/qa/debianqa.conf-sample (original)
+++ scripts/qa/debianqa.conf-sample Mon Jan 14 20:54:11 2008
@@ -39,11 +39,15 @@
ttl = 360 # 6 hours
soap_proxy = http://bugs.debian.org/cgi-bin/soap.cgi
soap_uri = Debbugs/SOAP
+; wontfix, pending, etch, sarge, etc
+ignore_keywords =
+; wishlist, minor
+ignore_severities =
-# Parameters before any section header go into the [common] section
+; Parameters before any section header go into the [common] section
[common]
cache_dir = ~/.debianqa
-# verbosity level: error => 0, warn => 1, info => 2 debug => 3
+; verbosity level: error => 0, warn => 1, info => 2 debug => 3
verbose = 1
-# Prepend syslog-style format?
+; Prepend syslog-style format?
formatted_log => 1
Modified: scripts/qa/templates/by_category
URL: http://svn.debian.org/wsvn/scripts/qa/templates/by_category?rev=12750&op=diff
==============================================================================
--- scripts/qa/templates/by_category (original)
+++ scripts/qa/templates/by_category Mon Jan 14 20:54:11 2008
@@ -27,9 +27,9 @@
[% END %]
</div>
[% END %]
- [% IF pkg.bts.$bug.keywords.length > 0 %]
+ [% IF pkg.bts.$bug.keywordsA.length > 0 %]
<div style="font-size: smaller">
- [% pkg.bts.$bug.keywords.split(" ").join(", ") | html %]
+ [% pkg.bts.$bug.keywordsA.split(" ").join(", ") | html %]
</div>
[% END %]
</td>
More information about the Pkg-perl-cvs-commits
mailing list