From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pjotr Prins Subject: Re: Build passing status icon Date: Wed, 16 Sep 2015 06:37:16 +0200 Message-ID: <20150916043716.GA5617@thebird.nl> References: <20150730081036.GA9647@thebird.nl> <20150915132441.GB2778@thebird.nl> <87vbbbfqph.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zc4V9-0003iE-I1 for guix-devel@gnu.org; Wed, 16 Sep 2015 00:39:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zc4V4-0004PU-Nl for guix-devel@gnu.org; Wed, 16 Sep 2015 00:39:23 -0400 Content-Disposition: inline In-Reply-To: <87vbbbfqph.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?iso-8859-1?Q?Court=E8s?= Cc: guix-devel@gnu.org On Tue, Sep 15, 2015 at 09:05:46PM +0200, Ludovic Court=C3=A8s wrote: > It turns out that Hydra has a bunch of things under > lib/Hydra/Controller/API.pm=C2=B9. For example: >=20 > http://hydra.gnu.org/api/latestbuilds?nr=3D10 >=20 > { "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 } >=20 > The meaning of the =E2=80=9Cbuildstatus=E2=80=9D value is given in hydr= a-postgresql.sql: >=20 > -- Status codes: > -- 0 =3D succeeded > -- 1 =3D build of this derivation failed > -- 2 =3D build of some dependency failed > -- 3 =3D other failure (see errorMsg) > -- 4 =3D build cancelled (removed from queue; never built) > -- 5 =3D build not done because a dependency failed previously (o= bsolete) > buildStatus integer, >=20 > So it=E2=80=99s possible to query the build status of some of the lates= t builds. >=20 > However, we=E2=80=99d 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!=20 Add the Perl lines=20 my $nixname =3D $c->request->params->{nixname}; $filter->{nixname} =3D $nixname if ! $nixname eq ""; So we can do "http://hydra.gnu.org/api/buildToHash?nixname=3Druby-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.