all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Build passing status icon
@ 2015-07-30  8:10 Pjotr Prins
  2015-07-31 17:00 ` Thompson, David
  2015-09-15 13:24 ` Pjotr Prins
  0 siblings, 2 replies; 6+ messages in thread
From: Pjotr Prins @ 2015-07-30  8:10 UTC (permalink / raw)
  To: guix-devel

Would it be possible to get a status icon straight from the build
farm, such as Travis CI provides, for Guix builds? That would mean we
could add it to a package README, e.g.

  https://github.com/pjotrp/bioruby-vcf/blob/master/README.md

The embedded markdown code snippet looks like

  [![Build Status](https://secure.travis-ci.org/pjotrp/bioruby-vcf.png)](http://travis-ci.org/pjotrp/bioruby-vcf) 
When the build fails the PNG will be different.

Pj.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build passing status icon
  2015-07-30  8:10 Build passing status icon Pjotr Prins
@ 2015-07-31 17:00 ` Thompson, David
  2015-09-15 13:24 ` Pjotr Prins
  1 sibling, 0 replies; 6+ messages in thread
From: Thompson, David @ 2015-07-31 17:00 UTC (permalink / raw)
  To: Pjotr Prins; +Cc: guix-devel

On Thu, Jul 30, 2015 at 4:10 AM, Pjotr Prins <pjotr.public12@thebird.nl> wrote:
> Would it be possible to get a status icon straight from the build
> farm, such as Travis CI provides, for Guix builds? That would mean we
> could add it to a package README, e.g.
>
>   https://github.com/pjotrp/bioruby-vcf/blob/master/README.md
>
> The embedded markdown code snippet looks like
>
>   [![Build Status](https://secure.travis-ci.org/pjotrp/bioruby-vcf.png)](http://travis-ci.org/pjotrp/bioruby-vcf)
> When the build fails the PNG will be different.

You should propose this to the Nix folks.  They run the Hydra project,
which we use for hydra.gnu.org.  I would like such a feature as well.

- Dave

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build passing status icon
  2015-07-30  8:10 Build passing status icon Pjotr Prins
  2015-07-31 17:00 ` Thompson, David
@ 2015-09-15 13:24 ` Pjotr Prins
  2015-09-15 19:05   ` Ludovic Courtès
  1 sibling, 1 reply; 6+ messages in thread
From: Pjotr Prins @ 2015-09-15 13:24 UTC (permalink / raw)
  To: Pjotr Prins; +Cc: guix-devel

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 

  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

That way it would be trivial to get a status 'icon' that I can use
elsewhere. I am into software discovery. And build-status would help.
We could even use that to give the status for each package on 

  https://www.gnu.org/software/guix/packages/

Pj.

On Thu, Jul 30, 2015 at 10:10:36AM +0200, Pjotr Prins wrote:
> Would it be possible to get a status icon straight from the build
> farm, such as Travis CI provides, for Guix builds? That would mean we
> could add it to a package README, e.g.
> 
>   https://github.com/pjotrp/bioruby-vcf/blob/master/README.md
> 
> The embedded markdown code snippet looks like
> 
>   [![Build Status](https://secure.travis-ci.org/pjotrp/bioruby-vcf.png)](http://travis-ci.org/pjotrp/bioruby-vcf) 
> When the build fails the PNG will be different.
> 
> Pj.
> 

-- 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build passing status icon
  2015-09-15 13:24 ` Pjotr Prins
@ 2015-09-15 19:05   ` Ludovic Courtès
  2015-09-16  4:37     ` Pjotr Prins
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2015-09-15 19:05 UTC (permalink / raw)
  To: Pjotr Prins; +Cc: guix-devel

Pjotr Prins <pjotr.public12@thebird.nl> 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 
>
>   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¹.  For example:

  http://hydra.gnu.org/api/nrqueue
  http://hydra.gnu.org/api/latestbuilds?nr=10
  http://hydra.gnu.org/api/jobsets?project=gnu
  http://hydra.gnu.org/api/nrbuilds?nr=2&period=day&project=gnu&jobset=core-updates

(Damn, we could even have an Emacs mode to display all this!)

The /latestbuilds URL provides a “buildstatus” key, like this:

  { "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 “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?

Another useful hack: in gnu.org/s/guix/packages, add a JS snippet that
queries http://hydra.gnu.org/api/jobsets?project=gnu and displays some
of the info.

Thanks,
Ludo’.

¹ https://github.com/NixOS/hydra/blob/master/src/lib/Hydra/Controller/API.pm

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build passing status icon
  2015-09-15 19:05   ` Ludovic Courtès
@ 2015-09-16  4:37     ` Pjotr Prins
  2015-09-16 11:32       ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Pjotr Prins @ 2015-09-16  4:37 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build passing status icon
  2015-09-16  4:37     ` Pjotr Prins
@ 2015-09-16 11:32       ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2015-09-16 11:32 UTC (permalink / raw)
  To: Pjotr Prins; +Cc: guix-devel

Pjotr Prins <pjotr.public12@thebird.nl> skribis:

> 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! 

Oh actually there’s nothing to do: just fetch

  http://hydra.gnu.org/api/latestbuilds?nr=1&project=gnu&jobset=master&job=ruby-2.2.3.x86_64-linux

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-16 11:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-30  8:10 Build passing status icon Pjotr Prins
2015-07-31 17:00 ` Thompson, David
2015-09-15 13:24 ` Pjotr Prins
2015-09-15 19:05   ` Ludovic Courtès
2015-09-16  4:37     ` Pjotr Prins
2015-09-16 11:32       ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.