mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bugzilla Bug 74024 check techbot1 into cvs
Land techbot1 into mozbot tree. This has been a long time coming. techbot1 includes support for arbitrary commands, bugzilla features including bug, component and keyword queries. more support for tinderbox including sheriff querying. support for multiple channels. it handles missing components better.
This commit is contained in:
parent
73f59bb569
commit
8b6f15dc64
@ -35,9 +35,9 @@ use LWP::Simple;
|
||||
use Carp;
|
||||
|
||||
@ISA = qw (Exporter);
|
||||
@EXPORT = qw (status statuz);
|
||||
@EXPORT = qw (status);
|
||||
|
||||
my $VERSION = "1.0";
|
||||
my $VERSION = '1.0';
|
||||
|
||||
# status wants a reference to a list of tinderbox trees
|
||||
# and a url ending with tree=, default to mozilla.org's
|
||||
@ -51,51 +51,47 @@ my $VERSION = "1.0";
|
||||
# barf.
|
||||
|
||||
sub status
|
||||
{
|
||||
my $trees = shift;
|
||||
my $url = shift;
|
||||
my %info; my %tree_state;
|
||||
|
||||
# maybe this is too helpful
|
||||
{
|
||||
my $trees = shift;
|
||||
my $uri = shift;
|
||||
my %info; my %tree_state;
|
||||
|
||||
if (ref ($trees) ne "ARRAY")
|
||||
{
|
||||
carp "status method wants a reference to a list, not a " . ref ($trees);
|
||||
# maybe this is too helpful
|
||||
|
||||
if (ref ($trees) ne 'ARRAY') {
|
||||
carp 'status method wants a reference to a list, not a ' . ref ($trees);
|
||||
return;
|
||||
}
|
||||
|
||||
for my $treename (@$trees){
|
||||
my $url = $uri || 'http://tinderbox.mozilla.org/' .
|
||||
'showbuilds.cgi?quickparse=1&tree=';
|
||||
$url.=$treename;
|
||||
|
||||
my $output = get $url;
|
||||
|
||||
my @qp = split /\n/, $output;
|
||||
|
||||
# loop through quickparse output
|
||||
|
||||
foreach my $op (@qp) {
|
||||
my ($type, $tree, $build, $state) = split /\|/, $op;
|
||||
|
||||
if ($type eq 'State') {
|
||||
$tree_state{$tree} = $state;
|
||||
} elsif ($type eq 'Build') {
|
||||
if ($state =~ /success/i) {
|
||||
$state = 'Success';
|
||||
} elsif ($state =~ /testfailed/i) {
|
||||
$state = 'Test Failed';
|
||||
} else {
|
||||
$state = 'Horked';
|
||||
}
|
||||
$info{$tree}{$build} = $state;
|
||||
}
|
||||
}
|
||||
|
||||
$url = $url || "http://tinderbox.mozilla.org/" .
|
||||
"showbuilds.cgi?quickparse=1&tree=";
|
||||
|
||||
my $output = get $url . join ',', @$trees;
|
||||
return if (! $output);
|
||||
|
||||
my @qp = split /\n/, $output;
|
||||
|
||||
# loop through quickparse output
|
||||
|
||||
foreach my $op (@qp)
|
||||
{
|
||||
my ($type, $tree, $build, $state) = split /\|/, $op;
|
||||
|
||||
if ($type eq "State")
|
||||
{
|
||||
$tree_state{$tree} = $state;
|
||||
}
|
||||
elsif ($type eq "Build")
|
||||
{
|
||||
if ($state =~ /success/i) {
|
||||
$state = "Success";
|
||||
} elsif ($state =~ /testfailed/i) {
|
||||
$state = "Test Failed";
|
||||
} else {
|
||||
$state = "Horked";
|
||||
}
|
||||
$info{$tree}{$build} = $state;
|
||||
}
|
||||
}
|
||||
|
||||
return (\%info, \%tree_state);
|
||||
}
|
||||
}
|
||||
return (\%info, \%tree_state);
|
||||
}
|
||||
|
||||
1;
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user