Allow build to be bumped to the front of the queue via the web interface
Builds now have a "Bump up" action. This will cause the queue runner to prioritise the steps of the build above all other steps.
This commit is contained in:
@ -475,6 +475,23 @@ sub keep : Chained('buildChain') PathPart Args(1) {
|
||||
}
|
||||
|
||||
|
||||
sub bump : Chained('buildChain') PathPart('bump') {
|
||||
my ($self, $c, $x) = @_;
|
||||
|
||||
my $build = $c->stash->{build};
|
||||
|
||||
requireProjectOwner($c, $build->project); # FIXME: require admin?
|
||||
|
||||
$c->model('DB')->schema->txn_do(sub {
|
||||
$build->update({globalpriority => time()});
|
||||
});
|
||||
|
||||
$c->flash->{successMsg} = "Build has been bumped to the front of the queue.";
|
||||
|
||||
$c->res->redirect($c->uri_for($self->action_for("build"), $c->req->captures));
|
||||
}
|
||||
|
||||
|
||||
sub add_to_release : Chained('buildChain') PathPart('add-to-release') Args(0) {
|
||||
my ($self, $c) = @_;
|
||||
|
||||
|
@ -88,7 +88,7 @@ sub queue_GET {
|
||||
$c->stash->{flashMsg} //= $c->flash->{buildMsg};
|
||||
$self->status_ok(
|
||||
$c,
|
||||
entity => [$c->model('DB::Builds')->search({finished => 0}, { order_by => ["id"]})]
|
||||
entity => [$c->model('DB::Builds')->search({finished => 0}, { order_by => ["globalpriority desc", "id"]})]
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user