From 3ab5d299c13f961146751d1d3faa392993804c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benno=20F=C3=BCnfst=C3=BCck?= Date: Sun, 14 Jan 2018 01:26:31 +0100 Subject: [PATCH] feat: add /eval//builds endpoint This endpoint allows efficient retrieval of all the builds in an evaluation, without making a request for each single build. --- src/lib/Hydra/Controller/JobsetEval.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/Hydra/Controller/JobsetEval.pm b/src/lib/Hydra/Controller/JobsetEval.pm index 21e3f731..12af29c2 100644 --- a/src/lib/Hydra/Controller/JobsetEval.pm +++ b/src/lib/Hydra/Controller/JobsetEval.pm @@ -264,4 +264,15 @@ sub store_paths : Chained('evalChain') PathPart('store-paths') Args(0) { } +# Return full info about all the builds in this evaluation. +sub all_builds : Chained('evalChain') PathPart('builds') Args(0) { + my ($self, $c) = @_; + my @builds = $c->stash->{eval}->builds; + $self->status_ok( + $c, + entity => [@builds], + ); +} + + 1;