Add isChannel column and meta attribute.

This is to properly separate channels from regular jobs and also make
sure that we can always iterate on them, no matter whether the build has
failed. The reason why we were not able to do this until now was because
we were iterating on the build products, and whenever some constituent
of a channel job has failed, we didn't get a build output.

So whenever there is a meta.isHydraChannel, we can now properly
distinguish it from the other jobs.

I still don't have any clue, why "make -C src/sql update-dbix" without
*any* modifications tries to create additional schema definitions. But
I've checked the md5sums of the existing schema definitions and they
don't seem to match, so it seems that they already have been tampered
with.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2015-04-21 07:45:50 +02:00
parent a235de3ad7
commit 06b76ab275
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961
5 changed files with 14 additions and 2 deletions

View file

@ -127,6 +127,7 @@ static void findJobsWrapped(EvalState & state, JSONObject & top,
res.attr("schedulingPriority", drv.queryMetaInt("schedulingPriority", 100));
res.attr("timeout", drv.queryMetaInt("timeout", 36000));
res.attr("maxSilent", drv.queryMetaInt("maxSilent", 7200));
res.attr("isChannel", drv.queryMetaBool("isHydraChannel", false));
/* If this is an aggregate, then get its constituents. */
Bindings::iterator a = v.attrs->find(state.symbols.create("_hydraAggregate"));

View file

@ -448,6 +448,7 @@ sub checkBuild {
, busy => 0
, locker => ""
, iscurrent => 1
, ischannel => $buildInfo->{isChannel}
});
$build->buildoutputs->create({ name => $_, path => $buildInfo->{outputs}->{$_} })

View file

@ -116,6 +116,12 @@ __PACKAGE__->table("Builds");
default_value: 36000
is_nullable: 1
=head2 ischannel
data_type: 'integer'
default_value: 0
is_nullable: 1
=head2 iscurrent
data_type: 'integer'
@ -239,6 +245,8 @@ __PACKAGE__->add_columns(
{ data_type => "integer", default_value => 3600, is_nullable => 1 },
"timeout",
{ data_type => "integer", default_value => 36000, is_nullable => 1 },
"ischannel",
{ data_type => "integer", default_value => 0, is_nullable => 1 },
"iscurrent",
{ data_type => "integer", default_value => 0, is_nullable => 1 },
"nixexprinput",
@ -558,8 +566,8 @@ __PACKAGE__->many_to_many(
);
# Created by DBIx::Class::Schema::Loader v0.07043 @ 2015-08-10 15:10:41
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rjifgnPtjY96MaQ7eiGzaA
# Created by DBIx::Class::Schema::Loader v0.07043 @ 2015-09-10 17:34:23
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JRelp13Cyfi+QVxC92xuqQ
__PACKAGE__->has_many(
"dependents",

View file

@ -157,6 +157,7 @@ create table Builds (
maxsilent integer default 3600, -- meta.maxsilent
timeout integer default 36000, -- meta.timeout
isChannel integer default 0, -- meta.isHydraChannel
isCurrent integer default 0,
-- Copy of the nixExprInput/nixExprPath fields of the jobset that

1
src/sql/upgrade-42.sql Normal file
View file

@ -0,0 +1 @@
alter table Builds add column isChannel integer not null default 0;