* Allow builds to be restarted (if they failed with a transient error,

[?]
Mar 2, 2009, 4:03 PM
A52HEFHQNVNF2OUSWDSUYVVXLYR2UFCGOORPCN27CJJYA4UDJA3AC

Dependencies

  • [2] XHVZXX6N
  • [3] OD5FSS5A * Quick hack to allow viewing of dependency graphs (via nix-store -q
  • [4] CS7T2XFI
  • [5] 5IK6NYKF
  • [6] DR4F6YUT
  • [7] LBNVQXUB * Build the /build stuff in a separate controller.
  • [8] 5NO7NCKT * Refactoring.
  • [9] EYNG4EL4 * Regenerate the bindings from a clean sqlite database.
  • [10] S66BOMVU * Added authentication.
  • [11] GC4LTHDI * Check the owner.
  • [12] G6HJY2V4
  • [13] CLJQCY2X * Store info about all the build actions and allow them to be
  • [14] YTZOC7C5 * Editing of jobset inputs.
  • [15] UVMFS73T * Some jQuery / CSS hackery.
  • [16] WHAFVCEI
  • [17] BD3GRK4B * Get rid of "positive failures" and separate log phases.
  • [18] 7LKUAIGC
  • [19] 2AUODJBT
  • [20] JLDUSNUO * Unify rendering of finished and scheduled builds.
  • [21] IK53RV4V
  • [22] RU7AQO7U * Role-based access control. Only admins can create projects. Only
  • [23] 2AIIYGI5 * Show job status and all builds for a project.
  • [24] FHF6IZJQ * Basic release management: releases are now dynamically computed as
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] L2E6EVE2 * Merged the Build and Job tables.
  • [*] PHX2HIVG * Store info about the build inputs in the build record.

Change contents

  • edit in src/Hydra/lib/Hydra/Controller/Build.pm at line 33
    [3.61]
    [5.941]
    $c->stash->{flashMsg} = $c->flash->{afterRestart};
  • edit in src/Hydra/lib/Hydra/Controller/Build.pm at line 156
    [2.482]
    [5.3293]
    }
    sub restart : Chained('build') PathPart('restart') Args(0) {
    my ($self, $c) = @_;
    my $build = $c->stash->{build};
    requireProjectOwner($c, $build->project);
    error($c, "This build cannot be restarted.")
    unless $build->finished && $build->resultInfo->buildstatus == 3;
    $c->model('DB')->schema->txn_do(sub {
    $build->finished(0);
    $build->timestamp(time());
    $build->update;
    $build->resultInfo->delete;
    $c->model('DB::BuildSchedulingInfo')->create(
    { id => $build->id
    , priority => 0 # don't know the original priority anymore...
    , busy => 0
    , locker => ""
    });
    });
    $c->flash->{afterRestart} = "Build has been restarted.";
    $c->response->redirect($c->uri_for($self->action_for("view_build"), $c->req->captures));
  • edit in src/Hydra/lib/Hydra/Controller/Root.pm at line 82
    [5.1178][5.1178:1318]()
    }
    sub requireLogin {
    my ($c) = @_;
    $c->flash->{afterLogin} = $c->request->uri;
    $c->response->redirect($c->uri_for('/login'));
  • edit in src/Hydra/lib/Hydra/Controller/Root.pm at line 225
    [5.84][5.873:927](),[5.873][5.873:927]()
    return requireLogin($c) if !$c->user_exists;
  • replacement in src/Hydra/lib/Hydra/Controller/Root.pm at line 226
    [5.928][5.1995:2088](),[5.2088][5.0:101](),[5.1028][5.0:101]()
    error($c, "Only the project owner or the administrator can perform this operation.")
    unless $c->check_user_roles('admin') || $c->user->username eq $project->owner->username;
    [5.928]
    [5.1119]
    requireProjectOwner($c, $project);
  • edit in src/Hydra/lib/Hydra/Controller/Root.pm at line 264
    [5.495][5.495:545]()
    return requireLogin($c) if !$c->user_exists;
  • replacement in src/Hydra/lib/Hydra/Controller/Root.pm at line 265
    [5.546][5.2141:2230](),[5.2230][5.102:199](),[5.642][5.102:199]()
    error($c, "Only the project owner or the administrator can perform this operation.")
    unless $c->check_user_roles('admin') || $c->user->username eq $project->owner->username;
    [5.546]
    [5.729]
    requireProjectOwner($c, $project);
  • edit in src/Hydra/lib/Hydra/Controller/Root.pm at line 457
    [5.1233][5.213:267](),[5.213][5.213:267]()
    return requireLogin($c) if !$c->user_exists;
  • replacement in src/Hydra/lib/Hydra/Controller/Root.pm at line 458
    [5.228][5.2982:3075](),[5.3075][5.200:301](),[5.328][5.200:301]()
    error($c, "Only the project owner or the administrator can perform this operation.")
    unless $c->check_user_roles('admin') || $c->user->username eq $project->owner->username;
    [5.228]
    [5.267]
    requireProjectOwner($c, $project);
  • replacement in src/Hydra/lib/Hydra/Controller/Root.pm at line 493
    [5.4][5.1157:1206]()
    return requireLogin($c) if !$c->user_exists;
    [5.4]
    [5.420]
    requireLogin($c) if !$c->user_exists;
  • edit in src/Hydra/lib/Hydra/Helper/CatalystUtils.pm at line 10
    [4.153]
    [4.153]
    requireLogin requireProjectOwner
  • replacement in src/Hydra/lib/Hydra/Helper/CatalystUtils.pm at line 25
    [5.3767][5.3767:3783]()
    $c->detach;
    [5.3767]
    [5.3783]
    $c->detach; # doesn't return
  • edit in src/Hydra/lib/Hydra/Helper/CatalystUtils.pm at line 36
    [5.4358]
    [4.184]
    sub requireLogin {
    my ($c) = @_;
    $c->flash->{afterLogin} = $c->request->uri;
    $c->response->redirect($c->uri_for('/login'));
    $c->detach; # doesn't return
    }
    sub requireProjectOwner {
    my ($c, $project) = @_;
    requireLogin($c) if !$c->user_exists;
    error($c, "Only the project owner or the administrator can perform this operation.")
    unless $c->check_user_roles('admin') || $c->user->username eq $project->owner->username;
    }
  • edit in src/Hydra/root/build.tt at line 16
    [27.5757]
    [28.2182]
    [% IF flashMsg %]
    <p class="error">[% flashMsg %]</p>
    [% END %]
  • replacement in src/Hydra/root/build.tt at line 39
    [5.602][5.2103:2176]()
    <span class="error">Build returned a non-zero exit code</span>
    [5.602]
    [5.2176]
    <span class="error">Build returned a non-zero exit code</span>
  • edit in src/Hydra/root/build.tt at line 47
    [5.2449]
    [5.775]
    <form action="[% c.uri_for('/build' build.id 'restart') %]" method="post" class="inline">
    <button id="delete-project" type="submit">Restart</button>
    </form>
  • replacement in src/Hydra/root/static/css/hydra.css at line 439
    [5.3181][5.3181:3182]()
    }
    [5.3181]
    }
    form.inline {
    display: inline;
    }