Simplify jobset cloning
[?]
Oct 3, 2013, 5:26 PM
ZFEN2MAOJRRQEIORSK2N6PNAWGBEN2WNAWA6IWUVOHP5I5PQC6JACDependencies
- [2]
HNUZZHS4Allow dots in jobset names (like "release-13.09") - [3]
4NTIBJ74Implement DELETE for jobsets and use it in the web interface - [4]
TQVKZQUGUse the REST API in the web interface for editing jobsets - [5]
D7PL2VWUMove more actions from the top bar - [6]
LFVXESGIRemove already disabled jobstatus code - [7]
3HZY24CX* Make jobsets viewable under - [8]
RWFCW6ZNIn the jobset evals lists, show what inputs changed between consecutive evals - [9]
36M6DGITShow the runtime/build dependencies in the build page - [10]
KKJNJHO5Update bootstrap to 2.0.3 - [11]
GEADFVZ5hydra-queue-runner: Improved scheduling - [12]
TNMOG2ZQIndentation - [13]
UICHT2PSAdd a search feature - [14]
OOQ2D3KC* Refactoring: move fetchInput out of hydra_scheduler into a separate - [15]
QL55ECJ6- adapted ui for hydra, more in line with nixos.org website - [16]
R2PON6R7Allow non-admin users to see the machine status page - [17]
ZCTQCN3EUse inputTypes from plugins to determine valid input types - [18]
KYSBJAYNAllow dashes in jobset input names - [19]
3JBUMW3Eforgot to commit a file - [20]
PZL3SZM3Give every page a consistent title - [21]
RSEGBU6CHydra/20: Jobset clone feature - [22]
VS3OUK7Dif no emailoverride specified, use empty string - [23]
P5X4P6VK* Renaming "release sets" to "views" (not finished yet). Having - [24]
AS2OXLRM* Editing releases. - [25]
5DSDXORDhydra: missing plain.tt - [26]
HZWUT4YNAllow users to reproduce builds on their own systems - [27]
U72VNKRURemove unused file - [28]
2BUX775I* More release -> view. - [29]
LZVO64YGMerge in the first bits of the API work - [30]
QTC3SYBMJobset page: Load the jobs and status tabs on demand - [31]
KJC7RKIESpeed up the jobset eval list a bit - [32]
VJFLX7B6Fix rendering of jobset inputs - [33]
ODNCGFQ5* Improved the navigation bar: don't include all projects (since that - [34]
XDDCO6CH* hydra: add dependency list with links to logfiles - [35]
RBNQKATL* Adding persistant releases. A release is a named set of builds. - [36]
HFJPPMTUCleanup - [37]
HQGXL4MXAdd validation for project and jobset names - [38]
NEQ4BISOAdd bootstrap.zip - [39]
VG4QG336Remove tablesorter - [40]
2G63HKCHFix some wellformedness issues - [41]
KXGOUX7P* Creating releases. - [42]
JY7BXXOPSplit viewing and editing a project - [43]
D7X6XTKQIntegrate the "Job status" and "All jobs" tabs - [44]
DAPOSS44Use the REST API in the web interface for editing projects - [45]
U4TD3AIQAdd support for viewing jobset evaluations - [46]
TRDGNILTRemove unused file - [47]
AK2UZDS2Jobset page: Add a new tab to show job status in a matrix - [48]
D5QIOJGP* Move everything up one directory. - [49]
EFWN7JBV* Added a status page that shows all the currently executing build steps. - [50]
KG5AMUMGCleanup - [51]
OR5SJ42YShow releases in a tab on the project page - [52]
J3RYO2CURemove the jobs status page - [53]
JOVVHIJXRemove all entry points to modify machines - [54]
FV2M6MOThydra: use autoconf/-make - [55]
A6XVP6FEMake the hide/unhide actions a checkbox in the project settings - [56]
WRIU3S5E* UI for cloning builds (not functional yet). - [57]
PVIRRARJTurn hiding/unhiding a jobset into a checkbox - [58]
SZYDW2DGhydra: added some user admin - [59]
LSZLZHJYAllow users to edit their own settings - [60]
ZWCTAZGLadded newsitems, added some admin options to clear various caches. - [61]
3KU4L7L3remove buildonlylatest propery, which was committed by accident - [62]
75XUS62Y* Added a page to quickly see all failed builds and failed evaluations - [63]
G2WXEQHERemove the Errors page - [64]
UWVMQIAC* Refactoring. - [65]
UMFB2767Hydra/64: Leaving number of builds empty gives DBIx error - [66]
64IV56HIReplace bootstrap tarball - [67]
VH5ZABDRAdd a page to show the latest evaluations for the entire server - [68]
3PNG7NIBRemove trailing whitespace - [69]
OX6NYJDVSplit viewing and editing a jobset - [70]
6FRLEP4Pfirst try for timeline of last 24 hours in hydra - [71]
SMTMFEKEhydra: add missing templates
Change contents
- edit in src/lib/Hydra/Controller/Jobset.pm at line 152
$c->stash->{clone} = defined $c->stash->{params}->{clone}; - replacement in src/lib/Hydra/Controller/Jobset.pm at line 213
# 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;}}}# Set the inputs of this jobset.$jobset->jobsetinputs->delete; - replacement in src/lib/Hydra/Controller/Jobset.pm at line 216
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-]*$/;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
my $inputType = $inputData->{type};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
error($c, "Invalid input type ‘$inputType’.") unless defined $c->stash->{inputTypes}->{$inputType};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';# 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
foreach my $value (@{$values}) {$value = checkInputValue($c, $inputType, $value);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
my $jobset = $c->stash->{jobset};requireProjectOwner($c, $jobset->project);requireProjectOwner($c, $c->stash->{project}); - replacement in src/lib/Hydra/Controller/Jobset.pm at line 245
$c->stash->{template} = 'clone-jobset.tt';$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
[% 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
[% WRAPPER layout.tt title=(create ? "Create jobset in project $project.name" : "Editing jobset $project.name:$jobset.name") %][% 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
<input type="text" class="span3" name="name" [% HTML.attributes(value => jobset.name) %]/><input type="text" class="span3" name="name" [% HTML.attributes(value => clone ? "" : jobset.name) %]/> - replacement in src/root/edit-jobset.tt at line 135
<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><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
[% IF create %][% IF create || clone %] - replacement in src/root/edit-project.tt at line 59
[%IF create %]Create[% ELSE %]Apply changes[% END %][%IF create %]Create project[% ELSE %]Apply changes[% END %] - replacement in src/root/jobset.tt at line 54
[% INCLUDE menuItem title="Clone this jobset" uri=c.uri_for('/jobset' project.name jobset.name 'clone') %][% INCLUDE menuItem title="Clone this jobset" uri=c.uri_for(c.controller('Jobset').action_for('edit'), [project.name, jobset.name], { clone => 1 }) %]