Add page showing latest build steps

[?]
Jul 10, 2015, 1:08 PM
TX7Q4RASUYPTHIHZFACQ227BIZYLNJGRA5HHIAFQWCL4FHEHVGPQC

Dependencies

  • [2] FHOH54HQ When searching a path / drv path, use separate queries for both options to prevent seq. scan.
  • [3] 6GZZDDQB Move the store path size chart to the job page
  • [4] AFNDUSGD Set Expires headers for Hydra's binary cache
  • [5] PH3DFCNU Render machine correctly if it doesn't contain @
  • [6] KDBWLKRP Index BuildSteps on propagatedFrom
  • [7] LCLXI7PT Search: Mark disabled projects/jobsets/jobs
  • [8] 24BMQDZA Start of single-process hydra-queue-runner
  • [9] YM27DTVT Remove superfluous HYDRA_LOGO environment variable
  • [10] HRAFVVOE make logo configurable via HYDRA_LOGO env var
  • [11] VH5ZABDR Add a page to show the latest evaluations for the entire server
  • [12] R6APT7HG Fix hydra_logo setting
  • [13] UICHT2PS Add a search feature
  • [14] WUCOEIFA Search: Limit the number of results
  • [15] 2GUAKGTB Fix indentation of build.tt
  • [16] GK326R5N Search: Don't return hidden projects/jobsets
  • [17] WXV6M6XN Add a convenient way to get logs of a path/drv. Requested by phreedom.
  • [18] EJ7C77C3 Allow searching for store and drv paths. Only does a complete match to reduce load on database.
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] LBNVQXUB * Build the /build stuff in a separate controller.
  • [*] CS7T2XFI
  • [*] IK53RV4V
  • [*] QCGCX2BR Generalize lazy tabs
  • [*] D5QIOJGP * Move everything up one directory.
  • [*] QL55ECJ6 - adapted ui for hydra, more in line with nixos.org website
  • [*] 4JS4DWHD All/recent builds -> Latest builds
  • [*] JZVRK5QJ Group some menu items together under a "Status" menu
  • [*] N22GPKYT * Put info about logs / build products in the DB.
  • [*] PMNWRTGJ Add multiple output support

Change contents

  • edit in src/lib/Hydra/Controller/Root.pm at line 293
    [7.843]
    [7.0]
    }
    sub steps :Local Args(0) {
    my ($self, $c) = @_;
    $c->stash->{template} = 'steps.tt';
    my $page = int($c->req->param('page') || "1") || 1;
    my $resultsPerPage = 20;
    $c->stash->{page} = $page;
    $c->stash->{resultsPerPage} = $resultsPerPage;
    $c->stash->{steps} = [ $c->model('DB::BuildSteps')->search(
    { starttime => { '!=', undef },
    stoptime => { '!=', undef }
    },
    { order_by => [ "stoptime desc" ],
    rows => $resultsPerPage,
    offset => ($page - 1) * $resultsPerPage
    }) ];
    $c->stash->{total} = approxTableSize($c, "IndexBuildStepsOnStopTime");
  • edit in src/lib/Hydra/Controller/Root.pm at line 367
    [2.285]
    [2.285]
    }
  • edit in src/lib/Hydra/Controller/Root.pm at line 369
    [7.266][7.416:418](),[2.286][7.416:418](),[7.353][7.416:418](),[7.709][7.416:418](),[7.843][7.416:418](),[7.905][7.416:418](),[7.416][7.416:418]()
    }
  • edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 26
    [4.105]
    [22.180]
    approxTableSize
  • edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 297
    [4.311]
    [4.311]
    }
    sub approxTableSize {
    my ($c, $name) = @_;
    return $c->model('DB')->schema->storage->dbh->selectrow_hashref(
    "select reltuples::int from pg_class where relname = lower(?)", { }, $name)->{"reltuples"};
  • replacement in src/root/build.tt at line 48
    [7.932][5.0:69]()
    <td>[% step.machine.split('@').1 || step.machine %]</td>
    [7.932]
    [7.985]
    <td>[% INCLUDE renderMachineName machine=step.machine %]</td>
  • edit in src/root/common.tt at line 646
    [3.2905]
    [24.679]
    BLOCK renderMachineName;
    machine ? stripSSHUser(machine).match('^([^\.]*)').0 : "localhost";
    END;
  • file addition: steps.tt (----------)
    [25.1486]
    [% WRAPPER layout.tt title="Latest steps" %]
    [% PROCESS common.tt %]
    <p>Showing steps [% (page - 1) * resultsPerPage + 1 %] - [% (page - 1)
    * resultsPerPage + steps.size %] of about [% total %] in
    order of descending finish time.</p>
    <table class="table table-striped table-condensed clickable-rows">
    <thead>
    <tr>
    <th></th>
    <th>What</th>
    <th>Job</th>
    <th>Build</th>
    <th>Step</th>
    <th>When</th>
    <th>Duration</th>
    <th>Machine</th>
    </tr>
    </thead>
    <tbody>
    [% FOREACH step IN steps %]
    <tr>
    <td>[% INCLUDE renderBuildStatusIcon buildstatus=step.status size=16 %]</td>
    <td><tt>[% step.drvpath.match('-(.*).drv').0 %]</tt></td>
    <td><tt>[% INCLUDE renderFullJobNameOfBuild build=step.build %]</tt></td>
    <td><a href="[% c.uri_for('/build' step.build.id) %]">[% step.build.id %]</a></td>
    <td><a class="row-link" href="[% c.uri_for('/build' step.build.id 'nixlog' step.stepnr 'tail-reload') %]">[% step.stepnr %]</a></td>
    <td>[% INCLUDE renderRelativeDate timestamp=step.stoptime %]</td>
    <td style="width: 10em">[% INCLUDE renderDuration duration = step.stoptime - step.starttime %] </td>
    <td><tt>[% INCLUDE renderMachineName machine=step.machine %]</tt></td>
    </tr>
    [% END %]
    </tbody>
    </table>
    [% INCLUDE renderPager %]
    [% END %]
  • edit in src/root/topbar.tt at line 34
    [27.80]
    [28.577]
    [% INCLUDE menuItem
    uri = c.uri_for(c.controller('Root').action_for('steps'))
    title = "Latest steps" %]
  • edit in src/sql/hydra.sql at line 598
    [6.109]
    [30.20632]
    create index IndexBuildStepsOnStopTime on BuildSteps(stopTime desc) where startTime is not null and stopTime is not null;
  • file addition: upgrade-37.sql (----------)
    [25.3004]
    create index IndexBuildStepsOnStopTime on BuildSteps(stopTime desc) where startTime is not null and stopTime is not null;