summaryrefslogtreecommitdiffstats
path: root/scripts/1298978.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/1298978.pl')
-rwxr-xr-xscripts/1298978.pl50
1 files changed, 23 insertions, 27 deletions
diff --git a/scripts/1298978.pl b/scripts/1298978.pl
index 9320e080e..6b3fef2fa 100755
--- a/scripts/1298978.pl
+++ b/scripts/1298978.pl
@@ -19,31 +19,27 @@ use Bugzilla::Group;
use Bugzilla::Search;
use constant QUERY => {
- 'keywords' => 'intermittent-failure',
- 'keywords_type' => 'allwords',
- 'priority' => '--',
- 'product' => [
- 'Core',
- 'Firefox',
- 'Firefox for Android',
- 'Firefox for iOS',
- 'Toolkit',
- ],
- 'resolution' => '---',
- 'short_desc' => '^intermittent',
- 'short_desc_type' => 'regexp',
+ 'keywords' => 'intermittent-failure',
+ 'keywords_type' => 'allwords',
+ 'priority' => '--',
+ 'product' =>
+ ['Core', 'Firefox', 'Firefox for Android', 'Firefox for iOS', 'Toolkit',],
+ 'resolution' => '---',
+ 'short_desc' => '^intermittent',
+ 'short_desc_type' => 'regexp',
};
-use constant COMMENT => "Bulk assigning P3 to all open intermittent bugs without a priority set in Firefox components per bug 1298978.";
+use constant COMMENT =>
+ "Bulk assigning P3 to all open intermittent bugs without a priority set in Firefox components per bug 1298978.";
Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
my $dbh = Bugzilla->dbh;
# Make all changes as the automation user
-my $auto_user = Bugzilla::User->check({ name => 'automation@bmo.tld' });
-$auto_user->{groups} = [ Bugzilla::Group->get_all ];
-$auto_user->{bless_groups} = [ Bugzilla::Group->get_all ];
+my $auto_user = Bugzilla::User->check({name => 'automation@bmo.tld'});
+$auto_user->{groups} = [Bugzilla::Group->get_all];
+$auto_user->{bless_groups} = [Bugzilla::Group->get_all];
Bugzilla->set_user($auto_user);
my $search = new Bugzilla::Search(fields => ['bug_id'], params => QUERY);
@@ -51,8 +47,8 @@ my ($data) = $search->data;
my $bug_count = @$data;
if ($bug_count == 0) {
- warn "There are no bugs to update.\n";
- exit 1;
+ warn "There are no bugs to update.\n";
+ exit 1;
}
print STDERR <<EOF;
@@ -66,14 +62,14 @@ my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
$dbh->bz_start_transaction;
foreach my $row (@$data) {
- my $bug_id = shift @$row;
- warn "Updating bug $bug_id\n";
- my $bug = Bugzilla::Bug->new($bug_id);
- $bug->set_priority('P3');
- $bug->add_comment(COMMENT);
- $bug->update($timestamp);
- $dbh->do("UPDATE bugs SET lastdiffed = ? WHERE bug_id = ?",
- undef, $timestamp, $bug_id);
+ my $bug_id = shift @$row;
+ warn "Updating bug $bug_id\n";
+ my $bug = Bugzilla::Bug->new($bug_id);
+ $bug->set_priority('P3');
+ $bug->add_comment(COMMENT);
+ $bug->update($timestamp);
+ $dbh->do("UPDATE bugs SET lastdiffed = ? WHERE bug_id = ?",
+ undef, $timestamp, $bug_id);
}
$dbh->bz_commit_transaction;