[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Build passing status icon
From: |
Pjotr Prins |
Subject: |
Re: Build passing status icon |
Date: |
Wed, 16 Sep 2015 06:37:16 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Tue, Sep 15, 2015 at 09:05:46PM +0200, Ludovic Courtès wrote:
> It turns out that Hydra has a bunch of things under
> lib/Hydra/Controller/API.pm¹. For example:
>
> http://hydra.gnu.org/api/latestbuilds?nr=10
>
> { "project":"gnu",
> "timestamp":1442315120,
> "nixname":"gcr-3.16.0",
> "job":"gcr-3.16.0.mips64el-linux",
> "system":"mips64el-linux",
> "finished":1,
> "buildstatus":2,
> "nixname":"core-updates",
> "id":683368 }
>
> The meaning of the “buildstatus” value is given in hydra-postgresql.sql:
>
> -- Status codes:
> -- 0 = succeeded
> -- 1 = build of this derivation failed
> -- 2 = build of some dependency failed
> -- 3 = other failure (see errorMsg)
> -- 4 = build cancelled (removed from queue; never built)
> -- 5 = build not done because a dependency failed previously (obsolete)
> buildStatus integer,
>
> So it’s possible to query the build status of some of the latest builds.
>
> However, we’d need a different URL to get what you want. That seems to
> be quite simple to do. Would you or someone else be willing to hack on
> this?
I think that if sub latestbuilds simply accepts a nixname we are set!
Add the Perl lines
my $nixname = $c->request->params->{nixname};
$filter->{nixname} = $nixname if ! $nixname eq "";
So we can do
"http://hydra.gnu.org/api/buildToHash?nixname=ruby-2.2.3", assuming
the DB rec has a field named nixname - which I think it has, because
the result already has the column.
Pj.