Add a "My jobsets" tab to the dashboard

[?]
Nov 5, 2013, 3:05 PM
ZB3JV52WEKVFX4XGSQUX6PCM4XGF62MCQRZAAOKNK4JNGYO2P7QAC

Dependencies

  • [2] VG4QG336 Remove tablesorter
  • [3] RYS3FRDN Don't show bogus last-checked times
  • [4] ZH6B56XR Try harder to find build logs
  • [5] GS4SFHCP templates: Use uri_for to reference static paths.
  • [6] CGVHVQOJ In the "My jobs" tab, ignore disabled projects/jobsets
  • [7] BIVZGPUT Optimise clickable rows
  • [8] T7Z63K6T hydra: moves jobsetOverview sub
  • [9] 6GEU36HW Remove obsolete CSS classes
  • [10] WNQRX7QB Doh
  • [11] AJVCB6K6 Fix a "Argument isn't numeric" warning if there are not jobsets
  • [12] 5EIPRLDD export logContents
  • [13] 3PNG7NIB Remove trailing whitespace
  • [14] MCCHPWHE Indicate disabled/hidden projects/jobsets in the overviews
  • [15] HPEG2RHV Merge the BuildResultInfo table into the Builds table
  • [16] IN272KZW * Automatically keep all builds in the latest successful release in
  • [17] NP6QUCL7 * Fix indentation.
  • [18] XBU2ODSP * More renaming.
  • [19] Y6AHH4TH Remove the logfile and logSize columns from the database
  • [20] RBHHV7P7 * Read logs using logContents function in stead of handling it everywhere separately.
  • [21] PMNWRTGJ Add multiple output support
  • [22] JY7BXXOP Split viewing and editing a project
  • [23] PPJN6SDP * paging for releases page
  • [24] VH5ZABDR Add a page to show the latest evaluations for the entire server
  • [25] F5RYSE7T qualify order by column
  • [26] PZL3SZM3 Give every page a consistent title
  • [*] XJRJ4J7M Add user registration
  • [*] PF72JKWQ Add a "My jobs" tab to the dashboard
  • [*] 2GK5DOU7 * Downloading closures.
  • [*] MOX7XJ2E Merge the BuildSchedulingInfo table into the Builds table
  • [*] IK53RV4V
  • [*] KSBB33RE Add a dashboard
  • [*] QCGCX2BR Generalize lazy tabs
  • [*] D5QIOJGP * Move everything up one directory.
  • [*] 7YBYT2LQ

