* Mark the "current" builds in a jobset, i.e. those corresponding to

the derivations that the jobset currently contains.  This is
  necessary to allow the "latest" channel to contain the correct
  builds when the sources of a jobset are reverted.
This commit is contained in:
Eelco Dolstra
2009-10-02 16:06:28 +00:00
parent 9d99bb3342
commit e9cf409d80
22 changed files with 98 additions and 59 deletions

View File

@ -26,7 +26,7 @@ sub overview : Chained('job') PathPart('') Args(0) {
getBuildStats($c, scalar $c->stash->{job}->builds);
$c->stash->{systems} = [$c->stash->{job}->builds->search({}, {select => ["system"], distinct => 1})];
$c->stash->{systems} = [$c->stash->{job}->builds->search({iscurrent => 1}, {select => ["system"], distinct => 1})];
}

View File

@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema';
__PACKAGE__->load_classes;
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tt53dmgGYiV3yqHvnrSwkg
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uBemU8brohK9UDFJ9KC1iA
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -103,8 +103,8 @@ __PACKAGE__->belongs_to(
);
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:02BDWXRn4LMcb0LFjHXqjg
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3l2Qu/wpPEb/xsXoyeRviQ
use Hydra::Helper::Nix;

View File

@ -91,8 +91,8 @@ __PACKAGE__->set_primary_key("build", "productnr");
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Fqzw8pcHMrUjdJZ/a43D3w
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/AUVD2QjjkeQmFkKEim0Gw
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -86,8 +86,8 @@ __PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KjrreyjxFwFTGDzdA9J42w
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:L/qLimgzcHeLjsKom3t1XQ
__PACKAGE__->belongs_to(
"failedDep",

View File

@ -43,8 +43,8 @@ __PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jgOkt31QNifyPD8Y0rkVBA
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:I2cNoG9FOWDlICSy4Ndftw
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -91,7 +91,7 @@ __PACKAGE__->set_primary_key("build", "stepnr");
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7z14GDq6a8ndBoj3Mx/3TQ
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oCn8y9Nsffa6WOnm44lyqQ
1;

View File

@ -116,6 +116,8 @@ __PACKAGE__->add_columns(
is_nullable => 1,
size => undef,
},
"iscurrent",
{ data_type => "integer", default_value => 0, is_nullable => 1, size => undef },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" });
@ -161,8 +163,8 @@ __PACKAGE__->has_many(
);
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mTc++yn7RST163jLNJkXaw
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8r7Yv4O8WF2YU4sOjn0Q8w
use Hydra::Helper::Nix;
@ -217,7 +219,7 @@ sub makeQueries {
" where x.project = c.project and x.jobset = c.jobset and x.job = c.job and x.system = c.system and " .
" x.id > c.id and r.buildstatus != r2.buildstatus)";
# Urgh, can't use "*" in the "select" here because of the status change join.
makeSource('JobStatus' . $name, "select x.id, x.finished, x.timestamp, x.project, x.jobset, x.job, x.nixname, x.description, x.drvpath, x.outpath, x.system, x.longdescription, x.license, x.homepage, x.maintainers, b.id as statusChangeId, b.timestamp as statusChangeTime from (select project, jobset, job, system, max(id) as id from Builds where finished = 1 $constraint group by project, jobset, job, system) as latest natural join Builds x $joinWithStatusChange");
makeSource('JobStatus' . $name, "select x.id, x.finished, x.timestamp, x.project, x.jobset, x.job, x.nixname, x.description, x.drvpath, x.outpath, x.system, x.longdescription, x.license, x.homepage, x.maintainers, x.isCurrent, b.id as statusChangeId, b.timestamp as statusChangeTime from (select project, jobset, job, system, max(id) as id from Builds where finished = 1 $constraint group by project, jobset, job, system) as latest natural join Builds x $joinWithStatusChange");
makeSource('LatestSucceeded' . $name, "select * from (select project, jobset, job, system, max(id) as id from Builds natural join BuildResultInfo where finished = 1 and buildStatus = 0 $constraint group by project, jobset, job, system) as latest natural join Builds x");
}

View File

@ -47,8 +47,8 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("srcpath", "sha256hash");
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sEZCtuR96OmFAZe4ykVTUA
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eLemrXw7iydgI6zhFrghRg
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -40,8 +40,8 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("uri", "revision");
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ImarwuHMkKrQ2GemxREDig
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:f2Xn8X5aO9Gud7LHrc/b2g
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -75,8 +75,8 @@ __PACKAGE__->belongs_to(
);
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OFEAwA4W5q0AF8uZ3JswFQ
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:w5CXchrT0/ueNgxnKv6TPg
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -69,8 +69,8 @@ __PACKAGE__->belongs_to(
);
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kcIcgSux+SzIH7FQs2cnAw
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CQg509K7bBReX30DeMC7ww
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -65,8 +65,8 @@ __PACKAGE__->has_many(
);
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SkF1SaumgGAQvR9mUbPV+Q
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FzkQQT8t8OET0a0teF3lHA
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -101,8 +101,8 @@ __PACKAGE__->has_many(
);
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lMdNiE6x4qZLK14+jEM7YQ
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eu0jlMKE2aMvQRv4LynlIA
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -76,8 +76,8 @@ __PACKAGE__->has_many(
);
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lDNoBncP2KhnrfbQIg+Usw
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aBN2ry0QEPIhQu6tlgk7RQ
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -66,8 +66,8 @@ __PACKAGE__->belongs_to(
);
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xaWTZqtzPyMq/xqi0ZFCDg
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Mm9VR//LwfM88N54dtmuxg
# 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.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sYojSdWhlGMAL7Vj/UynBw
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c6FKyR68F1a8wLivK9ztog
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -21,8 +21,8 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("system");
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QYzvQmgXtV3NURhO5j5F4Q
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SYnu+3J84FXFqkSu8jxkPg
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -28,8 +28,8 @@ __PACKAGE__->set_primary_key("username", "role");
__PACKAGE__->belongs_to("username", "Hydra::Schema::Users", { username => "username" });
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:syo00cqS/fp5mJt2jg+YJw
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pRBijh3yc0x4knK6tU4iTw
# 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.04999_06 @ 2009-07-07 14:36:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZH7GmAkTPdZm7G5aCp746A
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:d4m+IH9KxIcgId+XF23txg
# You can replace this text with custom content, and it will be preserved on regeneration