Builds page: show RunCommand logs

[?]
Nov 19, 2021, 8:21 PM
55CWVPVZVSSGQ544IRQVB6IVRTHEIOUDZ2N6WOVNU2MED3DXBVQQC

Dependencies

  • [2] DLOYLDGX builds page: capitalize tabs (#1072)
  • [3] VCOSLZRP
  • [4] VBWHG272 Re-add the history tab (store size and build time), now as lazy-loaded tab on build page.
  • [5] ZI535LI6 * hydra: 'new' UI for project/jobset/job/build
  • [6] 3PNG7NIB Remove trailing whitespace
  • [7] 2GUAKGTB Fix indentation of build.tt
  • [*] LBNVQXUB * Build the /build stuff in a separate controller.
  • [*] O5DYTVGA Add jobset/job menus on buid log pages
  • [*] PMNWRTGJ Add multiple output support
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] ASIRNHAH Load the dependency tabs on demand
  • [*] XTKCALUA Make "Add to release" a modal dialog

Change contents

  • edit in src/lib/Hydra/Controller/Build.pm at line 40
    [10.102]
    [11.1608]
    $c->stash->{runcommandlogs} = [$c->stash->{build}->runcommandlogs->search({}, {order_by => ["id DESC"]})];
  • edit in src/root/build.tt at line 152
    [2.572]
    [3.2164]
    <li class="nav-item"><a class="nav-link" href="#tabs-runcommandlogs" data-toggle="tab">RunCommand Logs</a></li>
  • replacement in src/root/build.tt at line 481
    [3.14396][3.13179:13191]()
    [% END %]
    [3.14396]
    [3.21230]
    [% END %]
  • edit in src/root/build.tt at line 490
    [3.17966]
    [13.470]
    <div id="tabs-runcommandlogs" class="tab-pane">
    <div class="d-flex flex-column">
    [% FOREACH runcommandlog IN runcommandlogs %]
    <div class="p-2 border-bottom">
    <div class="d-flex flex-row">
    <div class="d-flex flex-column" style="padding: 10px; width: 50px;">
    [% IF runcommandlog.did_succeed() %]
    <img src="[% c.uri_for("/static/images/emojione-check-2714.svg") %]" height="30" width="30" title="Succeeded" alt="Succeeded" class="build-status" />
    [% ELSIF runcommandlog.is_running() %]
  • edit in src/root/build.tt at line 501
    [13.471]
    [14.843]
    [% ELSE %]
    <img src="[% c.uri_for("/static/images/emojione-red-x-274c.svg") %]" height="30" width="30" title="Failed" alt="Failed" class="build-status" />
    [% END %]
    </div>
    <div class="d-flex flex-column mr-auto align-self-center">
    <div><tt>[% runcommandlog.command | html%]</tt></div>
    <div>
    [% IF not runcommandlog.is_running() %]
    [% IF runcommandlog.did_fail_with_signal() %]
    Exit signal: [% runcommandlog.signal %]
    [% IF runcommandlog.core_dumped %]
    (Core Dumped)
    [% END %]
    [% ELSIF runcommandlog.did_fail_with_exec_error() %]
    Exec error: [% runcommandlog.error_number %]
    [% ELSIF not runcommandlog.did_succeed() %]
    Exit code: [% runcommandlog.exit_code %]
    [% END %]
    [% END %]
    </div>
    </div>
    <div class="d-flex flex-column align-items-end">
    [% IF runcommandlog.start_time != undef %]
    <div>Started at [% INCLUDE renderDateTime timestamp = runcommandlog.start_time; %]</div>
    [% IF runcommandlog.end_time != undef %]
    <div>Ran for [% INCLUDE renderDuration duration = runcommandlog.end_time - runcommandlog.start_time %]</div>
    [% ELSE %]
    <div>Running for [% INCLUDE renderDuration duration = curTime - runcommandlog.start_time %]</div>
    [% END %]
    [% ELSE %]
    <div>Pending</div>
    [% END %]
    </div>
    </div>
    </div>
    [% END %]
    </div>
    </div>