* 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) {
my ($self, $c) = @_;
$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->{curProject}->name . "-" . $c->stash->{jobName};
}

View File

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

View File

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

View File

@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema';
__PACKAGE__->load_classes;
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bK7m5SJjCnJKOckiufcb9w
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# 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

View File

@ -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:17:32
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:11XN47b5bRrRKiWtzLO+Pw
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# 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

View File

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

View File

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

View File

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

View File

@ -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:17:32
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Hjklk18AGqKd7dDPUlqS9A
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+AZEuCFAfkl7SKwlxDBnaw
# 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");
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OMt7YCEd4Vc3edHp2fxcrw
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2JtWOkH5OVGl7Cb7STLM5Q
# 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
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gQOuvSuoR2kczD57yaVSwQ
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# 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

View File

@ -43,8 +43,8 @@ __PACKAGE__->has_many(
);
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GpIp3ENzylBZ9HQUNhO17Q
# 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
# 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
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BcAloJiRDPMvL/+GqsPiTw
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ADLNgkS2YPv4DuszwHau7g
# 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
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TTHljyVTOMxXzNATXkltNg
# 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
# 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 },
"description",
{ 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__->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
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YC+cgQcuvO4TxC5UpU7u4A
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OM2joIa3Bj6t9BhVrOjN8Q
# 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
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Sv+5cdtqHDjWM0Zmmu0PSg
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# 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

View File

@ -16,8 +16,8 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("system");
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RLOKTpEzFYJMyzgMCg7zSg
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# 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

View File

@ -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:17:32
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QTXCy6SeSRYYXW3odCVLiQ
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:55:11
# 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

View File

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