* Show the latest build for each job.

[?]
Oct 28, 2008, 12:44 PM
ELCI5T2ALF37VXYM5POHPO3CAMMPRB65BXGDRVUAZG53NKKLGIEAC

Dependencies

Change contents

  • replacement in src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm at line 32
    [3.1449][3.1449:1507]()
    $c->stash->{builds} = [$c->model('DB::Builds')->all];
    [3.1449]
    [3.1507]
    $c->stash->{allBuilds} = [$c->model('DB::Builds')->all];
    # Get the latest build for each unique job.
    # select * from builds as x where timestamp == (select max(timestamp) from builds where name == x.name);
    $c->stash->{latestBuilds} = [$c->model('DB::Builds')->search(undef, {order_by => "name", where => "timestamp == (select max(timestamp) from builds where name == me.name)"})];
  • replacement in src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm at line 50
    [3.1760][3.1760:1765]()
    [3.1760]
    [3.1765]
  • edit in src/HydraFrontend/root/index.tt at line 3
    [3.10776]
    [3.10776]
    <h1>Job status</h1>
    <table>
    <tr><th></th><th>Id</th><th>Attribute name</th><th>Timestamp</th><th>Description</th></tr>
    [% FOREACH build IN latestBuilds -%]
    [% INCLUDE "short-build-info.tt" %]
    [% END -%]
    </table>
  • edit in src/HydraFrontend/root/index.tt at line 14
    [3.10797]
    [3.10797]
    <p>Number of builds: [% allBuilds.size %]</p>
  • replacement in src/HydraFrontend/root/index.tt at line 19
    [2.93][3.10890:10930](),[3.10890][3.10890:10930](),[3.10930][2.94:280](),[2.280][3.10930:11151](),[3.10930][3.10930:11151]()
    [% FOREACH build IN builds -%]
    <tr>
    <td>
    [% IF build.buildstatus == 0 %]
    <img src="static/images/success.gif" />
    [% ELSE %]
    <img src="static/images/failure.gif" />
    [% END %]
    </td>
    <td><a href="[% c.uri_for('/build' build.id) %]">[% build.id %]</a></td>
    <td>[% build.name %]</td>
    <td>[% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %]</td>
    <td>[% build.description %]</td>
    </tr>
    [2.93]
    [3.11151]
    [% FOREACH build IN allBuilds -%]
    [% INCLUDE "short-build-info.tt" %]