diff --git a/src/lib/Hydra/View/TT.pm b/src/lib/Hydra/View/TT.pm index d24ca0865..483b02508 100644 --- a/src/lib/Hydra/View/TT.pm +++ b/src/lib/Hydra/View/TT.pm @@ -8,7 +8,7 @@ __PACKAGE__->config( TEMPLATE_EXTENSION => '.tt', PRE_CHOMP => 1, POST_CHOMP => 1, - expose_methods => [qw/buildLogExists buildStepLogExists/]); + expose_methods => [qw/buildLogExists buildStepLogExists jobExists/]); sub buildLogExists { my ($self, $c, $build) = @_; @@ -22,4 +22,15 @@ sub buildStepLogExists { return defined findLog($c, $step->drvpath, @outPaths); } +# Check whether the given job is a member of the most recent jobset +# evaluation. +sub jobExists { + my ($self, $c, $job) = @_; + my $latestEval = $job->jobset->jobsetevals->search( + { hasnewbuilds => 1}, + { rows => 1, order_by => ["id desc"] })->single; + return 0 if !defined $latestEval; # can't happen + return scalar($latestEval->builds->search({ job => $job->name })) != 0; +} + 1; diff --git a/src/root/dashboard.tt b/src/root/dashboard.tt index 07e48eb5b..efb35af1e 100644 --- a/src/root/dashboard.tt +++ b/src/root/dashboard.tt @@ -22,7 +22,7 @@ [% FOREACH j IN starredJobs %] - [% INCLUDE renderFullJobName project=j.job.get_column('project') jobset=j.job.get_column('jobset') job=j.job.name %] + [% INCLUDE renderFullJobName project=j.job.get_column('project') jobset=j.job.get_column('jobset') job=j.job.name %] [% FOREACH b IN j.builds %] [% INCLUDE renderBuildStatusIcon size=16 build=b %] [% END %] diff --git a/src/root/job.tt b/src/root/job.tt index 44ff7d153..bce2b7d71 100644 --- a/src/root/job.tt +++ b/src/root/job.tt @@ -5,6 +5,13 @@ [% PROCESS common.tt %] [% hideProjectName=1 hideJobsetName=1 hideJobName=1 %] +[% IF !jobExists(job) %] +
This job is not a member of the latest evaluation of its jobset. This means it was +removed or had an evaluation error.
+[% END %] +