forked from lix-project/hydra
* Disambiguate jobs by jobset name. I.e. jobs with the same name in
different jobsets are not considered the same job.
This commit is contained in:
parent
a623ad157e
commit
f2f586d842
|
@ -7,12 +7,19 @@ use Hydra::Helper::Nix;
|
|||
use Hydra::Helper::CatalystUtils;
|
||||
|
||||
|
||||
sub job : Chained('/project/project') PathPart('job') CaptureArgs(1) {
|
||||
my ($self, $c, $jobName) = @_;
|
||||
sub job : Chained('/') PathPart('job') CaptureArgs(3) {
|
||||
my ($self, $c, $projectName, $jobsetName, $jobName) = @_;
|
||||
|
||||
# !!! cut&paste from Project::project.
|
||||
my $project = $c->model('DB::Projects')->find($projectName)
|
||||
or notFound($c, "Project $projectName doesn't exist.");
|
||||
|
||||
$c->stash->{curProject} = $project;
|
||||
|
||||
$c->stash->{jobset} = $project->jobsets->find({name => $jobsetName})
|
||||
or notFound($c, "Jobset $jobsetName doesn't exist.");
|
||||
|
||||
$c->stash->{jobName} = $jobName;
|
||||
|
||||
# !!! nothing to do here yet, since we don't have a jobs table.
|
||||
}
|
||||
|
||||
|
||||
|
@ -26,7 +33,7 @@ sub index : Chained('job') PathPart('') Args(0) {
|
|||
sub get_builds : Chained('job') PathPart('') CaptureArgs(0) {
|
||||
my ($self, $c) = @_;
|
||||
$c->stash->{allBuilds} =
|
||||
$c->stash->{curProject}->builds->search({job => $c->stash->{jobName}});
|
||||
$c->stash->{jobset}->builds->search({job => $c->stash->{jobName}});
|
||||
$c->stash->{channelBaseName} =
|
||||
$c->stash->{curProject}->name . "-" . $c->stash->{jobName};
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@ use Hydra::Helper::CatalystUtils;
|
|||
sub project : Chained('/') PathPart('project') CaptureArgs(1) {
|
||||
my ($self, $c, $projectName) = @_;
|
||||
|
||||
my $project = $c->model('DB::Projects')->find($projectName);
|
||||
notFound($c, "Project $projectName doesn't exist.") unless defined $project;
|
||||
my $project = $c->model('DB::Projects')->find($projectName)
|
||||
or notFound($c, "Project $projectName doesn't exist.");
|
||||
|
||||
$c->stash->{curProject} = $project;
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema';
|
|||
__PACKAGE__->load_classes;
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oeLeU2T8C2dVBS+ugF0p8g
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oIv4qqdjLKRDgAYXHHTz8A
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -36,8 +36,8 @@ __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
|
|||
__PACKAGE__->belongs_to("dependency", "Hydra::Schema::Builds", { id => "dependency" });
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CLL7aeJ0fe0NX3LCnNs4/A
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9gWr8DPEeH2BjoHT3nt0Lw
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -35,8 +35,8 @@ __PACKAGE__->set_primary_key("build", "productnr");
|
|||
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9Eer/gLCKlOKfnwC+kfFaw
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GsPyt1OUQHWN6z7mSpNW2g
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -35,8 +35,8 @@ __PACKAGE__->set_primary_key("id");
|
|||
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ieF3JOI4N3XZUyMboZhrjg
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zIpamqoL0AxNFDpQ/W1TVg
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"failedDep",
|
||||
|
|
|
@ -27,8 +27,8 @@ __PACKAGE__->set_primary_key("id");
|
|||
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oomDjaTJHIQjraUqhzFPsg
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:McWRZEMJtjFIcR4LplCc9A
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -35,7 +35,7 @@ __PACKAGE__->set_primary_key("build", "stepnr");
|
|||
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+nb1zsYcv9WziZ6IHcc/yw
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zuyAJq4T5Ynsq920Pd7hLg
|
||||
|
||||
1;
|
||||
|
|
|
@ -76,8 +76,8 @@ __PACKAGE__->has_many(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UahvxjBmn7b70IK+QcnKHA
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6taCYZNB0HaY+fvDjUhrYQ
|
||||
|
||||
__PACKAGE__->has_many(dependents => 'Hydra::Schema::BuildInputs', 'dependency');
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@ __PACKAGE__->add_columns(
|
|||
__PACKAGE__->set_primary_key("srcpath", "sha256hash");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+AZEuCFAfkl7SKwlxDBnaw
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Jhu1KxMfSF1Y1b4VGUqTzg
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -20,8 +20,8 @@ __PACKAGE__->add_columns(
|
|||
__PACKAGE__->set_primary_key("uri", "revision");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2JtWOkH5OVGl7Cb7STLM5Q
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9aQa6Zo6z3lj/qFHNF5//w
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -31,8 +31,8 @@ __PACKAGE__->belongs_to(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ka/dxG48LaZOQeShZFs0Hw
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fBv361MRwuWvAJQnOLZDIw
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -22,7 +22,7 @@ __PACKAGE__->has_many(
|
|||
"jobsets",
|
||||
"Hydra::Schema::Jobsets",
|
||||
{
|
||||
"foreign.name" => "self.job",
|
||||
"foreign.name" => "self.jobset",
|
||||
"foreign.nixexprinput" => "self.name",
|
||||
"foreign.project" => "self.project",
|
||||
},
|
||||
|
@ -43,8 +43,8 @@ __PACKAGE__->has_many(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:earsp0XPWppy5/VOJkQ/PA
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:S8AQqv8/GkLkXpPutV4N0A
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -38,7 +38,7 @@ __PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project
|
|||
__PACKAGE__->belongs_to(
|
||||
"jobsetinput",
|
||||
"Hydra::Schema::JobsetInputs",
|
||||
{ job => "name", name => "nixexprinput", project => "project" },
|
||||
{ jobset => "name", name => "nixexprinput", project => "project" },
|
||||
);
|
||||
__PACKAGE__->has_many(
|
||||
"jobsetinputs",
|
||||
|
@ -50,8 +50,8 @@ __PACKAGE__->has_many(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ADLNgkS2YPv4DuszwHau7g
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xYDUCEXRPeVdFJBQnG/Wog
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -45,8 +45,8 @@ __PACKAGE__->has_many(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:R/GeZxDujiuKze++Mc2ZTw
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9ZqA/21u40pt4t85YrYbeg
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -34,8 +34,8 @@ __PACKAGE__->belongs_to(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OM2joIa3Bj6t9BhVrOjN8Q
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ta71pOzVsej/w0FoHIUMbg
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -29,8 +29,8 @@ __PACKAGE__->has_many(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gSzri22yKGHLKCjNLv9/VQ
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0DtIgm5jznjy1l3809b06Q
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -16,8 +16,8 @@ __PACKAGE__->add_columns(
|
|||
__PACKAGE__->set_primary_key("system");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:viZlvDAHk9k8ScuA/qfUGw
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WUSl5Uivcl6E1KLxiq+89A
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -17,8 +17,8 @@ __PACKAGE__->set_primary_key("username", "role");
|
|||
__PACKAGE__->belongs_to("username", "Hydra::Schema::Users", { username => "username" });
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gRuZJKELtc15+vQFjxjkKQ
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:x/HXSH7s3bgPJSLK71hV9w
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -30,8 +30,8 @@ __PACKAGE__->has_many(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Lomf54EURbBIbrWGojiFIw
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 17:44:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uP86PxN/ZWgy5PRVU7Qgow
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
[% PROCESS common.tt %]
|
||||
|
||||
<h1>All Builds
|
||||
[% IF jobName %]for Job [% curProject.name %]:[% jobName %][% ELSE %]
|
||||
[% IF jobName %]for Job [% curProject.name %]:[% jobset.name %]:[% jobName %][% ELSE %]
|
||||
[% IF curProject %] for Project <tt>[% curProject.name %]</tt>[% END %][% END %]</h1>
|
||||
|
||||
<p>Showing builds [% (page - 1) * resultsPerPage + 1 %] - [% (page - 1) * resultsPerPage + builds.size %]
|
||||
|
|
|
@ -3,8 +3,12 @@
|
|||
[% PROCESS "product-list.tt" %]
|
||||
[% USE HTML %]
|
||||
|
||||
[% project = build.get_column('project') %]
|
||||
[% jobset = build.get_column('jobset') %]
|
||||
[% job = build.get_column('job') %]
|
||||
|
||||
<h1>
|
||||
Job <tt>[% build.project.name %]:[% build.job %]</tt> build [% id %]
|
||||
Job <tt>[% project %]:[% jobset %]:[% job %]</tt> build [% id %]
|
||||
[% IF !build.finished %]
|
||||
[% IF build.schedulingInfo.busy %]
|
||||
(currently building)
|
||||
|
@ -73,15 +77,15 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th>Project:</th>
|
||||
<td><a href="[% c.uri_for('/project' build.project.name) %]"><tt>[% build.project.name %]</tt></a></td>
|
||||
<td>[% PROCESS renderProjectName %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Jobset:</th>
|
||||
<td><tt>[% build.jobset.name %]</tt></td>
|
||||
<td>[% PROCESS renderJobsetName %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Job name:</th>
|
||||
<td><a href="[% c.uri_for('/project' build.project.name 'job' build.job) %]"><tt>[% build.job %]</tt></a></td>
|
||||
<td>[% PROCESS renderJobName %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Nix name:</th>
|
||||
|
@ -105,6 +109,10 @@
|
|||
<th>License:</th>
|
||||
<td>[% IF build.license %][% HTML.escape(build.license) %][% ELSE %]<em>(not given)</em>[% END %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Homepage:</th>
|
||||
<td>[% IF build.homepage %]<a [% HTML.attributes(href => build.homepage) %]>[% HTML.escape(build.homepage) %]</a>[% ELSE %]<em>(not given)</em>[% END %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>System:</th>
|
||||
<td><tt>[% build.system %]</tt></td>
|
||||
|
|
|
@ -18,6 +18,25 @@
|
|||
[% END %]
|
||||
|
||||
|
||||
[% BLOCK renderProjectName -%]
|
||||
<a href="[% c.uri_for('/project' project) %]"><tt>[% project %]</tt></a>[% END -%]
|
||||
|
||||
|
||||
[% BLOCK renderJobsetName -%]
|
||||
<a href="[% c.uri_for('/jobset' project jobset) %]"><tt>[% jobset %]</tt></a>[% END -%]
|
||||
|
||||
|
||||
[% BLOCK renderJobName -%]
|
||||
<a href="[% c.uri_for('/job' project jobset job) %]"><tt>[% job %]</tt></a>[% END -%]
|
||||
|
||||
|
||||
[% BLOCK renderFullJobName %]
|
||||
<tt>
|
||||
[% PROCESS renderProjectName %]:[% PROCESS renderJobsetName %]:[% PROCESS renderJobName %]
|
||||
</a>
|
||||
[% END %]
|
||||
|
||||
|
||||
[% BLOCK renderBuildList %]
|
||||
<table class="buildList tablesorter">
|
||||
<thead>
|
||||
|
@ -29,9 +48,8 @@
|
|||
[% IF showSchedulingInfo %]
|
||||
<th>Priority</th>
|
||||
[% END %]
|
||||
<th>Project</th>
|
||||
<th>Job</th>
|
||||
<th>Name</th>
|
||||
<th>Release Name</th>
|
||||
<th>System</th>
|
||||
<th>Timestamp</th>
|
||||
<th>Description</th>
|
||||
|
@ -60,8 +78,9 @@
|
|||
[% IF showSchedulingInfo %]
|
||||
<td>[% build.schedulingInfo.priority %]</td>
|
||||
[% 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") 'job' build.job) %]"><tt>[% build.job %]</tt></a></td>
|
||||
<td>
|
||||
[% PROCESS renderFullJobName project=build.get_column("project") jobset = build.get_column("jobset") job = build.job %]
|
||||
</td>
|
||||
<td>[% build.resultInfo.releasename ? build.resultInfo.releasename : build.nixname %]</td>
|
||||
<td><tt>[% build.system %]</tt></td>
|
||||
<td>[% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %]</td>
|
||||
|
|
|
@ -235,6 +235,7 @@ sub checkJob {
|
|||
, description => $job->{description}
|
||||
, longdescription => $job->{longDescription}
|
||||
, license => $job->{license}
|
||||
, homepage => $job->{homepage}
|
||||
, nixname => $job->{nixName}
|
||||
, drvpath => $drvPath
|
||||
, outpath => $outPath
|
||||
|
|
|
@ -200,7 +200,7 @@ create table Jobsets (
|
|||
lastCheckedTime integer, -- last time the scheduler looked at this jobset
|
||||
primary key (project, name),
|
||||
foreign key (project) references Projects(name) on delete cascade, -- ignored by sqlite
|
||||
foreign key (project, name, nixExprInput) references JobsetInputs(project, job, name)
|
||||
foreign key (project, name, nixExprInput) references JobsetInputs(project, jobset, name)
|
||||
);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue