forked from lix-project/hydra
Record which build a failed build step was propagated from
This commit is contained in:
parent
48af914e28
commit
adc72d2409
6 changed files with 46 additions and 7 deletions
|
@ -92,6 +92,12 @@ __PACKAGE__->table("BuildSteps");
|
||||||
data_type: 'text'
|
data_type: 'text'
|
||||||
is_nullable: 1
|
is_nullable: 1
|
||||||
|
|
||||||
|
=head2 propagatedfrom
|
||||||
|
|
||||||
|
data_type: 'integer'
|
||||||
|
is_foreign_key: 1
|
||||||
|
is_nullable: 1
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
__PACKAGE__->add_columns(
|
__PACKAGE__->add_columns(
|
||||||
|
@ -117,6 +123,8 @@ __PACKAGE__->add_columns(
|
||||||
{ data_type => "text", default_value => "", is_nullable => 0 },
|
{ data_type => "text", default_value => "", is_nullable => 0 },
|
||||||
"system",
|
"system",
|
||||||
{ data_type => "text", is_nullable => 1 },
|
{ data_type => "text", is_nullable => 1 },
|
||||||
|
"propagatedfrom",
|
||||||
|
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
|
||||||
);
|
);
|
||||||
|
|
||||||
=head1 PRIMARY KEY
|
=head1 PRIMARY KEY
|
||||||
|
@ -165,9 +173,29 @@ __PACKAGE__->has_many(
|
||||||
undef,
|
undef,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
=head2 propagatedfrom
|
||||||
|
|
||||||
# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-06-13 01:54:50
|
Type: belongs_to
|
||||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OZsXJniZ/7EB2iSz7p5y4A
|
|
||||||
|
Related object: L<Hydra::Schema::Builds>
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
__PACKAGE__->belongs_to(
|
||||||
|
"propagatedfrom",
|
||||||
|
"Hydra::Schema::Builds",
|
||||||
|
{ id => "propagatedfrom" },
|
||||||
|
{
|
||||||
|
is_deferrable => 0,
|
||||||
|
join_type => "LEFT",
|
||||||
|
on_delete => "CASCADE",
|
||||||
|
on_update => "NO ACTION",
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
# Created by DBIx::Class::Schema::Loader v0.07033 @ 2015-02-25 16:27:20
|
||||||
|
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZbOxzCzFN7fIT9M2BFY0iQ
|
||||||
|
|
||||||
my %hint = (
|
my %hint = (
|
||||||
columns => [
|
columns => [
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
<span class="error">Failed: [% HTML.escape(step.errormsg) %]</span>
|
<span class="error">Failed: [% HTML.escape(step.errormsg) %]</span>
|
||||||
[% END %]
|
[% END %]
|
||||||
[%%] [%+ IF has_log; INCLUDE renderLogLinks url=log inRow=1; END %]
|
[%%] [%+ IF has_log; INCLUDE renderLogLinks url=log inRow=1; END %]
|
||||||
|
[%+ IF step.propagatedfrom; %](propagated from [% INCLUDE renderBuildIdLink id=step.propagatedfrom.get_column('id') %])[% END %]
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
|
@ -168,11 +168,14 @@ BLOCK renderFullBuildLink;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
|
|
||||||
BLOCK renderBuildLink; %]
|
BLOCK renderBuildIdLink; %]
|
||||||
<a href="[% c.uri_for('/build' build.id) %]">build [% build.id %]</a>
|
<a href="[% c.uri_for('/build' id) %]">build [% id %]</a>
|
||||||
[% END;
|
[% END;
|
||||||
|
|
||||||
|
|
||||||
|
BLOCK renderBuildLink; INCLUDE renderBuildIdLink id=build.id; END;
|
||||||
|
|
||||||
|
|
||||||
BLOCK renderBuildStatusIcon;
|
BLOCK renderBuildStatusIcon;
|
||||||
finished = build != undef ? build.finished : 1;
|
finished = build != undef ? build.finished : 1;
|
||||||
busy = busy != undef ? busy : build.busy;
|
busy = busy != undef ? busy : build.busy;
|
||||||
|
|
|
@ -39,7 +39,7 @@ sub nextFreeStepNr {
|
||||||
|
|
||||||
|
|
||||||
sub failDependents {
|
sub failDependents {
|
||||||
my ($drvPath, $status, $errorMsg, $dependents, $startTime, $stopTime, $machine) = @_;
|
my ($drvPath, $status, $errorMsg, $dependents, $startTime, $stopTime, $machine, $propagatedFrom) = @_;
|
||||||
|
|
||||||
# Get the referrer closure of $drvPath.
|
# Get the referrer closure of $drvPath.
|
||||||
my $dependentDrvs = Set::Scalar->new(computeFSClosure(1, 0, $drvPath));
|
my $dependentDrvs = Set::Scalar->new(computeFSClosure(1, 0, $drvPath));
|
||||||
|
@ -75,6 +75,7 @@ sub failDependents {
|
||||||
, stoptime => $stopTime
|
, stoptime => $stopTime
|
||||||
, errormsg => $errorMsg
|
, errormsg => $errorMsg
|
||||||
, machine => $machine
|
, machine => $machine
|
||||||
|
, propagatedfrom => $propagatedFrom->id
|
||||||
});
|
});
|
||||||
addBuildStepOutputs($step);
|
addBuildStepOutputs($step);
|
||||||
|
|
||||||
|
@ -236,7 +237,7 @@ sub doBuild {
|
||||||
});
|
});
|
||||||
|
|
||||||
# Immediately fail all builds that depend on this derivation.
|
# Immediately fail all builds that depend on this derivation.
|
||||||
failDependents($drvPathStep, $status, $errorMsg, $dependents, $stepStartTime, $stepStopTime, $machine);
|
failDependents($drvPathStep, $status, $errorMsg, $dependents, $stepStartTime, $stepStopTime, $machine, $build);
|
||||||
}
|
}
|
||||||
|
|
||||||
elsif (/^@\s+substituter-started\s+(\S+)\s+(\S+)$/) {
|
elsif (/^@\s+substituter-started\s+(\S+)\s+(\S+)$/) {
|
||||||
|
|
|
@ -233,8 +233,11 @@ create table BuildSteps (
|
||||||
machine text not null default '',
|
machine text not null default '',
|
||||||
system text,
|
system text,
|
||||||
|
|
||||||
|
propagatedFrom integer,
|
||||||
|
|
||||||
primary key (build, stepnr),
|
primary key (build, stepnr),
|
||||||
foreign key (build) references Builds(id) on delete cascade
|
foreign key (build) references Builds(id) on delete cascade,
|
||||||
|
foreign key (propagatedFrom) references Builds(id) on delete cascade
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
3
src/sql/upgrade-32.sql
Normal file
3
src/sql/upgrade-32.sql
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
alter table BuildSteps
|
||||||
|
add column propagatedFrom integer,
|
||||||
|
add foreign key (propagatedFrom) references Builds(id) on delete cascade;
|
Loading…
Reference in a new issue