Jobset page: Add a new tab to show job status in a matrix

[?]
Aug 28, 2013, 9:59 AM
AK2UZDS2IRVBZP3GRNZS2SIKMKEFUBPIVSA45EZBH4UYFKWI2HCAC

Dependencies

  • [2] 225GEK4N After editing a project/jobset, redirect back to the config tab
  • [3] EVYSAFB2 Transpose the aggregate constituents table
  • [4] TFK74CQR Put job status on a separate tab
  • [5] 6QRHXIM3 * Speed up the jobset index page. Especially the query to get the
  • [6] QTC3SYBM Jobset page: Load the jobs and status tabs on demand
  • [7] CQQSJLON On aggregate job pages, show a matrix showing all the constituent builds
  • [8] J3RYO2CU Remove the jobs status page
  • [9] M4TBFHHJ "limit" -> "rows"
  • [10] OX6NYJDV Split viewing and editing a jobset
  • [*] DEMSSSB2 * Controller for jobs which inherits all actions in ListBuilds. So
  • [*] 3HZY24CX * Make jobsets viewable under
  • [*] TJPIS3UP hydra: minor improvements in hydra ui
  • [*] D5QIOJGP * Move everything up one directory.
  • [*] ODNCGFQ5 * Improved the navigation bar: don't include all projects (since that
  • [*] 3PNG7NIB Remove trailing whitespace

