From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Build passing status icon Date: Tue, 15 Sep 2015 21:05:46 +0200 Message-ID: <87vbbbfqph.fsf@gnu.org> References: <20150730081036.GA9647@thebird.nl> <20150915132441.GB2778@thebird.nl> 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]:54631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbvYC-0004d1-Aa for guix-devel@gnu.org; Tue, 15 Sep 2015 15:06:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbvY6-0002ou-3k for guix-devel@gnu.org; Tue, 15 Sep 2015 15:05:56 -0400 In-Reply-To: <20150915132441.GB2778@thebird.nl> (Pjotr Prins's message of "Tue, 15 Sep 2015 15:24:41 +0200") 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: Pjotr Prins Cc: guix-devel@gnu.org Pjotr Prins skribis: > I asked this before. Would it be possible that hydra exports JSON (or > something) so we can get the package status without having to parse > HTML? So the output of=20 > > http://hydra.gnu.org/job/gnu/master/ruby-2.2.3.x86_64-linux > > would be JSON with > > http://hydra.gnu.org/job/gnu/master/ruby-2.2.3.x86_64-linux.json Everything is possible. :-) It turns out that Hydra has a bunch of things under lib/Hydra/Controller/API.pm=C2=B9. For example: http://hydra.gnu.org/api/nrqueue http://hydra.gnu.org/api/latestbuilds?nr=3D10 http://hydra.gnu.org/api/jobsets?project=3Dgnu http://hydra.gnu.org/api/nrbuilds?nr=3D2&period=3Dday&project=3Dgnu&jobse= t=3Dcore-updates (Damn, we could even have an Emacs mode to display all this!) The /latestbuilds URL provides a =E2=80=9Cbuildstatus=E2=80=9D key, like th= is: { "project":"gnu", "timestamp":1442315120, "nixname":"gcr-3.16.0", "job":"gcr-3.16.0.mips64el-linux", "system":"mips64el-linux", "finished":1, "buildstatus":2, "jobset":"core-updates", "id":683368 } The meaning of the =E2=80=9Cbuildstatus=E2=80=9D value is given in hydra-po= stgresql.sql: -- 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 (obsol= ete) buildStatus integer, So it=E2=80=99s possible to query the build status of some of the latest bu= ilds. However, we=E2=80=99d need a different URL to get what you want. That seem= s to be quite simple to do. Would you or someone else be willing to hack on this? Another useful hack: in gnu.org/s/guix/packages, add a JS snippet that queries http://hydra.gnu.org/api/jobsets?project=3Dgnu and displays some of the info. Thanks, Ludo=E2=80=99. =C2=B9 https://github.com/NixOS/hydra/blob/master/src/lib/Hydra/Controller/= API.pm