Enable declarative projects.
[?]
Mar 11, 2016, 11:14 PM
6WRGCITDYP7JIBYP25QIWCHWRJWFPDP2D3TJS3WO3KUHQQJAWHMQCDependencies
- [2]
NS7SND6Rhydra-evaluator: Send statistics to statsd - [3]
DGHAIZTOMake cloning of jobsets work again. - [4]
FCTX433OAdd buildStarted plugin hook - [5]
OK4P3AMKRemove the ability to add multiple jobset input alternatives - [6]
BXHG3HYLWhen renaming a jobset, add a redirect from the old name - [7]
24BMQDZAStart of single-process hydra-queue-runner - [8]
PCKLFRT5Support push notification of repository changes - [9]
T5BIOVJEAdd support for tracking custom metrics - [10]
X27GNHDV* Basic job info in the database. - [11]
7ECJWNVXCleanup Project model - [12]
W5OAZWPDDrop the errorMsg column in the Jobs table - [13]
YU6CND7CRemove support for views - [14]
BMSQD2ZHIndentation - [15]
XJRJ4J7MAdd user registration - [16]
Y6AHH4THRemove the logfile and logSize columns from the database - [17]
HQGXL4MXAdd validation for project and jobset names - [18]
RPTSGIRCEliminate duplicate getPreviousBuild functions - [19]
LZVO64YGMerge in the first bits of the API work - [20]
KSBB33REAdd a dashboard - [21]
PCD3ZH6ZPartially revert 1c20cfdf2403feb78cef515faf15c04d5c9f17bd - [22]
JAH3UPWASupport revision control systems via plugins - [*]
3HZY24CX* Make jobsets viewable under - [*]
4NTIBJ74Implement DELETE for jobsets and use it in the web interface - [*]
FPK5LF53* Put the project-related actions in a separate controller. Put the - [*]
ODNCGFQ5* Improved the navigation bar: don't include all projects (since that - [*]
7UJ5YV4V* Provide a channel for each project containing all the latest - [*]
OOQ2D3KC* Refactoring: move fetchInput out of hydra_scheduler into a separate - [*]
OSVLMLCQhydra: factored out build restart and - [*]
VHV6GI4LAdd a jobset eval action to restart all aborted/cancelled builds - [*]
LBNVQXUB* Build the /build stuff in a separate controller. - [*]
JM3DPYOMgenerated schema with new dbix class schema loader, grrrrrr - [*]
V4RNHJNR* Add a link to each project's homepage. Suggested by karltk. - [*]
SB2V735VKeep track of the database schema version - [*]
JY7BXXOPSplit viewing and editing a project - [*]
2G63HKCHFix some wellformedness issues - [*]
A6XVP6FEMake the hide/unhide actions a checkbox in the project settings - [*]
D7PL2VWUMove more actions from the top bar - [*]
77BG3TYKUse c.req.captures - [*]
7YBYT2LQ - [*]
N22GPKYT* Put info about logs / build products in the DB. - [*]
ZDENAYQI* email notification of evaluation errors to project owner (if desired) - [*]
OVR2RWBIhydra-evaluator: Always pick the jobset that hasn't been evaluated longest - [*]
FDE3BJAP* Refactoring. - [*]
IE2PRAQUhydra-queue-runner: Send build notifications - [*]
KN3VYE5P* Cleaned up the foreign key constraints. - [*]
D5QIOJGP* Move everything up one directory.
Change contents
- edit in src/lib/Hydra/Controller/Jobset.pm at line 57
if (length($c->stash->{project}->declfile)) {error($c, "can't modify jobset of declarative project", 403);} - edit in src/lib/Hydra/Controller/Jobset.pm at line 94
if (length($c->stash->{project}->declfile)) {error($c, "can't modify jobset of declarative project", 403);} - edit in src/lib/Hydra/Controller/Project.pm at line 157
, declfile => trim($c->stash->{params}->{declfile}), decltype => trim($c->stash->{params}->{decltype}), declvalue => trim($c->stash->{params}->{declvalue}) - edit in src/lib/Hydra/Controller/Project.pm at line 161
if (length($project->declfile)) {$project->jobsets->update_or_create({ name=> ".jobsets", nixexprinput => "", nixexprpath => "", emailoverride => "", triggertime => time});} - replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 25
restartBuild getPrevJobsetEvalrestartBuild getPrevJobsetEval updateDeclarativeJobsethandleDeclarativeJobsetBuild - edit in src/lib/Hydra/Helper/AddBuilds.pm at line 471
sub updateDeclarativeJobset {my ($db, $project, $jobsetName, $declSpec) = @_;my @allowed_keys = qw(enabledhiddendescriptionnixexprinputnixexprpathcheckintervalschedulingsharesenableemailemailoverridekeepnr);my %update = ( name => $jobsetName );foreach my $key (@allowed_keys) {$update{$key} = $declSpec->{$key};delete $declSpec->{$key};}txn_do($db, sub {my $jobset = $project->jobsets->update_or_create(\%update);$jobset->jobsetinputs->delete;while ((my $name, my $data) = each %{$declSpec->{"inputs"}}) {my $input = $jobset->jobsetinputs->create({ name => $name,type => $data->{type},emailresponsible => $data->{emailresponsible}});$input->jobsetinputalts->create({altnr => 0, value => $data->{value}});}delete $declSpec->{"inputs"};die "invalid keys in declarative specification file\n" if (%{$declSpec});});};sub handleDeclarativeJobsetBuild {my ($db, $project, $build) = @_;eval {my $id = $build->id;die "Declarative jobset build $id failed" unless $build->buildstatus == 0;my $declPath = ($build->buildoutputs)[0]->path;my $declText = read_file($declPath)or die "Couldn't read declarative specification file $declPath: $!";my $declSpec = decode_json($declText);txn_do($db, sub {my @kept = keys %$declSpec;push @kept, ".jobsets";$project->jobsets->search({ name => { "not in" => \@kept } })->update({ enabled => 0, hidden => 1 });while ((my $jobsetName, my $spec) = each %$declSpec) {updateDeclarativeJobset($db, $project, $jobsetName, $spec);}});};$project->jobsets->find({ name => ".jobsets" })->update({ errormsg => $@, errortime => time, fetcherrormsg => undef })if defined $@;}; - replacement in src/lib/Hydra/Helper/CatalystUtils.pm at line 267
$s =~ /^($projectNameRE):($jobsetNameRE)$/ or die "invalid jobset specifier ‘$s’\n";$s =~ /^($projectNameRE):(\.?$jobsetNameRE)$/ or die "invalid jobset specifier ‘$s’\n"; - edit in src/lib/Hydra/Schema/Projects.pm at line 75
=head2 declfile - edit in src/lib/Hydra/Schema/Projects.pm at line 78
data_type: 'text'is_nullable: 1=head2 decltypedata_type: 'text'is_nullable: 1=head2 declvaluedata_type: 'text'is_nullable: 1 - edit in src/lib/Hydra/Schema/Projects.pm at line 107
{ data_type => "text", is_nullable => 1 },"declfile",{ data_type => "text", is_nullable => 1 },"decltype",{ data_type => "text", is_nullable => 1 },"declvalue", - replacement in src/lib/Hydra/Schema/Projects.pm at line 306
# Created by DBIx::Class::Schema::Loader v0.07043 @ 2015-07-30 16:52:20# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:67kWIE0IGmEJTvOIATAKaw# Created by DBIx::Class::Schema::Loader v0.07043 @ 2016-03-11 10:39:17# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1ats3brIVhRTWLToIYSoaQ - edit in src/root/edit-project.tt at line 53
</div></div><div class="control-group"><label class="control-label">Declarative spec file</label><div class="controls"><div class="input-append"><input type="text" class="span3" name="declfile" [% HTML.attributes(value => project.declfile) %]/></div><span class="help-inline">(Leave blank for non-declarative project configuration)</span> - edit in src/root/edit-project.tt at line 66
<div class="control-group"><label class="control-label">Declarative input type</label><div class="controls">[% INCLUDE renderSelection param="decltype" options=inputTypes edit=1 curValue=project.decltype %]value<input style="width: 70%" type="text" [% HTML.attributes(value => project.declvalue, name => "declvalue") %]/></div></div> - edit in src/root/jobset.tt at line 52
[% UNLESS project.declfile %] - edit in src/root/jobset.tt at line 56
[% END %] - edit in src/root/project.tt at line 14
[% UNLESS project.declfile %] - edit in src/root/project.tt at line 16
[% END %] - edit in src/script/hydra-evaluator at line 17
use JSON;use File::Slurp; - edit in src/script/hydra-evaluator at line 105
my $jobsetsJobset = length($project->declfile) && $jobset->name eq ".jobsets";if ($jobsetsJobset) {my @declInputs = fetchInput($plugins, $db, $project, $jobset, "decl", $project->decltype, $project->declvalue, 0);my $declInput = @declInputs[0] or die "cannot find the input containing the declarative project specification\n";die "multiple alternatives for the input containing the declarative project specificaiton are not supported\n"if scalar @declInputs != 1;my $declFile = $declInput->{storePath} . "/" . $project->declfile;my $declText = read_file($declFile)or die "Couldn't read declarative specification file $declFile: $!\n";my $declSpec;eval {$declSpec = decode_json($declText);};die "Declarative specification file $declFile not valid JSON: $@\n" if $@;updateDeclarativeJobset($db, $project, ".jobsets", $declSpec);$jobset->discard_changes;} - edit in src/script/hydra-evaluator at line 165
if ($jobsetsJobset) {my @keys = keys %$jobs;die "The .jobsets jobset must only have a single job named 'jobsets'"unless (scalar @keys) == 1 && $keys[0] eq "jobsets";} - edit in src/script/hydra-notify at line 8
use Hydra::Helper::AddBuilds; - edit in src/script/hydra-notify at line 25
my $project = $build->project;my $jobset = $build->jobset;if (length($project->declfile) && $jobset->name eq ".jobsets" && $build->iscurrent) {handleDeclarativeJobsetBuild($db, $project, $build);} - edit in src/sql/hydra.sql at line 33
declfile text, -- File containing declarative jobset specificationdecltype text, -- Type of the input containing declarative jobset specificationdeclvalue text, -- Value of the input containing declarative jobset specification - file addition: upgrade-48.sql[48.3004]
-- Add declarative fields to Projectsalter table Projects add column declfile text;alter table Projects add column decltype text;alter table Projects add column declvalue text;