Allow bumping an entire evaluation to the front of the queue

[?]
Aug 10, 2015, 4:56 PM
MZ63OVKPTSGREE3JSDCJVJY2VQ7FU76ZMTQBBJSRAUOYFJA6UPIAC

Dependencies

  • [2] VHV6GI4L Add a jobset eval action to restart all aborted/cancelled builds
  • [3] UQA4FMUA Allow a jobset to be created from an evaluation
  • [4] W74RIXTJ Show inputs and input changes on the jobset eval page
  • [5] 6HWHYPSW Add an action menu to evaluations
  • [6] UOINKJ2J Add an action to cancel all builds in a jobset eval
  • [*] U4TD3AIQ Add support for viewing jobset evaluations
  • [*] T273UOB7 Support obtaining the contents of an evaluation as a channel

Change contents

  • edit in src/lib/Hydra/Controller/JobsetEval.pm at line 190
    [4.1059]
    [9.53]
    sub bump : Chained('eval') PathPart('bump') Args(0) {
    my ($self, $c) = @_;
    requireProjectOwner($c, $c->stash->{eval}->project); # FIXME: require admin?
    my $builds = $c->stash->{eval}->builds->search({ finished => 0 });
    my $n = $builds->count();
    $c->model('DB')->schema->txn_do(sub {
    $builds->update({globalpriority => time()});
    });
    $c->flash->{successMsg} = "$n builds have been bumped to the front of the queue.";
    $c->res->redirect($c->uri_for($c->controller('JobsetEval')->action_for('view'), $c->req->captures));
    }
  • replacement in src/root/jobset-eval.tt at line 50
    [3.1905][4.1621:1756](),[4.353][4.1621:1756](),[4.1756][2.1656:1799]()
    <li><a href="[% c.uri_for(c.controller('JobsetEval').action_for('cancel'), [eval.id]) %]">Cancel all scheduled builds</a></li>
    <li><a href="[% c.uri_for(c.controller('JobsetEval').action_for('restart_aborted'), [eval.id]) %]">Restart all aborted builds</a></li>
    [3.1905]
    [4.353]
    [% IF unfinished.size > 0 %]
    <li><a href="[% c.uri_for(c.controller('JobsetEval').action_for('cancel'), [eval.id]) %]">Cancel all scheduled builds</a></li>
    [% END %]
    [% IF aborted.size > 0 %]
    <li><a href="[% c.uri_for(c.controller('JobsetEval').action_for('restart_aborted'), [eval.id]) %]">Restart all aborted builds</a></li>
    [% END %]
    [% IF unfinished.size > 0 %]
    <li><a href="[% c.uri_for(c.controller('JobsetEval').action_for('bump'), [eval.id]) %]">Bump builds to front of queue</a></li>
    [% END %]