feat: add /eval/<id>/builds endpoint

This endpoint allows efficient retrieval of all the builds in an
evaluation, without making a request for each single build.
This commit is contained in:
Benno Fünfstück 2018-01-14 01:26:31 +01:00
parent a4fc292c83
commit 3ab5d299c1

View file

@ -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;