Change contents

  • replacement in src/lib/Hydra/Controller/Job.pm at line 55
    [3.198][4.739:819](),[4.739][4.739:819]()
    { id => $b->id, finished => $b->finished, buildstatus => $b->buildstatus};
    [3.198]
    [4.819]
    { id => $b->id, finished => $b->finished, buildstatus => $b->buildstatus };
  • edit in src/lib/Hydra/Controller/Jobset.pm at line 158
    [4.596]
    [4.596]
    $c->stash->{activeJobs} = {};
  • replacement in src/lib/Hydra/Controller/Jobset.pm at line 164
    [4.867][4.867:922]()
    push @{$c->stash->{activeJobs}}, $job;
    [4.867]
    [4.922]
    $c->stash->{activeJobs}->{$job} = 1;
  • replacement in src/lib/Hydra/Controller/Jobset.pm at line 170
    [4.1041][4.1041:1089](),[4.1089][4.763:832](),[4.763][4.763:832]()
    if (!defined $activeJobs{$job->name}) {
    push @{$c->stash->{inactiveJobs}}, $job->name;
    }
    [4.1041]
    [4.1858]
    push @{$c->stash->{jobs}}, $job->name;
    }
    }
    sub job_status_tab : Chained('jobsetChain') PathPart('job-status-tab') Args(0) {
    my ($self, $c) = @_;
    $c->stash->{template} = 'jobset-job-status-tab.tt';
    $c->stash->{filter} = $c->request->params->{filter} // "";
    my @evals = $c->stash->{jobset}->jobsetevals->search({ hasnewbuilds => 1}, { order_by => "id desc", rows => 20 });
    my $evals = {};
    my %jobs;
    my $nrBuilds = 0;
    foreach my $eval (@evals) {
    my @builds = $eval->builds->search(
    { job => { ilike => "%" . $c->stash->{filter} . "%" } },
    { columns => ['id', 'job', 'finished', 'buildstatus'] });
    foreach my $b (@builds) {
    my $jobName = $b->get_column('job');
    $evals->{$eval->id}->{$jobName} =
    { id => $b->id, finished => $b->finished, buildstatus => $b->buildstatus };
    $jobs{$jobName} = 1;
    $nrBuilds++;
    }
    last if $nrBuilds >= 10000;
  • edit in src/lib/Hydra/Controller/Jobset.pm at line 200
    [4.1864]
    [14.396]
    $c->stash->{evals} = $evals;
    $c->stash->{jobs} = [sort (keys %jobs)];
  • file addition: jobset-job-status-tab.tt (----------)
    [15.1486]
    [% PROCESS common.tt; USE Math %]
    <form class="form-search" id="filter-jobs">
    <input name="filter" type="text" class="input-large search-query" placeholder="Filter jobs..." [% HTML.attributes(value => filter) %]></input>
    </form>
    <script>
    $('#filter-jobs').submit(function() {
    $('#tabs-job-status').load("[% c.uri_for('/jobset' project.name jobset.name "job-status-tab") %]", $('#filter-jobs').serialize(), function(response, status, xhr) {
    if (status == "error") {
    $('#[% tabName %]').html("<div class='alert alert-error'>Error loading tab: " + xhr.status + " " + xhr.statusText + "</div>");
    }
    });
    return false;
    });
    </script>
    [% IF jobs.size == 0 %]
    <div class="alert">There are no matching jobs.</div>
    [% ELSE %]
    [% evalIds = evals.keys.nsort.reverse %]
    <table class="table table-striped table-condensed table-header-rotated">
    <thead>
    <tr>
    <th style="width: 1em;">Job</th>
    [% FOREACH eval IN evalIds %]
    <th class="rotate-45">
    <div><span>
    <a href="[% c.uri_for('/eval' eval) %]">[% eval %]</a>
    </span></div></th>
    [% END %]
    </tr>
    </thead>
    <tbody>
    [% FOREACH j IN jobs-%]
    <tr>
    <th>[% INCLUDE renderJobName project=project.name jobset=jobset.name job=j %]</th>
    [% FOREACH eval IN evalIds %]
    <td>[% r = evals.$eval.$j; IF r.id %]<a href="[% c.uri_for('/build' r.id) %]">[% INCLUDE renderBuildStatusIcon size=16 build=r %]</a>[% END %]</td>
    [% END %]
    </tr>
    [% END %]
    </tbody>
    </table>
    [% END %]
  • replacement in src/root/jobset-jobs-tab.tt at line 3
    [4.2253][4.2253:2544]()
    <p>This jobset currently contains the following [% activeJobs.size %] jobs:
    <blockquote>
    [% IF activeJobs.size == 0 %]<em>(none)</em>[% END %]
    [% FOREACH j IN activeJobs %][% INCLUDE renderJobName project=project.name jobset=jobset.name job=j %]<br/>[% END %]
    </blockquote>
    </p>
    [4.2253]
    [4.2544]
    [% IF jobs.size == 0 %]
    <div class="alert">This jobset has no jobs yet.</div>
    [% ELSE %]
    <div class="well well-small">Below is the list of all [% jobs.size
    %] jobs that have ever existed in this jobset. Jobs that are no
    longer part of the jobset (i.e., that don't appear in the latest
    evaluation of the jobset) are <span class="muted">grayed out</span>.</div>
  • replacement in src/root/jobset-jobs-tab.tt at line 11
    [4.2545][4.2545:2839]()
    <p>This jobset used to contain the following [% inactiveJobs.size %] jobs:
    <blockquote>
    [% IF inactiveJobs.size == 0 %]<em>(none)</em>[% END %]
    [% FOREACH j IN inactiveJobs %][% INCLUDE renderJobName project=project.name jobset=jobset.name job=j %]<br/>[% END %]
    </blockquote>
    </p>
    [4.2545]
    <table class="table table-striped table-condensed">
    <thead>
    <tr><th>Job name</th></tr>
    </thead>
    <tbody>
    [% FOREACH j IN jobs %]<tr><td><span class="[% IF !activeJobs.$j %]muted override-link[% END %]">[% INCLUDE renderJobName project=project.name jobset=jobset.name job=j %]</span></td></tr>[% END %]
    </tbody>
    </table>
    [% END %]
  • replacement in src/root/jobset.tt at line 46
    [4.6699][4.6699:6817]()
    <li><a href="#tabs-errors" data-toggle="tab"><img src="/static/images/error_16.png" /> Evaluation errors</a></li>
    [4.6699]
    [4.6817]
    <li><a href="#tabs-errors" data-toggle="tab"><span class="text-warning">Evaluation errors</span></a></li>
  • replacement in src/root/jobset.tt at line 48
    [4.210][4.3830:3889]()
    <li><a href="#tabs-jobs" data-toggle="tab">Jobs</a></li>
    [4.6829]
    [2.210]
    <li><a href="#tabs-job-status" data-toggle="tab">Job status</a></li>
    <li><a href="#tabs-jobs" data-toggle="tab">All jobs</a></li>
  • edit in src/root/jobset.tt at line 144
    [17.30687]
    [4.10749]
    [% INCLUDE makeLazyTab tabName="tabs-job-status" uri=c.uri_for('/jobset' project.name jobset.name "job-status-tab") %]