2008-11-25 11:01:42 +00:00
|
|
|
package Hydra::Schema::Builds;
|
2008-10-28 10:19:31 +00:00
|
|
|
|
2009-10-23 15:05:16 +00:00
|
|
|
# Created by DBIx::Class::Schema::Loader
|
|
|
|
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
|
|
|
|
2008-10-28 10:19:31 +00:00
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
2010-02-25 09:50:04 +00:00
|
|
|
use base 'DBIx::Class::Core';
|
|
|
|
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
|
|
|
Hydra::Schema::Builds
|
|
|
|
|
|
|
|
=cut
|
2008-10-28 10:19:31 +00:00
|
|
|
|
2008-11-11 12:54:37 +00:00
|
|
|
__PACKAGE__->table("Builds");
|
2010-02-25 09:50:04 +00:00
|
|
|
|
|
|
|
=head1 ACCESSORS
|
|
|
|
|
|
|
|
=head2 id
|
|
|
|
|
|
|
|
data_type: integer
|
|
|
|
default_value: undef
|
|
|
|
is_auto_increment: 1
|
|
|
|
is_nullable: 0
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 finished
|
|
|
|
|
|
|
|
data_type: integer
|
|
|
|
default_value: undef
|
|
|
|
is_nullable: 0
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 timestamp
|
|
|
|
|
|
|
|
data_type: integer
|
|
|
|
default_value: undef
|
|
|
|
is_nullable: 0
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 project
|
|
|
|
|
|
|
|
data_type: text
|
|
|
|
default_value: undef
|
|
|
|
is_foreign_key: 1
|
|
|
|
is_nullable: 0
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 jobset
|
|
|
|
|
|
|
|
data_type: text
|
|
|
|
default_value: undef
|
|
|
|
is_foreign_key: 1
|
|
|
|
is_nullable: 0
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 job
|
|
|
|
|
|
|
|
data_type: text
|
|
|
|
default_value: undef
|
|
|
|
is_foreign_key: 1
|
|
|
|
is_nullable: 0
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 nixname
|
|
|
|
|
|
|
|
data_type: text
|
|
|
|
default_value: undef
|
|
|
|
is_nullable: 1
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 description
|
|
|
|
|
|
|
|
data_type: text
|
|
|
|
default_value: undef
|
|
|
|
is_nullable: 1
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 drvpath
|
|
|
|
|
|
|
|
data_type: text
|
|
|
|
default_value: undef
|
|
|
|
is_nullable: 0
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 outpath
|
|
|
|
|
|
|
|
data_type: text
|
|
|
|
default_value: undef
|
|
|
|
is_nullable: 0
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 system
|
|
|
|
|
|
|
|
data_type: text
|
|
|
|
default_value: undef
|
|
|
|
is_nullable: 0
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 longdescription
|
|
|
|
|
|
|
|
data_type: text
|
|
|
|
default_value: undef
|
|
|
|
is_nullable: 1
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 license
|
|
|
|
|
|
|
|
data_type: text
|
|
|
|
default_value: undef
|
|
|
|
is_nullable: 1
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 homepage
|
|
|
|
|
|
|
|
data_type: text
|
|
|
|
default_value: undef
|
|
|
|
is_nullable: 1
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 maintainers
|
|
|
|
|
|
|
|
data_type: text
|
|
|
|
default_value: undef
|
|
|
|
is_nullable: 1
|
|
|
|
size: undef
|
|
|
|
|
2010-05-26 08:03:59 +00:00
|
|
|
=head2 maxsilent
|
|
|
|
|
|
|
|
data_type: integer
|
|
|
|
default_value: 3600
|
|
|
|
is_nullable: 1
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 timeout
|
|
|
|
|
|
|
|
data_type: integer
|
|
|
|
default_value: 36000
|
|
|
|
is_nullable: 1
|
|
|
|
size: undef
|
|
|
|
|
2010-02-25 09:50:04 +00:00
|
|
|
=head2 iscurrent
|
|
|
|
|
|
|
|
data_type: integer
|
|
|
|
default_value: 0
|
|
|
|
is_nullable: 1
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 nixexprinput
|
|
|
|
|
|
|
|
data_type: text
|
|
|
|
default_value: undef
|
|
|
|
is_nullable: 1
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=head2 nixexprpath
|
|
|
|
|
|
|
|
data_type: text
|
|
|
|
default_value: undef
|
|
|
|
is_nullable: 1
|
|
|
|
size: undef
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
2008-10-28 10:19:31 +00:00
|
|
|
__PACKAGE__->add_columns(
|
|
|
|
"id",
|
2009-07-07 13:59:59 +00:00
|
|
|
{
|
|
|
|
data_type => "integer",
|
|
|
|
default_value => undef,
|
2009-10-23 15:05:16 +00:00
|
|
|
is_auto_increment => 1,
|
2009-07-07 13:59:59 +00:00
|
|
|
is_nullable => 0,
|
|
|
|
size => undef,
|
|
|
|
},
|
2008-11-11 12:54:37 +00:00
|
|
|
"finished",
|
2009-07-07 13:59:59 +00:00
|
|
|
{
|
|
|
|
data_type => "integer",
|
|
|
|
default_value => undef,
|
|
|
|
is_nullable => 0,
|
|
|
|
size => undef,
|
|
|
|
},
|
2008-10-28 10:19:31 +00:00
|
|
|
"timestamp",
|
2009-07-07 13:59:59 +00:00
|
|
|
{
|
|
|
|
data_type => "integer",
|
|
|
|
default_value => undef,
|
|
|
|
is_nullable => 0,
|
|
|
|
size => undef,
|
|
|
|
},
|
2008-11-04 18:23:28 +00:00
|
|
|
"project",
|
2009-07-07 13:59:59 +00:00
|
|
|
{
|
|
|
|
data_type => "text",
|
|
|
|
default_value => undef,
|
|
|
|
is_foreign_key => 1,
|
|
|
|
is_nullable => 0,
|
|
|
|
size => undef,
|
|
|
|
},
|
2008-11-04 18:23:28 +00:00
|
|
|
"jobset",
|
2009-07-07 13:59:59 +00:00
|
|
|
{
|
|
|
|
data_type => "text",
|
|
|
|
default_value => undef,
|
|
|
|
is_foreign_key => 1,
|
|
|
|
is_nullable => 0,
|
|
|
|
size => undef,
|
|
|
|
},
|
2009-03-12 14:18:30 +00:00
|
|
|
"job",
|
2009-07-07 13:59:59 +00:00
|
|
|
{
|
|
|
|
data_type => "text",
|
|
|
|
default_value => undef,
|
|
|
|
is_foreign_key => 1,
|
|
|
|
is_nullable => 0,
|
|
|
|
size => undef,
|
|
|
|
},
|
2008-11-12 16:42:07 +00:00
|
|
|
"nixname",
|
2009-07-07 13:59:59 +00:00
|
|
|
{
|
|
|
|
data_type => "text",
|
|
|
|
default_value => undef,
|
|
|
|
is_nullable => 1,
|
|
|
|
size => undef,
|
|
|
|
},
|
2008-10-28 10:19:31 +00:00
|
|
|
"description",
|
2009-07-07 13:59:59 +00:00
|
|
|
{
|
|
|
|
data_type => "text",
|
|
|
|
default_value => undef,
|
|
|
|
is_nullable => 1,
|
|
|
|
size => undef,
|
|
|
|
},
|
2008-10-28 10:19:31 +00:00
|
|
|
"drvpath",
|
2009-07-07 13:59:59 +00:00
|
|
|
{
|
|
|
|
data_type => "text",
|
|
|
|
default_value => undef,
|
|
|
|
is_nullable => 0,
|
|
|
|
size => undef,
|
|
|
|
},
|
2008-10-28 10:19:31 +00:00
|
|
|
"outpath",
|
2009-07-07 13:59:59 +00:00
|
|
|
{
|
|
|
|
data_type => "text",
|
|
|
|
default_value => undef,
|
|
|
|
is_nullable => 0,
|
|
|
|
size => undef,
|
|
|
|
},
|
2008-11-06 18:26:29 +00:00
|
|
|
"system",
|
2009-07-07 13:59:59 +00:00
|
|
|
{
|
|
|
|
data_type => "text",
|
|
|
|
default_value => undef,
|
|
|
|
is_nullable => 0,
|
|
|
|
size => undef,
|
|
|
|
},
|
2008-12-16 15:09:39 +00:00
|
|
|
"longdescription",
|
2009-07-07 13:59:59 +00:00
|
|
|
{
|
|
|
|
data_type => "text",
|
|
|
|
default_value => undef,
|
|
|
|
is_nullable => 1,
|
|
|
|
size => undef,
|
|
|
|
},
|
2008-12-16 15:09:39 +00:00
|
|
|
"license",
|
2009-07-07 13:59:59 +00:00
|
|
|
{
|
|
|
|
data_type => "text",
|
|
|
|
default_value => undef,
|
|
|
|
is_nullable => 1,
|
|
|
|
size => undef,
|
|
|
|
},
|
2009-03-04 14:49:21 +00:00
|
|
|
"homepage",
|
2009-07-07 13:59:59 +00:00
|
|
|
{
|
|
|
|
data_type => "text",
|
|
|
|
default_value => undef,
|
|
|
|
is_nullable => 1,
|
|
|
|
size => undef,
|
|
|
|
},
|
|
|
|
"maintainers",
|
|
|
|
{
|
|
|
|
data_type => "text",
|
|
|
|
default_value => undef,
|
|
|
|
is_nullable => 1,
|
|
|
|
size => undef,
|
|
|
|
},
|
2010-05-26 08:03:59 +00:00
|
|
|
"maxsilent",
|
|
|
|
{
|
|
|
|
data_type => "integer",
|
|
|
|
default_value => 3600,
|
|
|
|
is_nullable => 1,
|
|
|
|
size => undef,
|
|
|
|
},
|
|
|
|
"timeout",
|
|
|
|
{
|
|
|
|
data_type => "integer",
|
|
|
|
default_value => 36000,
|
|
|
|
is_nullable => 1,
|
|
|
|
size => undef,
|
|
|
|
},
|
2009-10-02 16:06:28 +00:00
|
|
|
"iscurrent",
|
|
|
|
{ data_type => "integer", default_value => 0, is_nullable => 1, size => undef },
|
2009-10-26 13:33:48 +00:00
|
|
|
"nixexprinput",
|
|
|
|
{
|
|
|
|
data_type => "text",
|
|
|
|
default_value => undef,
|
|
|
|
is_nullable => 1,
|
|
|
|
size => undef,
|
|
|
|
},
|
|
|
|
"nixexprpath",
|
|
|
|
{
|
|
|
|
data_type => "text",
|
|
|
|
default_value => undef,
|
|
|
|
is_nullable => 1,
|
|
|
|
size => undef,
|
|
|
|
},
|
2008-10-28 10:19:31 +00:00
|
|
|
);
|
|
|
|
__PACKAGE__->set_primary_key("id");
|
2010-02-25 09:50:04 +00:00
|
|
|
|
|
|
|
=head1 RELATIONS
|
|
|
|
|
|
|
|
=head2 project
|
|
|
|
|
|
|
|
Type: belongs_to
|
|
|
|
|
|
|
|
Related object: L<Hydra::Schema::Projects>
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
|
|
|
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }, {});
|
|
|
|
|
|
|
|
=head2 jobset
|
|
|
|
|
|
|
|
Type: belongs_to
|
|
|
|
|
|
|
|
Related object: L<Hydra::Schema::Jobsets>
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
2008-11-10 10:18:50 +00:00
|
|
|
__PACKAGE__->belongs_to(
|
|
|
|
"jobset",
|
2008-11-25 11:01:42 +00:00
|
|
|
"Hydra::Schema::Jobsets",
|
2008-11-10 10:18:50 +00:00
|
|
|
{ name => "jobset", project => "project" },
|
2010-02-25 09:50:04 +00:00
|
|
|
{},
|
2008-11-10 10:18:50 +00:00
|
|
|
);
|
2010-02-25 09:50:04 +00:00
|
|
|
|
|
|
|
=head2 job
|
|
|
|
|
|
|
|
Type: belongs_to
|
|
|
|
|
|
|
|
Related object: L<Hydra::Schema::Jobs>
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
2009-03-13 14:49:25 +00:00
|
|
|
__PACKAGE__->belongs_to(
|
|
|
|
"job",
|
|
|
|
"Hydra::Schema::Jobs",
|
|
|
|
{ jobset => "jobset", name => "job", project => "project" },
|
2010-02-25 09:50:04 +00:00
|
|
|
{},
|
2009-03-13 14:49:25 +00:00
|
|
|
);
|
2010-02-25 09:50:04 +00:00
|
|
|
|
|
|
|
=head2 buildschedulinginfo
|
|
|
|
|
|
|
|
Type: might_have
|
|
|
|
|
|
|
|
Related object: L<Hydra::Schema::BuildSchedulingInfo>
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
2009-07-07 13:59:59 +00:00
|
|
|
__PACKAGE__->might_have(
|
|
|
|
"buildschedulinginfo",
|
2008-12-16 16:26:33 +00:00
|
|
|
"Hydra::Schema::BuildSchedulingInfo",
|
2008-11-11 12:54:37 +00:00
|
|
|
{ "foreign.id" => "self.id" },
|
|
|
|
);
|
2010-02-25 09:50:04 +00:00
|
|
|
|
|
|
|
=head2 buildresultinfo
|
|
|
|
|
|
|
|
Type: might_have
|
|
|
|
|
|
|
|
Related object: L<Hydra::Schema::BuildResultInfo>
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
2009-07-07 13:59:59 +00:00
|
|
|
__PACKAGE__->might_have(
|
|
|
|
"buildresultinfo",
|
2008-12-16 16:26:33 +00:00
|
|
|
"Hydra::Schema::BuildResultInfo",
|
2008-11-11 12:54:37 +00:00
|
|
|
{ "foreign.id" => "self.id" },
|
|
|
|
);
|
2010-02-25 09:50:04 +00:00
|
|
|
|
|
|
|
=head2 buildsteps
|
|
|
|
|
|
|
|
Type: has_many
|
|
|
|
|
|
|
|
Related object: L<Hydra::Schema::BuildSteps>
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
2008-11-12 16:42:07 +00:00
|
|
|
__PACKAGE__->has_many(
|
|
|
|
"buildsteps",
|
2008-12-16 16:26:33 +00:00
|
|
|
"Hydra::Schema::BuildSteps",
|
2009-03-12 14:18:30 +00:00
|
|
|
{ "foreign.build" => "self.id" },
|
2008-11-12 16:42:07 +00:00
|
|
|
);
|
2010-02-25 09:50:04 +00:00
|
|
|
|
|
|
|
=head2 buildinputs_builds
|
|
|
|
|
|
|
|
Type: has_many
|
|
|
|
|
|
|
|
Related object: L<Hydra::Schema::BuildInputs>
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
2008-11-11 12:54:37 +00:00
|
|
|
__PACKAGE__->has_many(
|
|
|
|
"buildinputs_builds",
|
2008-12-16 16:26:33 +00:00
|
|
|
"Hydra::Schema::BuildInputs",
|
2008-11-09 00:48:36 +00:00
|
|
|
{ "foreign.build" => "self.id" },
|
2008-11-08 22:40:12 +00:00
|
|
|
);
|
2010-02-25 09:50:04 +00:00
|
|
|
|
|
|
|
=head2 buildinputs_dependencies
|
|
|
|
|
|
|
|
Type: has_many
|
|
|
|
|
|
|
|
Related object: L<Hydra::Schema::BuildInputs>
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
2008-11-11 12:54:37 +00:00
|
|
|
__PACKAGE__->has_many(
|
|
|
|
"buildinputs_dependencies",
|
2008-12-16 16:26:33 +00:00
|
|
|
"Hydra::Schema::BuildInputs",
|
2008-11-11 12:54:37 +00:00
|
|
|
{ "foreign.dependency" => "self.id" },
|
|
|
|
);
|
2010-02-25 09:50:04 +00:00
|
|
|
|
|
|
|
=head2 buildproducts
|
|
|
|
|
|
|
|
Type: has_many
|
|
|
|
|
|
|
|
Related object: L<Hydra::Schema::BuildProducts>
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
2008-10-28 10:19:31 +00:00
|
|
|
__PACKAGE__->has_many(
|
2008-11-12 16:42:07 +00:00
|
|
|
"buildproducts",
|
2008-12-16 16:26:33 +00:00
|
|
|
"Hydra::Schema::BuildProducts",
|
2008-11-09 00:48:36 +00:00
|
|
|
{ "foreign.build" => "self.id" },
|
2008-10-28 10:19:31 +00:00
|
|
|
);
|
2010-02-25 09:50:04 +00:00
|
|
|
|
|
|
|
=head2 releasemembers
|
|
|
|
|
|
|
|
Type: has_many
|
|
|
|
|
|
|
|
Related object: L<Hydra::Schema::ReleaseMembers>
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
2009-10-21 15:44:17 +00:00
|
|
|
__PACKAGE__->has_many(
|
|
|
|
"releasemembers",
|
|
|
|
"Hydra::Schema::ReleaseMembers",
|
|
|
|
{ "foreign.build" => "self.id" },
|
|
|
|
);
|
2008-10-28 10:19:31 +00:00
|
|
|
|
2010-03-05 15:41:10 +00:00
|
|
|
=head2 jobsetevalmembers
|
2008-10-28 10:19:31 +00:00
|
|
|
|
2010-03-05 15:41:10 +00:00
|
|
|
Type: has_many
|
|
|
|
|
|
|
|
Related object: L<Hydra::Schema::JobsetEvalMembers>
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
|
|
|
__PACKAGE__->has_many(
|
|
|
|
"jobsetevalmembers",
|
|
|
|
"Hydra::Schema::JobsetEvalMembers",
|
|
|
|
{ "foreign.build" => "self.id" },
|
|
|
|
);
|
|
|
|
|
|
|
|
|
2010-05-26 08:03:59 +00:00
|
|
|
# Created by DBIx::Class::Schema::Loader v0.05000 @ 2010-05-26 09:25:50
|
|
|
|
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OApfteImw84nYhUvSUB4FA
|
2008-11-11 12:54:37 +00:00
|
|
|
|
2009-05-09 16:10:50 +00:00
|
|
|
use Hydra::Helper::Nix;
|
|
|
|
|
2009-07-07 13:59:59 +00:00
|
|
|
__PACKAGE__->has_many(
|
|
|
|
"dependents",
|
|
|
|
"Hydra::Schema::BuildInputs",
|
|
|
|
{ "foreign.dependency" => "self.id" },
|
|
|
|
);
|
2008-10-28 10:19:31 +00:00
|
|
|
|
2008-11-27 15:16:06 +00:00
|
|
|
__PACKAGE__->many_to_many(dependentBuilds => 'dependents', 'build');
|
|
|
|
|
2009-07-07 13:59:59 +00:00
|
|
|
__PACKAGE__->has_many(
|
|
|
|
"inputs",
|
|
|
|
"Hydra::Schema::BuildInputs",
|
|
|
|
{ "foreign.build" => "self.id" },
|
|
|
|
);
|
2008-11-11 12:54:37 +00:00
|
|
|
|
|
|
|
__PACKAGE__->belongs_to(
|
|
|
|
"schedulingInfo",
|
2008-12-16 16:26:33 +00:00
|
|
|
"Hydra::Schema::BuildSchedulingInfo",
|
2008-11-11 12:54:37 +00:00
|
|
|
{ id => "id" },
|
|
|
|
);
|
|
|
|
|
|
|
|
__PACKAGE__->belongs_to(
|
|
|
|
"resultInfo",
|
2008-12-16 16:26:33 +00:00
|
|
|
"Hydra::Schema::BuildResultInfo",
|
2008-11-11 12:54:37 +00:00
|
|
|
{ id => "id" },
|
|
|
|
);
|
2008-11-06 13:40:31 +00:00
|
|
|
|
2010-02-25 10:22:03 +00:00
|
|
|
__PACKAGE__->has_one(
|
|
|
|
"actualBuildStep",
|
|
|
|
"Hydra::Schema::BuildSteps",
|
|
|
|
{ 'foreign.outpath' => 'self.outpath'
|
|
|
|
, 'foreign.build' => 'self.id'
|
|
|
|
},
|
|
|
|
);
|
|
|
|
|
2009-05-11 13:56:52 +00:00
|
|
|
sub addSequence {
|
2009-07-09 14:48:15 +00:00
|
|
|
my $hydradbi = getHydraDBPath;
|
|
|
|
if ($hydradbi =~ m/^dbi:Pg/) {
|
|
|
|
__PACKAGE__->sequence('builds_id_seq');
|
|
|
|
}
|
2009-05-07 13:30:55 +00:00
|
|
|
}
|
2009-04-03 15:37:21 +00:00
|
|
|
|
|
|
|
sub makeSource {
|
|
|
|
my ($name, $query) = @_;
|
|
|
|
my $source = __PACKAGE__->result_source_instance();
|
|
|
|
my $new_source = $source->new($source);
|
|
|
|
$new_source->source_name($name);
|
|
|
|
$new_source->name(\ "($query)");
|
|
|
|
Hydra::Schema->register_extra_source($name => $new_source);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub makeQueries {
|
|
|
|
my ($name, $constraint) = @_;
|
2009-10-07 13:40:58 +00:00
|
|
|
|
2009-07-09 14:48:15 +00:00
|
|
|
my $joinWithStatusChange =
|
2009-10-07 13:40:58 +00:00
|
|
|
<<QUERY;
|
|
|
|
natural join BuildResultInfo r
|
|
|
|
left join Builds b on
|
|
|
|
b.id =
|
|
|
|
(select max(id)
|
|
|
|
from builds c natural join buildresultinfo r2
|
|
|
|
where
|
|
|
|
x.project = c.project and x.jobset = c.jobset and x.job = c.job and x.system = c.system and
|
2009-10-07 13:59:12 +00:00
|
|
|
x.id > c.id and
|
|
|
|
((r.buildstatus = 0 and r2.buildstatus != 0) or
|
|
|
|
(r.buildstatus != 0 and r2.buildstatus = 0)))
|
2009-10-07 13:40:58 +00:00
|
|
|
QUERY
|
|
|
|
|
2009-10-07 15:45:17 +00:00
|
|
|
my $activeJobs = "(select distinct project, jobset, job, system from Builds where isCurrent = 1 $constraint)";
|
|
|
|
|
2009-10-07 13:40:58 +00:00
|
|
|
makeSource(
|
|
|
|
"JobStatus$name",
|
|
|
|
# Urgh, can't use "*" in the "select" here because of the status change join.
|
|
|
|
<<QUERY
|
|
|
|
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,
|
2009-10-26 17:03:48 +00:00
|
|
|
x.license, x.homepage, x.maintainers, x.isCurrent, x.nixExprInput,
|
|
|
|
x.nixExprPath,
|
2009-10-07 13:40:58 +00:00
|
|
|
b.id as statusChangeId, b.timestamp as statusChangeTime
|
|
|
|
from
|
2010-02-25 10:22:03 +00:00
|
|
|
(select
|
|
|
|
(select max(id) from builds b
|
|
|
|
where
|
|
|
|
project = activeJobs.project and jobset = activeJobs.jobset
|
|
|
|
and job = activeJobs.job and system = activeJobs.system
|
|
|
|
and finished = 1
|
|
|
|
) as id
|
2009-10-07 15:45:17 +00:00
|
|
|
from $activeJobs as activeJobs
|
2010-02-25 10:22:03 +00:00
|
|
|
) as latest
|
|
|
|
join Builds x using (id)
|
2009-10-07 13:40:58 +00:00
|
|
|
$joinWithStatusChange
|
|
|
|
QUERY
|
|
|
|
);
|
2010-02-25 10:22:03 +00:00
|
|
|
|
|
|
|
makeSource("ActiveJobs$name", "(select distinct project, jobset, job from Builds where isCurrent = 1 $constraint)");
|
2009-10-07 13:40:58 +00:00
|
|
|
|
|
|
|
makeSource(
|
|
|
|
"LatestSucceeded$name",
|
|
|
|
<<QUERY
|
|
|
|
select *
|
|
|
|
from
|
2010-02-25 10:22:03 +00:00
|
|
|
(select
|
|
|
|
(select max(id) from builds b
|
|
|
|
where
|
|
|
|
project = activeJobs.project and jobset = activeJobs.jobset
|
|
|
|
and job = activeJobs.job and system = activeJobs.system
|
|
|
|
and finished = 1
|
|
|
|
and exists (select 1 from buildresultinfo where id = b.id and buildstatus = 0)
|
|
|
|
) as id
|
2009-10-07 15:45:17 +00:00
|
|
|
from $activeJobs as activeJobs
|
2009-10-07 13:40:58 +00:00
|
|
|
) as latest
|
2010-02-25 10:22:03 +00:00
|
|
|
join Builds using (id)
|
2009-10-07 13:40:58 +00:00
|
|
|
QUERY
|
|
|
|
);
|
2009-04-03 15:37:21 +00:00
|
|
|
}
|
|
|
|
|
2009-05-11 13:56:52 +00:00
|
|
|
addSequence;
|
|
|
|
|
2009-04-03 15:37:21 +00:00
|
|
|
makeQueries('', "");
|
|
|
|
makeQueries('ForProject', "and project = ?");
|
|
|
|
makeQueries('ForJobset', "and project = ? and jobset = ?");
|
|
|
|
makeQueries('ForJob', "and project = ? and jobset = ? and job = ?");
|
|
|
|
|
2010-02-25 10:22:03 +00:00
|
|
|
|
2008-10-28 10:19:31 +00:00
|
|
|
1;
|