From 262f068e26464da94c98c45ccb4a9bb4cbdbd7e0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 2 Apr 2012 23:25:07 +0200 Subject: [PATCH] Support obtaining the contents of an evaluation as a channel E.g. http://hydra.nixos.org/eval/552513/channel The advantage of such a channel is that all builds come from the same evaluation, and thus are consistent. --- src/lib/Hydra/Controller/JobsetEval.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Controller/JobsetEval.pm b/src/lib/Hydra/Controller/JobsetEval.pm index 11bf9fa3..39417678 100644 --- a/src/lib/Hydra/Controller/JobsetEval.pm +++ b/src/lib/Hydra/Controller/JobsetEval.pm @@ -2,7 +2,7 @@ package Hydra::Controller::JobsetEval; use strict; use warnings; -use base 'Catalyst::Controller'; +use base 'Hydra::Base::Controller::NixChannel'; use Hydra::Helper::Nix; use Hydra::Helper::CatalystUtils; @@ -99,4 +99,14 @@ sub view : Chained('eval') PathPart('') Args(0) { } +# Hydra::Base::Controller::NixChannel needs this. +sub nix : Chained('eval') PathPart('channel') CaptureArgs(0) { + my ($self, $c) = @_; + $c->stash->{channelName} = $c->stash->{project}->name . "-" . $c->stash->{jobset}->name . "-latest"; + $c->stash->{channelBuilds} = $c->stash->{eval}->builds + ->search_literal("exists (select 1 from buildproducts where build = build.id and type = 'nix-build')") + ->search({ finished => 1, buildstatus => 0 }, { columns => [@buildListColumns, 'drvpath', 'outpath', 'description', 'homepage'] }); +} + + 1;