Simplify jobset cloning

[?]
Oct 3, 2013, 5:26 PM
ZFEN2MAOJRRQEIORSK2N6PNAWGBEN2WNAWA6IWUVOHP5I5PQC6JAC

Dependencies

  • [2] HNUZZHS4 Allow dots in jobset names (like "release-13.09")
  • [3] 4NTIBJ74 Implement DELETE for jobsets and use it in the web interface
  • [4] TQVKZQUG Use the REST API in the web interface for editing jobsets
  • [5] AK2UZDS2 Jobset page: Add a new tab to show job status in a matrix
  • [6] LFVXESGI Remove already disabled jobstatus code
  • [7] KKJNJHO5 Update bootstrap to 2.0.3
  • [8] QTC3SYBM Jobset page: Load the jobs and status tabs on demand
  • [9] PZL3SZM3 Give every page a consistent title
  • [10] VG4QG336 Remove tablesorter
  • [11] U72VNKRU Remove unused file
  • [12] FV2M6MOT hydra: use autoconf/-make
  • [13] PVIRRARJ Turn hiding/unhiding a jobset into a checkbox
  • [14] VS3OUK7D if no emailoverride specified, use empty string
  • [15] JOVVHIJX Remove all entry points to modify machines
  • [16] D7PL2VWU Move more actions from the top bar
  • [17] XDDCO6CH * hydra: add dependency list with links to logfiles
  • [18] QL55ECJ6 - adapted ui for hydra, more in line with nixos.org website
  • [19] 2BUX775I * More release -> view.
  • [20] 3JBUMW3E forgot to commit a file
  • [21] AS2OXLRM * Editing releases.
  • [22] U4TD3AIQ Add support for viewing jobset evaluations
  • [23] EFWN7JBV * Added a status page that shows all the currently executing build steps.
  • [24] 36M6DGIT Show the runtime/build dependencies in the build page
  • [25] UICHT2PS Add a search feature
  • [26] UMFB2767 Hydra/64: Leaving number of builds empty gives DBIx error
  • [27] 64IV56HI Replace bootstrap tarball
  • [28] RBNQKATL * Adding persistant releases. A release is a named set of builds.
  • [29] WRIU3S5E * UI for cloning builds (not functional yet).
  • [30] 6FRLEP4P first try for timeline of last 24 hours in hydra
  • [31] 5DSDXORD hydra: missing plain.tt
  • [32] TRDGNILT Remove unused file
  • [33] R2PON6R7 Allow non-admin users to see the machine status page
  • [34] 3PNG7NIB Remove trailing whitespace
  • [35] OX6NYJDV Split viewing and editing a jobset
  • [36] P5X4P6VK * Renaming "release sets" to "views" (not finished yet). Having
  • [37] HQGXL4MX Add validation for project and jobset names
  • [38] KJC7RKIE Speed up the jobset eval list a bit
  • [39] 3KU4L7L3 remove buildonlylatest propery, which was committed by accident
  • [40] TNMOG2ZQ Indentation
  • [41] ZCTQCN3E Use inputTypes from plugins to determine valid input types
  • [42] SZYDW2DG hydra: added some user admin
  • [43] A6XVP6FE Make the hide/unhide actions a checkbox in the project settings
  • [44] RSEGBU6C Hydra/20: Jobset clone feature
  • [45] OOQ2D3KC * Refactoring: move fetchInput out of hydra_scheduler into a separate
  • [46] 3HZY24CX * Make jobsets viewable under
  • [47] 75XUS62Y * Added a page to quickly see all failed builds and failed evaluations
  • [48] JY7BXXOP Split viewing and editing a project
  • [49] NEQ4BISO Add bootstrap.zip
  • [50] G2WXEQHE Remove the Errors page
  • [51] GEADFVZ5 hydra-queue-runner: Improved scheduling
  • [52] ZWCTAZGL added newsitems, added some admin options to clear various caches.
  • [53] ODNCGFQ5 * Improved the navigation bar: don't include all projects (since that
  • [54] D7X6XTKQ Integrate the "Job status" and "All jobs" tabs
  • [55] UWVMQIAC * Refactoring.
  • [56] RWFCW6ZN In the jobset evals lists, show what inputs changed between consecutive evals
  • [57] VH5ZABDR Add a page to show the latest evaluations for the entire server
  • [58] KXGOUX7P * Creating releases.
  • [59] VJFLX7B6 Fix rendering of jobset inputs
  • [60] DAPOSS44 Use the REST API in the web interface for editing projects
  • [61] D5QIOJGP * Move everything up one directory.
  • [62] HZWUT4YN Allow users to reproduce builds on their own systems
  • [63] SMTMFEKE hydra: add missing templates
  • [64] LZVO64YG Merge in the first bits of the API work
  • [65] 2G63HKCH Fix some wellformedness issues
  • [66] KG5AMUMG Cleanup
  • [67] LSZLZHJY Allow users to edit their own settings
  • [68] KYSBJAYN Allow dashes in jobset input names
  • [69] OR5SJ42Y Show releases in a tab on the project page
  • [70] HFJPPMTU Cleanup
  • [71] J3RYO2CU Remove the jobs status page

