From 19e7114f0ee288057b2e33e3feee25b348645603 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 13 Apr 2015 14:36:00 +0200 Subject: [PATCH 01/16] Add channel as a product type. Currently I'm using a (not very well) downscaled version of the NixOS logo, so we want to replace it by a proper image ASAP. Other than that, the idea is to have something like this in hydra-build-products: file channel $out/channel.tar.bz2 Right now of course, it's only displayed at the corresponding builds, so we might want to have aggregates on all channels for a project, jobset or maybe even single jobs? Signed-off-by: aszlig --- src/root/product-list.tt | 2 ++ src/root/static/images/channel.png | Bin 0 -> 1634 bytes 2 files changed, 2 insertions(+) create mode 100644 src/root/static/images/channel.png diff --git a/src/root/product-list.tt b/src/root/product-list.tt index 7870834f..498818c2 100644 --- a/src/root/product-list.tt +++ b/src/root/product-list.tt @@ -136,6 +136,8 @@ ISO ISO-9660 CD/DVD image [% product.name %] [% CASE "binary-dist" %] Binary distribution Binary distribution [% product.name %] + [% CASE "channel" %] + Channel Channel expressions [% product.name %] [% CASE DEFAULT %] File [% product.name %] of type [% product.subtype %] [% END %] diff --git a/src/root/static/images/channel.png b/src/root/static/images/channel.png new file mode 100644 index 0000000000000000000000000000000000000000..73c296ec63d26cca6d1e9353c7f4e666ea82f96c GIT binary patch literal 1634 zcmZ`(dsGs58vTg^BEHgQbV$q6oHQ^%Z4k{-qe1XdrjDdy5Kt=O6T=57y6J}Fn&V@` zSBqn-H7Qz}&)JC`e4vgsjfSVxw8t4r63r}MIS&50f9(0r{q8yUe)rt}KJlqwvWXGO z2moM0@h6?uvE2>~VY;1`m9?THgA2Yvz5v|0iu}Zc?wBn9(?I}aIRYTM48Vp?61@f> z9Sgub0|24~0ITHM-ViUH0Xr8!CV}mpk^ZNtT&EzC{m-NUJ;H|_=;>Rwo9je4pAvKe z{>*Tnh1sDLj`cJEP&9?)8%9&KT%#xK4&ObLE4bL{HdUvhD+=KjKOzc9hDSF1_S@bJ zGd!CkiWQ+ONMf%w$3wq-OA*0mi%DTu_QjICUnxX>3l*PZm#0yda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HO)Uq_$4aB%50f6*=^OAGKUjffp!7 z7V}vd4b5K4g*BHyg6HmE4fqq<0W^;EYUnfFD?P|RLF2QTd=8P7%Fz+PV{vX6ECJ(+ z3&RnJICr8O_AnMt#A0n&n|J;vz)NDsozMLL0iO496J6koorch)^Lzm_l>-C cH;u(i=C~xKUZ~M}p>#)paw3={^JC=y1r-y<%>V!Z literal 0 HcmV?d00001 From 7b60aed5ed5133e759da3f7f1f9dff2ffd25ddd8 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 14 Apr 2015 08:58:55 +0200 Subject: [PATCH 02/16] jobset: Add a new "channels" tab. It's very similar to "jobs" and the code is pretty much the same, except that we don't do filtering on it. At least it doesn't waste space for a filter option when there are usually WAY less channel jobs than ordinary jobs. Signed-off-by: aszlig --- src/lib/Hydra/Controller/Jobset.pm | 40 ++++++++++++++++++++++++++++++ src/root/jobset-channels-tab.tt | 34 +++++++++++++++++++++++++ src/root/jobset.tt | 3 +++ 3 files changed, 77 insertions(+) create mode 100644 src/root/jobset-channels-tab.tt diff --git a/src/lib/Hydra/Controller/Jobset.pm b/src/lib/Hydra/Controller/Jobset.pm index 1d1cce63..d4a0eb5f 100644 --- a/src/lib/Hydra/Controller/Jobset.pm +++ b/src/lib/Hydra/Controller/Jobset.pm @@ -145,6 +145,46 @@ sub jobs_tab : Chained('jobsetChain') PathPart('jobs-tab') Args(0) { } +# XXX: Pretty much a rip-off of jobs-tab, make it DRY! +sub channels_tab : Chained('jobsetChain') PathPart('channels-tab') Args(0) { + my ($self, $c) = @_; + $c->stash->{template} = 'jobset-channels-tab.tt'; + + my @evals = $c->stash->{jobset}->jobsetevals->search( + { hasnewbuilds => 1}, + { order_by => "id desc", rows => 20 } + ); + + my $evals = {}; + my %channels; + + foreach my $eval (@evals) { + my @builds = $eval->builds->search( + { 'buildproducts.type' => 'file' + , 'buildproducts.subtype' => 'channel' }, + { join => ["buildproducts"] + , columns => ['id', 'job', 'finished', 'buildstatus'] } + ); + foreach my $b (@builds) { + my $jobName = $b->get_column('job'); + + $evals->{$eval->id}->{timestamp} = $eval->timestamp; + $evals->{$eval->id}->{channels}->{$jobName} = { + id => $b->id, + finished => $b->finished, + buildstatus => $b->buildstatus + }; + + $channels{$jobName} = 1; + } + } + + $c->stash->{evals} = $evals; + my @channels = sort (keys %channels); + $c->stash->{channels} = [@channels]; +} + + # Hydra::Base::Controller::ListBuilds needs this. sub get_builds : Chained('jobsetChain') PathPart('') CaptureArgs(0) { my ($self, $c) = @_; diff --git a/src/root/jobset-channels-tab.tt b/src/root/jobset-channels-tab.tt new file mode 100644 index 00000000..2a5f72a5 --- /dev/null +++ b/src/root/jobset-channels-tab.tt @@ -0,0 +1,34 @@ +[% PROCESS common.tt %] + +[% IF channels.size == 0 %] + +
There are no channels available.
+ +[% ELSE %] + + [% evalIds = evals.keys.nsort.reverse %] + + + + + [% FOREACH eval IN evalIds %] + + [% END %] + + + + [% FOREACH chan IN channels-%] + + + [% FOREACH eval IN evalIds %] + + [% END %] + + [% END %] + +
Channel +
[% INCLUDE renderJobName project=project.name jobset=jobset.name job=chan %][% r = evals.$eval.channels.$chan; IF r.id %][% INCLUDE renderBuildStatusIcon size=16 build=r %][% END %]
+ +[% END %] diff --git a/src/root/jobset.tt b/src/root/jobset.tt index 63ef29b9..04b0efaf 100644 --- a/src/root/jobset.tt +++ b/src/root/jobset.tt @@ -64,6 +64,7 @@
  • Jobs
  • Configuration
  • Links
  • +
  • Channels
  • @@ -165,6 +166,8 @@
    + [% INCLUDE makeLazyTab tabName="tabs-channels" uri=c.uri_for('/jobset' project.name jobset.name "channels-tab") %] +