diff options
Diffstat (limited to 'monitor')
-rwxr-xr-x | monitor/bot-status | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/monitor/bot-status b/monitor/bot-status index 18144a4..963840d 100755 --- a/monitor/bot-status +++ b/monitor/bot-status @@ -166,27 +166,13 @@ sub get_status() { } $status{'fail'} =~ s/ $//; - # Commit range - # [ - # 'revision', - # '238202', - # 'Build' - # ], - my $max = 0; - foreach (@{$json->{'properties'}}) { - if ($_->[0] eq 'revision') { - $max = $_->[1]; - last; - } - } - # Min is in the changes' section - my $min = $max; - foreach (@{$json->{'sourceStamp'}->{'changes'}}) { - my $commit = $_->{'revision'}; - $min = $commit if ($commit < $min); - } - $status{'from'} = $min; - $status{'to'} = $max; + # Commit range. All LLVM repositories are in git now, so truncate the hashes + # to 8 characters for display. + my @commits = @{$json->{'sourceStamp'}->{'changes'}}; + my $first_rev = $commits[0]->{'revision'}; + my $last_rev = $commits[-1]->{'revision'}; + $status{'from'} = substr($first_rev, 0, 8); + $status{'to'} = substr($last_rev, 0, 8); return \%status; } |