Change contents

  • edit in src/lib/Hydra/Controller/Jobset.pm at line 152
    [5.705]
    [5.795]
    $c->stash->{clone} = defined $c->stash->{params}->{clone};
  • replacement in src/lib/Hydra/Controller/Jobset.pm at line 213
    [5.185][5.2314:2355](),[5.2314][5.2314:2355](),[5.2355][5.12196:12900]()
    # Process the inputs of this jobset.
    unless (defined $c->stash->{params}->{inputs}) {
    $c->stash->{params}->{inputs} = {};
    foreach my $param (keys %{$c->stash->{params}}) {
    next unless $param =~ /^input-(\w+)-name$/;
    my $baseName = $1;
    next if $baseName eq "template";
    $c->stash->{params}->{inputs}->{$c->stash->{params}->{$param}} = { type => $c->stash->{params}->{"input-$baseName-type"}, values => $c->stash->{params}->{"input-$baseName-values"} };
    unless ($baseName =~ /^\d+$/) { # non-numeric base name is an existing entry
    $c->stash->{params}->{inputs}->{$c->stash->{params}->{$param}}->{oldName} = $baseName;
    }
    }
    }
    [5.2285]
    [5.2579]
    # Set the inputs of this jobset.
    $jobset->jobsetinputs->delete;
  • replacement in src/lib/Hydra/Controller/Jobset.pm at line 216
    [5.2580][5.12901:13038](),[5.13038][4.1475:1577]()
    foreach my $inputName (keys %{$c->stash->{params}->{inputs}}) {
    my $inputData = $c->stash->{params}->{inputs}->{$inputName};
    error($c, "Invalid input name ‘$inputName’.") unless $inputName =~ /^[[:alpha:]][\w-]*$/;
    [5.2580]
    [5.2750]
    foreach my $param (keys %{$c->stash->{params}}) {
    next unless $param =~ /^input-(\w+)-name$/;
    my $baseName = $1;
    next if $baseName eq "template";
    my $name = $c->stash->{params}->{$param};
    my $type = $c->stash->{params}->{"input-$baseName-type"};
    my $values = $c->stash->{params}->{"input-$baseName-values"};
  • replacement in src/lib/Hydra/Controller/Jobset.pm at line 224
    [5.2751][5.13132:13176]()
    my $inputType = $inputData->{type};
    [5.2751]
    [5.0]
    error($c, "Invalid input name ‘$name’.") unless $name =~ /^[[:alpha:]][\w-]*$/;
    error($c, "Invalid input type ‘$type’.") unless defined $c->stash->{inputTypes}->{$type};
  • replacement in src/lib/Hydra/Controller/Jobset.pm at line 227
    [5.1][4.1578:1690]()
    error($c, "Invalid input type ‘$inputType’.") unless defined $c->stash->{inputTypes}->{$inputType};
    [5.1]
    [5.186]
    my $input = $jobset->jobsetinputs->create({ name => $name, type => $type });
  • replacement in src/lib/Hydra/Controller/Jobset.pm at line 229
    [5.187][5.3147:3166](),[5.3147][5.3147:3166](),[5.3166][5.13583:13694](),[5.13694][5.3311:3447](),[5.3311][5.3311:3447](),[5.3447][5.13695:13785](),[5.2527][5.3526:3808](),[5.13785][5.3526:3808](),[5.3526][5.3526:3808](),[5.3808][5.13786:13829](),[5.2598][5.3879:3984](),[5.13829][5.3879:3984](),[5.3879][5.3879:3984]()
    my $input;
    unless (defined $inputData->{oldName}) {
    $input = $jobset->jobsetinputs->update_or_create(
    { name => $inputName
    , type => $inputType
    });
    } else { # it's an existing input
    $input = ($jobset->jobsetinputs->search({name => $inputData->{oldName}}))[0];
    die unless defined $input;
    $input->update({name => $inputName, type => $inputType});
    }
    # Update the values for this input. Just delete all the
    # current ones, then create the new values.
    $input->jobsetinputalts->delete_all;
    my $values = $inputData->{values};
    $values = [] unless defined $values;
    $values = [$values] unless ref($values) eq 'ARRAY';
    [5.187]
    [5.3984]
    # Set the values for this input.
    my @values = ref($values) eq 'ARRAY' ? @{$values} : ($values);
  • replacement in src/lib/Hydra/Controller/Jobset.pm at line 232
    [5.4007][5.4007:4048](),[5.4048][5.2599:2661]()
    foreach my $value (@{$values}) {
    $value = checkInputValue($c, $inputType, $value);
    [5.4007]
    [5.4272]
    foreach my $value (@values) {
    $value = checkInputValue($c, $type, $value);
  • edit in src/lib/Hydra/Controller/Jobset.pm at line 237
    [5.4371][5.4371:4484](),[5.4484][5.13830:13915](),[5.13915][5.4549:4555](),[5.4549][5.4549:4555]()
    # Get rid of deleted inputs.
    my @inputs = $jobset->jobsetinputs->all;
    foreach my $input (@inputs) {
    $input->delete unless defined $c->stash->{params}->{inputs}->{$input->name};
    }
  • replacement in src/lib/Hydra/Controller/Jobset.pm at line 243
    [5.88][5.88:173]()
    my $jobset = $c->stash->{jobset};
    requireProjectOwner($c, $jobset->project);
    [5.88]
    [5.173]
    requireProjectOwner($c, $c->stash->{project});
  • replacement in src/lib/Hydra/Controller/Jobset.pm at line 245
    [5.174][5.174:221]()
    $c->stash->{template} = 'clone-jobset.tt';
    [5.174]
    [5.1137]
    $c->stash->{template} = 'edit-jobset.tt';
    $c->stash->{clone} = 1;
    $c->stash->{totalShares} = getTotalShares($c->model('DB')->schema);
  • edit in src/lib/Hydra/Controller/Jobset.pm at line 251
    [5.139][5.13980:14057](),[5.14057][5.294:319](),[5.294][5.294:319](),[5.319][5.1140:1141](),[5.1140][5.1140:1141](),[5.1141][5.320:427](),[5.427][5.14058:14123](),[5.14123][2.0:93](),[2.93][5.594:595](),[5.261][5.594:595](),[5.594][5.594:595](),[5.595][5.262:281](),[5.281][5.207:249](),[5.207][5.207:249](),[5.249][5.282:375](),[5.375][5.757:936](),[5.757][5.757:936](),[5.308][5.308:358](),[5.358][5.77:137](),[5.987][5.77:137](),[5.137][5.359:376](),[5.376][5.1066:1118](),[5.1066][5.1066:1118](),[5.1118][5.376:483](),[5.483][5.1225:1426](),[5.1225][5.1225:1426](),[5.1426][5.377:378](),[5.378][5.484:608](),[5.380][5.1560:1562](),[5.477][5.1560:1562](),[5.713][5.1560:1562](),[5.967][5.1560:1562](),[5.1495][5.1560:1562](),[5.1560][5.1560:1562](),[5.1562][5.37:39]()
    sub clone_submit : Chained('jobsetChain') PathPart('clone/submit') Args(0) {
    my ($self, $c) = @_;
    my $jobset = $c->stash->{jobset};
    requireProjectOwner($c, $jobset->project);
    requirePost($c);
    my $newJobsetName = trim $c->stash->{params}->{"newjobset"};
    error($c, "Invalid jobset name: $newJobsetName") if $newJobsetName !~ /^$jobsetNameRE$/;
    my $newJobset;
    txn_do($c->model('DB')->schema, sub {
    $newJobset = $jobset->project->jobsets->create(
    { name => $newJobsetName
    , description => $jobset->description
    , nixexprpath => $jobset->nixexprpath
    , nixexprinput => $jobset->nixexprinput
    , enabled => 0
    , enableemail => $jobset->enableemail
    , emailoverride => $jobset->emailoverride || ""
    });
    foreach my $input ($jobset->jobsetinputs) {
    my $newinput = $newJobset->jobsetinputs->create({name => $input->name, type => $input->type});
    foreach my $inputalt ($input->jobsetinputalts) {
    $newinput->jobsetinputalts->create({altnr => $inputalt->altnr, value => $inputalt->value});
    }
    }
    });
    $c->res->redirect($c->uri_for($c->controller('Jobset')->action_for("edit"), [$jobset->project->name, $newJobsetName]));
    }
  • file deletion: clone-jobset.tt (----------)
    [5.1486][5.2041:2080](),[5.2080][5.1567:1567]()
    [% WRAPPER layout.tt title="Clone jobset $jobset.project.name:$jobset.name" %]
    [% PROCESS common.tt %]
    [% USE HTML %]
    [% edit=1 %]
    <form class="form-horizontal" action="[% c.uri_for('/jobset' jobset.project.name jobset.name 'clone' 'submit') %]" method="post">
    <fieldset>
    <div class="control-group">
    <label class="control-label">New name</label>
    <div class="controls">
    <input type="text" class="span3" name="newjobset" value=""/>
    </div>
    </div>
    <div class="form-actions">
    <input type="submit" value="Submit" class="btn btn-primary" />
    </div>
    </form>
    [% END %]
    </fieldset>
  • replacement in src/root/edit-jobset.tt at line 1
    [5.367][5.368:496]()
    [% WRAPPER layout.tt title=(create ? "Create jobset in project $project.name" : "Editing jobset $project.name:$jobset.name") %]
    [5.367]
    [5.496]
    [% WRAPPER layout.tt title=(create ? "Create jobset in project $project.name" : clone ? "Cloning jobset $project.name:$jobset.name" : "Editing jobset $project.name:$jobset.name") %]
  • replacement in src/root/edit-jobset.tt at line 67
    [5.2855][5.1366:1465]()
    <input type="text" class="span3" name="name" [% HTML.attributes(value => jobset.name) %]/>
    [5.2855]
    [5.2961]
    <input type="text" class="span3" name="name" [% HTML.attributes(value => clone ? "" : jobset.name) %]/>
  • replacement in src/root/edit-jobset.tt at line 135
    [5.4510][4.1827:1995]()
    <button id="submit-jobset" type="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i> [%IF create %]Create[% ELSE %]Apply changes[% END %]</button>
    [5.4510]
    [5.4659]
    <button id="submit-jobset" type="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i> [%IF create || clone %]Create jobset[% ELSE %]Apply changes[% END %]</button>
  • replacement in src/root/edit-jobset.tt at line 171
    [4.2763][4.2763:2785]()
    [% IF create %]
    [4.2763]
    [4.2785]
    [% IF create || clone %]
  • replacement in src/root/edit-project.tt at line 59
    [5.2269][5.2269:2330]()
    [%IF create %]Create[% ELSE %]Apply changes[% END %]
    [5.2269]
    [5.1721]
    [%IF create %]Create project[% ELSE %]Apply changes[% END %]
  • replacement in src/root/jobset.tt at line 54
    [3.905][3.905:1020]()
    [% INCLUDE menuItem title="Clone this jobset" uri=c.uri_for('/jobset' project.name jobset.name 'clone') %]
    [3.905]
    [3.1020]
    [% INCLUDE menuItem title="Clone this jobset" uri=c.uri_for(c.controller('Jobset').action_for('edit'), [project.name, jobset.name], { clone => 1 }) %]