Commit c7a51596 authored by Niko Tyni's avatar Niko Tyni

ci-failures: add -I option showing the run id suitable for API calls

As documented in

  https://ci.debian.net/api/doc

retrying a test can be done with for instance

  curl --header "Auth-Key: $KEY" --data '' https://ci.debian.net/api/v1/retry/:run_id
parent eeb1d9fb
......@@ -8,13 +8,14 @@ use Pod::Usage qw( pod2usage );
my %opts;
getopts('d:aA:nbhm', \%opts) || pod2usage(2);
getopts('d:aA:nbhmI', \%opts) || pod2usage(2);
my $showall = exists $opts{a};
my $arch = $opts{A} || 'amd64';
my $dist = $opts{d} || 'unstable';
my $keepcache = exists $opts{n};
my $showbugs = exists $opts{b};
my $showid = exists $opts{I};
pod2usage(1) if $opts{h};
pod2usage(-exitval => 0, -verbose => 2) if $opts{m};
......@@ -62,8 +63,10 @@ for my $j (@{decode_json(<IN>)}) {
}
my $prefix = substr($p, 0, ($p =~ /^lib/ ? 4 : 1));
my @rcbugs = map {"https://bugs.debian.org/$_"} src_rcbugs($p) if $showbugs;
printf "%s_%s %s %s %s\n", $p, $j->{version},
my $run_id = $j->{run_id};
printf "%s_%s %s %s %s %s\n", $p, $j->{version},
"http://ci.debian.net/packages/$prefix/$p/$dist/${arch}/",
($showid ? $run_id : ''),
(@rcbugs ? colored('RC: ', 'magenta') . join(" ", @rcbugs) : ""),
($j->{previous_status} eq "fail" ? "" : colored("# NEW", 'red'));
}
......@@ -106,7 +109,7 @@ dpt-ci-failures - query ci.debian.net for autopkgtest failures
=head1 SYNOPSIS
B<dpt ci-failures> I<[-d E<lt>distributionE<gt>]> I<[-A E<lt>architectureE<gt>]> I<[-anbhm]>
B<dpt ci-failures> I<[-d E<lt>distributionE<gt>]> I<[-A E<lt>architectureE<gt>]> I<[-anbhmI]>
=head1 OPTIONS
......@@ -129,6 +132,11 @@ and the latest versions are shown.
Additionally show RC bugs for the found packages.
=item B<-I>
Additionally show the run id for the last run (suitable for retrying a test
via the ci.debian.net API.)
=item B<-n>
Keep old cache file instead of downloading the current file from ci.debian.net.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment