* Add the name of the jobset to ReleaseSetJobs, otherwise we can't

distinguish between jobs with the same name in different jobsets
  (e.g. "trunk" vs "stdenv-branch" for Nixpkgs).
* Renamed the "attrName" field of Builds to "job".
* Renamed the "id" field of BuildSteps to "build".
This commit is contained in:
Eelco Dolstra 2009-03-12 14:18:30 +00:00
parent fec08462ee
commit a623ad157e
29 changed files with 96 additions and 88 deletions

View file

@ -26,7 +26,7 @@ sub index : Chained('job') PathPart('') Args(0) {
sub get_builds : Chained('job') PathPart('') CaptureArgs(0) { sub get_builds : Chained('job') PathPart('') CaptureArgs(0) {
my ($self, $c) = @_; my ($self, $c) = @_;
$c->stash->{allBuilds} = $c->stash->{allBuilds} =
$c->stash->{curProject}->builds->search({attrName => $c->stash->{jobName}}); $c->stash->{curProject}->builds->search({job => $c->stash->{jobName}});
$c->stash->{channelBaseName} = $c->stash->{channelBaseName} =
$c->stash->{curProject}->name . "-" . $c->stash->{jobName}; $c->stash->{curProject}->name . "-" . $c->stash->{jobName};
} }

View file

@ -49,13 +49,13 @@ sub getLatestBuilds {
my @res = (); my @res = ();
foreach my $job ($builds->search({}, foreach my $build ($builds->search({},
{group_by => ['project', 'attrname', 'system']})) {group_by => ['project', 'job', 'system']}))
{ {
my $attrs = my $attrs =
{ project => $job->get_column('project') { project => $build->get_column('project')
, attrname => $job->attrname , job => $build->job
, system => $job->system , system => $build->system
, finished => 1 , finished => 1
}; };
my ($build) = $builds->search({ %$attrs, %$extraAttrs }, my ($build) = $builds->search({ %$attrs, %$extraAttrs },

View file

@ -124,7 +124,7 @@ sub attrsToSQL {
sub getPrimaryBuildsForReleaseSet { sub getPrimaryBuildsForReleaseSet {
my ($project, $primaryJob) = @_; my ($project, $primaryJob) = @_;
my @primaryBuilds = $project->builds->search( my @primaryBuilds = $project->builds->search(
{ attrname => $primaryJob->job, finished => 1 }, { job => $primaryJob->job, finished => 1 },
{ join => 'resultInfo', order_by => "timestamp DESC" { join => 'resultInfo', order_by => "timestamp DESC"
, '+select' => ["resultInfo.releasename"], '+as' => ["releasename"] , '+select' => ["resultInfo.releasename"], '+as' => ["releasename"]
, where => \ attrsToSQL($primaryJob->attrs, "me.id") , where => \ attrsToSQL($primaryJob->attrs, "me.id")
@ -154,7 +154,7 @@ sub getRelease {
# as input. If there are multiple, prefer successful # as input. If there are multiple, prefer successful
# ones, and then oldest. !!! order_by buildstatus is hacky # ones, and then oldest. !!! order_by buildstatus is hacky
($thisBuild) = $primaryBuild->dependentBuilds->search( ($thisBuild) = $primaryBuild->dependentBuilds->search(
{ attrname => $job->job, finished => 1 }, { job => $job->job, finished => 1 },
{ join => 'resultInfo', rows => 1 { join => 'resultInfo', rows => 1
, order_by => ["buildstatus", "timestamp"] , order_by => ["buildstatus", "timestamp"]
, where => \ attrsToSQL($job->attrs, "build.id") , where => \ attrsToSQL($job->attrs, "build.id")

View file

@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema';
__PACKAGE__->load_classes; __PACKAGE__->load_classes;
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bK7m5SJjCnJKOckiufcb9w # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oeLeU2T8C2dVBS+ugF0p8g
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -36,8 +36,8 @@ __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
__PACKAGE__->belongs_to("dependency", "Hydra::Schema::Builds", { id => "dependency" }); __PACKAGE__->belongs_to("dependency", "Hydra::Schema::Builds", { id => "dependency" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:11XN47b5bRrRKiWtzLO+Pw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CLL7aeJ0fe0NX3LCnNs4/A
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -35,8 +35,8 @@ __PACKAGE__->set_primary_key("build", "productnr");
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gUnxXuaqq40KFRIUSBmVuA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9Eer/gLCKlOKfnwC+kfFaw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -35,13 +35,13 @@ __PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xvSDu+FkyKp5wTAEGmiKOw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ieF3JOI4N3XZUyMboZhrjg
__PACKAGE__->belongs_to( __PACKAGE__->belongs_to(
"failedDep", "failedDep",
"Hydra::Schema::BuildSteps", "Hydra::Schema::BuildSteps",
{ id => "faileddepbuild", stepnr => "faileddepstepnr" }, { build => "faileddepbuild", stepnr => "faileddepstepnr" },
); );
1; 1;

View file

@ -27,8 +27,8 @@ __PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xv5P0Erv5oEy4r3c9RuV0w # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oomDjaTJHIQjraUqhzFPsg
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -8,7 +8,7 @@ use base 'DBIx::Class';
__PACKAGE__->load_components("Core"); __PACKAGE__->load_components("Core");
__PACKAGE__->table("BuildSteps"); __PACKAGE__->table("BuildSteps");
__PACKAGE__->add_columns( __PACKAGE__->add_columns(
"id", "build",
{ data_type => "integer", is_nullable => 0, size => undef }, { data_type => "integer", is_nullable => 0, size => undef },
"stepnr", "stepnr",
{ data_type => "integer", is_nullable => 0, size => undef }, { data_type => "integer", is_nullable => 0, size => undef },
@ -31,11 +31,11 @@ __PACKAGE__->add_columns(
"stoptime", "stoptime",
{ data_type => "integer", is_nullable => 0, size => undef }, { data_type => "integer", is_nullable => 0, size => undef },
); );
__PACKAGE__->set_primary_key("id", "stepnr"); __PACKAGE__->set_primary_key("build", "stepnr");
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ne+uSrfxnk+wK60IrVoTww # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+nb1zsYcv9WziZ6IHcc/yw
1; 1;

View file

@ -18,7 +18,7 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
"jobset", "jobset",
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
"attrname", "job",
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
"nixname", "nixname",
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
@ -57,7 +57,7 @@ __PACKAGE__->has_many(
__PACKAGE__->has_many( __PACKAGE__->has_many(
"buildsteps", "buildsteps",
"Hydra::Schema::BuildSteps", "Hydra::Schema::BuildSteps",
{ "foreign.id" => "self.id" }, { "foreign.build" => "self.id" },
); );
__PACKAGE__->has_many( __PACKAGE__->has_many(
"buildinputs_builds", "buildinputs_builds",
@ -76,8 +76,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iwt05CKHqfd33lW+wAC2mw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UahvxjBmn7b70IK+QcnKHA
__PACKAGE__->has_many(dependents => 'Hydra::Schema::BuildInputs', 'dependency'); __PACKAGE__->has_many(dependents => 'Hydra::Schema::BuildInputs', 'dependency');

View file

@ -22,8 +22,8 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("srcpath", "sha256hash"); __PACKAGE__->set_primary_key("srcpath", "sha256hash");
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Hjklk18AGqKd7dDPUlqS9A # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+AZEuCFAfkl7SKwlxDBnaw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -20,8 +20,8 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("uri", "revision"); __PACKAGE__->set_primary_key("uri", "revision");
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OMt7YCEd4Vc3edHp2fxcrw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2JtWOkH5OVGl7Cb7STLM5Q
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -31,8 +31,8 @@ __PACKAGE__->belongs_to(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gQOuvSuoR2kczD57yaVSwQ # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ka/dxG48LaZOQeShZFs0Hw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -43,8 +43,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GpIp3ENzylBZ9HQUNhO17Q # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:earsp0XPWppy5/VOJkQ/PA
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -50,8 +50,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BcAloJiRDPMvL/+GqsPiTw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ADLNgkS2YPv4DuszwHau7g
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -45,8 +45,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TTHljyVTOMxXzNATXkltNg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:R/GeZxDujiuKze++Mc2ZTw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -22,6 +22,8 @@ __PACKAGE__->add_columns(
{ data_type => "integer", is_nullable => 0, size => undef }, { data_type => "integer", is_nullable => 0, size => undef },
"description", "description",
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
"jobset",
{ data_type => "text", is_nullable => 0, size => undef },
); );
__PACKAGE__->set_primary_key("project", "release_", "job", "attrs"); __PACKAGE__->set_primary_key("project", "release_", "job", "attrs");
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }); __PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" });
@ -32,8 +34,8 @@ __PACKAGE__->belongs_to(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YC+cgQcuvO4TxC5UpU7u4A # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OM2joIa3Bj6t9BhVrOjN8Q
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -29,8 +29,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Sv+5cdtqHDjWM0Zmmu0PSg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gSzri22yKGHLKCjNLv9/VQ
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -16,8 +16,8 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("system"); __PACKAGE__->set_primary_key("system");
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RLOKTpEzFYJMyzgMCg7zSg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:viZlvDAHk9k8ScuA/qfUGw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -17,8 +17,8 @@ __PACKAGE__->set_primary_key("username", "role");
__PACKAGE__->belongs_to("username", "Hydra::Schema::Users", { username => "username" }); __PACKAGE__->belongs_to("username", "Hydra::Schema::Users", { username => "username" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QTXCy6SeSRYYXW3odCVLiQ # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gRuZJKELtc15+vQFjxjkKQ
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -30,8 +30,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eQFOcWRNwb7IE1ifGrw4rQ # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Lomf54EURbBIbrWGojiFIw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -4,7 +4,7 @@
[% USE HTML %] [% USE HTML %]
<h1> <h1>
Job <tt>[% build.project.name %]:[% build.attrname %]</tt> build [% id %] Job <tt>[% build.project.name %]:[% build.job %]</tt> build [% id %]
[% IF !build.finished %] [% IF !build.finished %]
[% IF build.schedulingInfo.busy %] [% IF build.schedulingInfo.busy %]
(currently building) (currently building)
@ -47,7 +47,7 @@
<img src="/static/images/failure.gif" alt="Failed" /> <img src="/static/images/failure.gif" alt="Failed" />
<span class="error">Build inhibited because a dependency previously failed to build</span> <span class="error">Build inhibited because a dependency previously failed to build</span>
[% failedDep = build.resultInfo.failedDep %] [% failedDep = build.resultInfo.failedDep %]
(namely, <a href="[% c.uri_for('/build' failedDep.id.id 'nixlog' failedDep.stepnr) %]"><tt>[% failedDep.outpath %]</tt></a>) (namely, <a href="[% c.uri_for('/build' failedDep.build.id 'nixlog' failedDep.stepnr) %]"><tt>[% failedDep.outpath %]</tt></a>)
[% ELSE %] [% ELSE %]
<img src="/static/images/failure.gif" alt="Failed" /> <img src="/static/images/failure.gif" alt="Failed" />
<span class="error">Build failed</span> <span class="error">Build failed</span>
@ -81,7 +81,7 @@
</tr> </tr>
<tr> <tr>
<th>Job name:</th> <th>Job name:</th>
<td><a href="[% c.uri_for('/project' build.project.name 'job' build.attrname) %]"><tt>[% build.attrname %]</tt></a></td> <td><a href="[% c.uri_for('/project' build.project.name 'job' build.job) %]"><tt>[% build.job %]</tt></a></td>
</tr> </tr>
<tr> <tr>
<th>Nix name:</th> <th>Nix name:</th>
@ -187,7 +187,7 @@
<td><tt>[% type = input.type; inputTypes.$type %]</tt></td> <td><tt>[% type = input.type; inputTypes.$type %]</tt></td>
<td> <td>
[% IF input.type == "build" %] [% IF input.type == "build" %]
<a href="[% c.uri_for('/build' input.dependency.id) %]">Job <tt>[% input.dependency.project.name %]:[% input.dependency.attrname %]</tt> build [% input.dependency.id %]</a> <a href="[% c.uri_for('/build' input.dependency.id) %]">Job <tt>[% input.dependency.project.name %]:[% input.dependency.job %]</tt> build [% input.dependency.id %]</a>
[% ELSIF input.type == "string" || input.type == "boolean" %] [% ELSIF input.type == "string" || input.type == "boolean" %]
<tt>"[% input.value %]"</tt> <tt>"[% input.value %]"</tt>
[% ELSE %] [% ELSE %]
@ -298,7 +298,7 @@
<tbody> <tbody>
[% FOREACH input IN build.dependents -%] [% FOREACH input IN build.dependents -%]
<tr> <tr>
<td><a href="[% c.uri_for('/build' input.build.id) %]">Job <tt>[% input.build.project.name %]:[% input.build.attrname %]</tt> build [% input.build.id %]</a></td> <td><a href="[% c.uri_for('/build' input.build.id) %]">Job <tt>[% input.build.project.name %]:[% input.build.job %]</tt> build [% input.build.id %]</a></td>
<td><tt>[% input.name %]</tt></td> <td><tt>[% input.name %]</tt></td>
<td><tt>[% input.build.system %]</tt></td> <td><tt>[% input.build.system %]</tt></td>
<td>[% PROCESS renderDateTime timestamp = input.build.timestamp %]</td> <td>[% PROCESS renderDateTime timestamp = input.build.timestamp %]</td>

View file

@ -61,7 +61,7 @@
<td>[% build.schedulingInfo.priority %]</td> <td>[% build.schedulingInfo.priority %]</td>
[% END %] [% END %]
<td><a href="[% c.uri_for('/project' build.get_column("project")) %]"><tt>[% build.get_column("project") %]</tt></a></td> <td><a href="[% c.uri_for('/project' build.get_column("project")) %]"><tt>[% build.get_column("project") %]</tt></a></td>
<td><a href="[% c.uri_for('/project' build.get_column("project") 'job' build.attrname) %]"><tt>[% build.attrname %]</tt></a></td> <td><a href="[% c.uri_for('/project' build.get_column("project") 'job' build.job) %]"><tt>[% build.job %]</tt></a></td>
<td>[% build.resultInfo.releasename ? build.resultInfo.releasename : build.nixname %]</td> <td>[% build.resultInfo.releasename ? build.resultInfo.releasename : build.nixname %]</td>
<td><tt>[% build.system %]</tt></td> <td><tt>[% build.system %]</tt></td>
<td>[% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %]</td> <td>[% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %]</td>

View file

@ -1,6 +1,6 @@
[% WRAPPER layout.tt title="Logfile" %] [% WRAPPER layout.tt title="Logfile" %]
<h1>Logfile for <tt>[% build.project.name %]:[% build.attrname %]</tt> build [% build.id %][%IF step %], step [% step.stepnr %] (<tt>[% step.outpath %]</tt>)[% END %]</h1> <h1>Logfile for <tt>[% build.project.name %]:[% build.job %]</tt> build [% build.id %][%IF step %], step [% step.stepnr %] (<tt>[% step.outpath %]</tt>)[% END %]</h1>
<div class="buildlog"> <div class="buildlog">
[% logtext -%] [% logtext -%]

View file

@ -58,7 +58,7 @@ sub doBuild {
{outPath => $dep}, {rows => 1, order_by => "stopTime DESC", type => 0, busy => 0}); {outPath => $dep}, {rows => 1, order_by => "stopTime DESC", type => 0, busy => 0});
if ($step && $step->status != 0) { if ($step && $step->status != 0) {
$buildStatus = 5; $buildStatus = 5;
$failedDepBuild = $step->id->id; $failedDepBuild = $step->build->id;
$failedDepStepNr = $step->stepnr; $failedDepStepNr = $step->stepnr;
goto done; goto done;
} }
@ -91,9 +91,8 @@ sub doBuild {
if (/^@\s+build-started\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)$/) { if (/^@\s+build-started\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)$/) {
$db->txn_do(sub { $db->txn_do(sub {
$db->resultset('BuildSteps')->create( $build->buildsteps->create(
{ id => $build->id { stepnr => $buildStepNr++
, stepnr => $buildStepNr++
, type => 0 # = build , type => 0 # = build
, drvpath => $1 , drvpath => $1
, outpath => $2 , outpath => $2
@ -107,8 +106,8 @@ sub doBuild {
elsif (/^@\s+build-succeeded\s+(\S+)\s+(\S+)$/) { elsif (/^@\s+build-succeeded\s+(\S+)\s+(\S+)$/) {
my $drvPath = $1; my $drvPath = $1;
$db->txn_do(sub { $db->txn_do(sub {
(my $step) = $db->resultset('BuildSteps')->search( (my $step) = $build->buildsteps->search(
{id => $build->id, type => 0, drvpath => $drvPath}, {}); {type => 0, drvpath => $drvPath}, {});
die unless $step; die unless $step;
$step->update({busy => 0, status => 0, stoptime => time}); $step->update({busy => 0, status => 0, stoptime => time});
}); });
@ -119,14 +118,13 @@ sub doBuild {
$someBuildFailed = 1; $someBuildFailed = 1;
$thisBuildFailed = 1 if $drvPath eq $drvPathStep; $thisBuildFailed = 1 if $drvPath eq $drvPathStep;
$db->txn_do(sub { $db->txn_do(sub {
(my $step) = $db->resultset('BuildSteps')->search( (my $step) = $build->buildsteps->search(
{id => $build->id, type => 0, drvpath => $drvPathStep}, {}); {type => 0, drvpath => $drvPathStep}, {});
if ($step) { if ($step) {
$step->update({busy => 0, status => 1, errormsg => $4, stoptime => time}); $step->update({busy => 0, status => 1, errormsg => $4, stoptime => time});
} else { } else {
$db->resultset('BuildSteps')->create( $build->buildsteps->create(
{ id => $build->id { stepnr => $buildStepNr++
, stepnr => $buildStepNr++
, type => 0 # = build , type => 0 # = build
, drvpath => $drvPathStep , drvpath => $drvPathStep
, outpath => $2 , outpath => $2
@ -144,9 +142,8 @@ sub doBuild {
elsif (/^@\s+substituter-started\s+(\S+)\s+(\S+)$/) { elsif (/^@\s+substituter-started\s+(\S+)\s+(\S+)$/) {
my $outPath = $1; my $outPath = $1;
$db->txn_do(sub { $db->txn_do(sub {
$db->resultset('BuildSteps')->create( $build->buildsteps->create(
{ id => $build->id { stepnr => $buildStepNr++
, stepnr => $buildStepNr++
, type => 1 # = substitution , type => 1 # = substitution
, outpath => $1 , outpath => $1
, busy => 1 , busy => 1
@ -158,8 +155,8 @@ sub doBuild {
elsif (/^@\s+substituter-succeeded\s+(\S+)$/) { elsif (/^@\s+substituter-succeeded\s+(\S+)$/) {
my $outPath = $1; my $outPath = $1;
$db->txn_do(sub { $db->txn_do(sub {
(my $step) = $db->resultset('BuildSteps')->search( (my $step) = $build->buildsteps->search(
{id => $build->id, type => 1, outpath => $outPath}, {}); {type => 1, outpath => $outPath}, {});
die unless $step; die unless $step;
$step->update({busy => 0, status => 0, stoptime => time}); $step->update({busy => 0, status => 0, stoptime => time});
}); });
@ -168,8 +165,8 @@ sub doBuild {
elsif (/^@\s+substituter-failed\s+(\S+)\s+(\S+)\s+(\S+)$/) { elsif (/^@\s+substituter-failed\s+(\S+)\s+(\S+)\s+(\S+)$/) {
my $outPath = $1; my $outPath = $1;
$db->txn_do(sub { $db->txn_do(sub {
(my $step) = $db->resultset('BuildSteps')->search( (my $step) = $build->buildsteps->search(
{id => $build->id, type => 1, outpath => $outPath}, {}); {type => 1, outpath => $outPath}, {});
die unless $step; die unless $step;
$step->update({busy => 0, status => 1, errormsg => $3, stoptime => time}); $step->update({busy => 0, status => 1, errormsg => $3, stoptime => time});
}); });

View file

@ -106,7 +106,7 @@ sub checkBuilds {
# outside the transaction in case it aborts or something. # outside the transaction in case it aborts or something.
foreach my $build (@buildsStarted) { foreach my $build (@buildsStarted) {
my $id = $build->id; my $id = $build->id;
print "starting build $id (", $build->project->name, ":", $build->attrname, ") on ", $build->system, "\n"; print "starting build $id (", $build->project->name, ":", $build->job, ") on ", $build->system, "\n";
eval { eval {
my $logfile = $build->schedulingInfo->logfile; my $logfile = $build->schedulingInfo->logfile;
my $child = fork(); my $child = fork();
@ -134,6 +134,12 @@ sub checkBuilds {
} }
if (scalar(@ARGV) == 1 && $ARGV[0] eq "--unlock") {
unlockDeadBuilds;
exit 0;
}
while (1) { while (1) {
eval { eval {
# Clean up zombies. # Clean up zombies.

View file

@ -155,7 +155,7 @@ sub fetchInputAlt {
# Pick the most recent successful build of the specified job. # Pick the most recent successful build of the specified job.
(my $prevBuild) = $db->resultset('Builds')->search( (my $prevBuild) = $db->resultset('Builds')->search(
{finished => 1, project => $project->name, jobset => $jobset->name, attrname => $jobName, buildStatus => 0}, {finished => 1, project => $project->name, jobset => $jobset->name, job => $jobName, buildStatus => 0},
{join => 'resultInfo', order_by => "timestamp DESC", rows => 1}); {join => 'resultInfo', order_by => "timestamp DESC", rows => 1});
if (!defined $prevBuild || !isValidPath($prevBuild->outpath)) { if (!defined $prevBuild || !isValidPath($prevBuild->outpath)) {
@ -218,7 +218,7 @@ sub checkJob {
$db->txn_do(sub { $db->txn_do(sub {
if (scalar($db->resultset('Builds')->search( if (scalar($db->resultset('Builds')->search(
{ project => $project->name, jobset => $jobset->name { project => $project->name, jobset => $jobset->name
, attrname => $jobName, outPath => $outPath })) > 0) , job => $jobName, outPath => $outPath })) > 0)
{ {
print "already scheduled/done\n"; print "already scheduled/done\n";
return; return;
@ -231,7 +231,7 @@ sub checkJob {
, timestamp => time() , timestamp => time()
, project => $project->name , project => $project->name
, jobset => $jobset->name , jobset => $jobset->name
, attrname => $jobName , job => $jobName
, description => $job->{description} , description => $job->{description}
, longdescription => $job->{longDescription} , longdescription => $job->{longDescription}
, license => $job->{license} , license => $job->{license}

View file

@ -38,14 +38,14 @@ foreach my $project ($db->resultset('Projects')->all) {
# Go over all jobs in this project. # Go over all jobs in this project.
foreach my $job ($project->builds->search({}, foreach my $job ($project->builds->search({},
{select => [{distinct => 'attrname'}], as => ['attrname']})) {select => [{distinct => 'job'}], as => ['job']}))
{ {
print "*** looking for builds to keep in job ", $project->name, ":", $job->attrname, "\n"; print "*** looking for builds to keep in job ", $project->name, ":", $job->job, "\n";
# Keep the N most recent successful builds for each job and # Keep the N most recent successful builds for each job and
# platform. # platform.
my @recentBuilds = $project->builds->search( my @recentBuilds = $project->builds->search(
{ attrname => $job->attrname { job => $job->job
, finished => 1 , finished => 1
, buildStatus => 0 # == success , buildStatus => 0 # == success
}, },

View file

@ -11,9 +11,9 @@ create table Builds (
timestamp integer not null, -- time this build was scheduled / finished building timestamp integer not null, -- time this build was scheduled / finished building
-- Info about the inputs. -- Info about the inputs.
project text not null, -- !!! foreign key project text not null,
jobset text not null, -- !!! foreign key jobset text not null,
attrName text not null, job text not null,
-- Info about the build result. -- Info about the build result.
nixName text, -- name attribute of the derivation nixName text, -- name attribute of the derivation
@ -85,7 +85,7 @@ create table BuildResultInfo (
create table BuildSteps ( create table BuildSteps (
id integer not null, -- !!! rename to "build" build integer not null,
stepnr integer not null, stepnr integer not null,
type integer not null, -- 0 = build, 1 = substitution type integer not null, -- 0 = build, 1 = substitution
@ -104,8 +104,8 @@ create table BuildSteps (
startTime integer, startTime integer,
stopTime integer, stopTime integer,
primary key (id, stepnr), primary key (build, stepnr),
foreign key (id) references Builds(id) on delete cascade -- ignored by sqlite foreign key (build) references Builds(id) on delete cascade -- ignored by sqlite
); );
@ -370,7 +370,10 @@ create table ReleaseSetJobs (
description text, description text,
jobset text not null,
primary key (project, release_, job, attrs), primary key (project, release_, job, attrs),
foreign key (project) references Projects(name) on delete cascade, -- ignored by sqlite foreign key (project) references Projects(name) on delete cascade, -- ignored by sqlite
foreign key (project, release_) references ReleaseSets(project, name) on delete cascade -- ignored by sqlite foreign key (project, release_) references ReleaseSets(project, name) on delete cascade -- ignored by sqlite
foreign key (project, jobset) references Jobsets(project, name) on delete restrict -- ignored by sqlite
); );