From 578530dac2c06e6d14eed943054632287b8cff7e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 21 Feb 2012 17:16:32 +0100 Subject: [PATCH] Don't show duplicate builds in "Related builds" Since a build may be a member of multiple jobset evaluations, we need to do a "select distinct" here. But maybe we should only show builds from a single evaluation (e.g. the most recent), since showing builds from several may be confusing. --- src/lib/Hydra/Controller/Build.pm | 2 +- src/root/build.tt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 8eec30f9..d09e6129 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -83,7 +83,7 @@ sub view_build : Chained('build') PathPart('') Args(0) { my $r = joinWithResultInfo( $c, $c->model('DB::Builds'))->search( { eval => { -in => $build->jobsetevalmembers->get_column('eval')->as_query } } - , { join => 'jobsetevalmembers', order_by => [ 'project', 'jobset', 'job'] } + , { join => 'jobsetevalmembers', order_by => [ 'project', 'jobset', 'job'], distinct => 1 } ); if ($r->count <= 100) { $c->stash->{relatedbuilds} = [$r->all]; diff --git a/src/root/build.tt b/src/root/build.tt index e3d5b88f..ee704fb8 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -437,6 +437,7 @@

Related builds

+

The following builds are part of the same jobset evaluation that produced this build.

[% INCLUDE renderBuildList builds=relatedbuilds%]
[% END %]