From d0ad3fd80673be0569f61708552eb40ed947ec6d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 6 Dec 2016 14:25:09 +0100 Subject: [PATCH] Revert "Remove the global channel" This reverts commit 2f6c2f5622e18b39828528eea1470d78eaec2dc1. This unintentionally also removed /all, which is actually somewhat useful. --- src/lib/Hydra/Controller/Root.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm index 955b09e7..8a90eb9f 100644 --- a/src/lib/Hydra/Controller/Root.pm +++ b/src/lib/Hydra/Controller/Root.pm @@ -3,9 +3,9 @@ package Hydra::Controller::Root; use utf8; use strict; use warnings; +use base 'Hydra::Base::Controller::ListBuilds'; use Hydra::Helper::Nix; use Hydra::Helper::CatalystUtils; -use base 'Hydra::Base::Controller::REST'; use Digest::SHA1 qw(sha1_hex); use Nix::Store; use Nix::Config; @@ -192,6 +192,16 @@ sub machines :Local Args(0) { } +# Hydra::Base::Controller::ListBuilds needs this. +sub get_builds : Chained('/') PathPart('') CaptureArgs(0) { + my ($self, $c) = @_; + $c->stash->{allBuilds} = $c->model('DB::Builds'); + $c->stash->{latestSucceeded} = $c->model('DB')->resultset('LatestSucceeded'); + $c->stash->{channelBaseName} = "everything"; + $c->stash->{total} = $c->model('DB::NrBuilds')->find('finished')->count; +} + + sub robots_txt : Path('robots.txt') { my ($self, $c) = @_; $c->stash->{'plain'} = { data => "User-agent: *\nDisallow: /*\n" };