Change contents

  • edit in src/lib/Hydra/Controller/User.pm at line 311
    [6.170]
    [29.501]
    }
    sub my_jobsets_tab :Chained('user') :PathPart('my-jobsets-tab') :Args(0) {
    my ($self, $c) = @_;
    $c->stash->{template} = 'dashboard-my-jobsets-tab.tt';
    my $jobsets = $c->model('DB::Jobsets')->search(
    { "project.enabled" => 1, "me.enabled" => 1,
    , owner => $c->stash->{user}->username
    },
    { order_by => ["project", "name"]
    , join => ["project"]
    });
    $c->stash->{jobsets} = [jobsetOverview_($c, $jobsets)];
  • replacement in src/lib/Hydra/Helper/Nix.pm at line 20
    [7.48][4.1298:1370]()
    jobsetOverview removeAsciiEscapes getDrvLogPath findLog logContents
    [7.48]
    [7.844]
    jobsetOverview jobsetOverview_
    removeAsciiEscapes getDrvLogPath findLog logContents
  • replacement in src/lib/Hydra/Helper/Nix.pm at line 177
    [7.5274][7.101:122](),[7.2925][7.101:122](),[7.122][7.0:119]()
    sub jobsetOverview {
    my ($c, $project) = @_;
    return $project->jobsets->search( isProjectOwner($c, $project) ? {} : { hidden => 0 },
    [7.5274]
    [7.119]
    sub jobsetOverview_ {
    my ($c, $jobsets) = @_;
    return $jobsets->search({},
  • edit in src/lib/Hydra/Helper/Nix.pm at line 189
    [31.4003]
    [7.1004]
    }
    sub jobsetOverview {
    my ($c, $project) = @_;
    my $jobsets = $project->jobsets->search(isProjectOwner($c, $project) ? {} : { hidden => 0 });
    return jobsetOverview_($c, $jobsets);
  • edit in src/root/common.tt at line 466
    [33.5621]
    [33.5621]
  • edit in src/root/common.tt at line 468
    [33.5622]
    [34.679]
    BLOCK renderJobsetOverview %]
    <table class="table table-striped table-condensed clickable-rows">
    <thead>
    <tr>
    <th></th>
    <th>Name</th>
    <th>Description</th>
    <th>Last evaluated</th>
    <th colspan="2">Success</th>
    </tr>
    </thead>
    <tbody>
    [% FOREACH j IN jobsets %]
    [% successrate = 0 %]
    <tr>
    <td>
    [% IF j.get_column('nrscheduled') > 0 %]
    <img src="[% c.uri_for("/static/images/help_16.png") %]" alt="Scheduled" />
    [% ELSIF j.get_column('nrfailed') == 0 %]
    <img src="[% c.uri_for("/static/images/checkmark_16.png") %]" alt="Succeeded" />
    [% ELSIF j.get_column('nrfailed') > 0 && j.get_column('nrsucceeded') > 0 %]
    <img src="[% c.uri_for("/static/images/error_some_16.png") %]" alt="Some Failed" />
    [% ELSE %]
    <img src="[% c.uri_for("/static/images/error_16.png") %]" alt="All Failed" />
    [% END %]
    </td>
    <td><span class="[% IF !j.enabled %]disabled-jobset[% END %] [%+ IF j.hidden %]hidden-jobset[% END %]">[% IF showProject; INCLUDE renderFullJobsetName project=j.get_column('project') jobset=j.name inRow=1; ELSE; INCLUDE renderJobsetName project=j.get_column('project') jobset=j.name inRow=1; END %]</span></td>
    <td>[% HTML.escape(j.description) %]</td>
    <td>[% IF j.lastcheckedtime; INCLUDE renderDateTime timestamp = j.lastcheckedtime; ELSE; "-"; END %]</td>
    [% IF j.get_column('nrtotal') > 0 %]
    [% successrate = ( j.get_column('nrsucceeded') / j.get_column('nrtotal') )*100 %]
    [% IF j.get_column('nrscheduled') > 0 %]
    [% class = 'label' %]
    [% ELSIF successrate < 25 %]
    [% class = 'label label-important' %]
    [% ELSIF successrate < 75 %]
    [% class = 'label label-warning' %]
    [% ELSIF successrate <= 100 %]
    [% class = 'label label-success' %]
    [% END %]
    [% END %]
    <td><span class="[% class %]">[% successrate FILTER format('%d') %]%</span></td>
    <td>
    [% IF j.get_column('nrsucceeded') > 0 %]
    <span class="label label-success">[% j.get_column('nrsucceeded') %]</span>
    [% END %]
    [% IF j.get_column('nrfailed') > 0 %]
    <span class="label label-important">[% j.get_column('nrfailed') %]</span>
    [% END %]
    [% IF j.get_column('nrscheduled') > 0 %]
    <span class="label label">[% j.get_column('nrscheduled') %]</span>
    [% END %]
    </td>
    </tr>
    [% END %]
    </tbody>
    </table>
    [% END;
  • replacement in src/root/dashboard-my-jobs-tab.tt at line 14
    [7.421][7.421:424]()
    [7.421]
    [7.424]
  • file addition: dashboard-my-jobsets-tab.tt (----------)
    [35.1486]
    [% PROCESS common.tt %]
    [% IF builds.size == 0 %]
    <div class="alert alert-warning">You are not the owner of any
    jobset.</div>
    [% ELSE %]
    [% INCLUDE renderJobsetOverview showProject=1 %]
    [% END %]
  • edit in src/root/dashboard.tt at line 7
    [29.571]
    [33.5808]
    <li><a href="#tabs-my-jobsets" data-toggle="tab">My jobsets</a></li>
  • edit in src/root/dashboard.tt at line 45
    [29.857]
    [29.857]
    [% INCLUDE makeLazyTab tabName="tabs-my-jobsets" uri=c.uri_for(c.controller('User').action_for('my_jobsets_tab'), [user.username]) %]
  • replacement in src/root/project.tt at line 33
    [7.2954][7.33134:33135](),[7.33134][7.33134:33135](),[7.33135][2.770:843](),[2.843][7.3025:3332](),[7.1815][7.3025:3332](),[7.3025][7.3025:3332](),[7.3332][7.1816:1833](),[7.706][7.3499:3575](),[7.1833][7.3499:3575](),[7.3499][7.3499:3575](),[7.3575][5.3595:3689](),[5.3689][7.3650:3709](),[7.3650][7.3650:3709](),[7.3709][5.3690:3789](),[5.3789][7.3789:3881](),[7.3789][7.3789:3881](),[7.3881][5.3790:3892](),[5.3892][7.3964:3991](),[7.3964][7.3964:3991](),[7.3991][5.3893:3989](),[5.3989][7.33458:33484](),[7.4068][7.33458:33484](),[7.33458][7.33458:33484](),[7.33484][7.4069:4089](),[7.4089][7.1834:2037](),[7.372][7.4182:4238](),[7.2037][7.4182:4238](),[7.4182][7.4182:4238](),[7.4238][3.0:120](),[3.120][7.4320:5637](),[7.4320][7.4320:5637](),[7.5637][7.35416:35417](),[7.35416][7.35416:35417]()
    <table class="table table-striped table-condensed clickable-rows">
    <thead>
    <tr>
    <th></th>
    <th>Id</th>
    <th>Description</th>
    <th>Last evaluated</th>
    <th colspan="2">Success</th>
    </tr>
    </thead>
    <tbody>
    [% FOREACH j IN jobsets %]
    [% successrate = 0 %]
    <tr>
    <td>
    [% IF j.get_column('nrscheduled') > 0 %]
    <img src="[% c.uri_for("/static/images/help_16.png") %]" alt="Scheduled" />
    [% ELSIF j.get_column('nrfailed') == 0 %]
    <img src="[% c.uri_for("/static/images/checkmark_16.png") %]" alt="Succeeded" />
    [% ELSIF j.get_column('nrfailed') > 0 && j.get_column('nrsucceeded') > 0 %]
    <img src="[% c.uri_for("/static/images/error_some_16.png") %]" alt="Some Failed" />
    [% ELSE %]
    <img src="[% c.uri_for("/static/images/error_16.png") %]" alt="All Failed" />
    [% END %]
    </td>
    <td><span class="[% IF !j.enabled %]disabled-jobset[% END %] [%+ IF j.hidden %]hidden-jobset[% END %]">[% INCLUDE renderJobsetName project=project.name jobset=j.name inRow=1 %]</span></td>
    <td>[% HTML.escape(j.description) %]</td>
    <td>[% IF j.lastcheckedtime; INCLUDE renderDateTime timestamp = j.lastcheckedtime; ELSE; "-"; END %]</td>
    [% IF j.get_column('nrtotal') > 0 %]
    [% successrate = ( j.get_column('nrsucceeded') / j.get_column('nrtotal') )*100 %]
    [% IF j.get_column('nrscheduled') > 0 %]
    [% class = 'label' %]
    [% ELSIF successrate < 25 %]
    [% class = 'label label-important' %]
    [% ELSIF successrate < 75 %]
    [% class = 'label label-warning' %]
    [% ELSIF successrate <= 100 %]
    [% class = 'label label-success' %]
    [% END %]
    [% END %]
    <td><span class="[% class %]">[% successrate FILTER format('%d') %]%</span></td>
    <td>
    [% IF j.get_column('nrsucceeded') > 0 %]
    <span class="label label-success">[% j.get_column('nrsucceeded') %]</span>
    [% END %]
    [% IF j.get_column('nrfailed') > 0 %]
    <span class="label label-important">[% j.get_column('nrfailed') %]</span>
    [% END %]
    [% IF j.get_column('nrscheduled') > 0 %]
    <span class="label label">[% j.get_column('nrscheduled') %]</span>
    [% END %]
    </td>
    </tr>
    [% END %]
    </tbody>
    </table>
    [7.2954]
    [7.5638]
    [% INCLUDE renderJobsetOverview %]