releases as a dynamic view on the database was misguided, since doing thing like adding a new job to a release set will invalidate all old releases. So we rename release sets to views, and we'll reintroduce releases as separate, static entities in the database.
P5X4P6VKS5CJOOLJRVL66GRJLDLVC3EKAVAHP2RJOXQJ7WTYAUBQC
HKWIDRO62QHQPV7IF3R3CBNUVTLJYMTTNRNYPND4AZ5MR4N7WRBQC
H3DLVNCJYUJDCILB5LEQDMQDHPRS7ZU66EW3FWXDRBX6WSBUXJTAC
M57TEWF5JFWRSZCANNSIQVZAGEPBVXE5UL4VAE4NGGO44UJPCITAC
4D4U5IPYZO2FONPOET4UP3ZPVPB35Q47SXU7A56G76V7VDFILOIAC
PPJN6SDP3BIWOB5LB3B2F3HEWM4IG7WZMG7JICERVBR7CDMBOPOQC
UUGBVEGYV3FUNL7D3ECA2DIMFHE2S5UQF4ACSLESX3M3NRYYE57AC
ODNCGFQ5FPKFI624BVMLW7PJ2EFJOR3TY66OCZM42UNNTWBCF2TQC
FPK5LF53CFUEKFYJ3IYXT4UTVC6IITWJOCFATMC4PLHEUP5SIEAAC
2AIIYGI54TEFYBCGWMUA7JG2DMJXBKMYUZ7CG6ETIXF4ENNP74CQC
FHF6IZJQPUQHY5QWQYRPZVDBRLHREWRHGNKVQDT7F3GQKKLZXJKQC
J5UVLXOK6EDIL5I7VKWH4V2QDS4DPD7FHRK6XBWSXFRQS4JKXFZQC
JFZNAYJXKCMXYHGCLTRH7Q6TOFGJ4BT6332GONCWVYRLNMDDG3KAC
G6HJY2V4CSSZF6BPIMRMRAJYRKPLTCBUFTJWZWK3BSNT235CZQ6QC
T2232OBSNVDGHY46RY5BBB2IET5LV5OLKSSBDYUF7KAEDBUOTC7QC
UWVMQIAC2HQNSG2JQOPZGUOCQ5V2JFP2F7RCTF3WJLK7NHSD5PAAC
ECBA3GQOGTF73Y7A5EFUXZ5PDIZ5NPJM3WMOUJTE3AEK2PZQX3MQC
TMP2FRIWXSSLCWOODKHRCVVCF26O7IXGB5KERZNOL5P5L26SHKMQC
IN272KZWHENW2TCR3LWQ6OZAEESJL5S7AEL3GYLJTWHJUDE6HADAC
OIUIYIV223PEQ47UPM5FKE24OTYCCZRHS2UON4XSEKQWRVZWJCIAC
VSVQIXAA2DAHLE4A2ZU3FGDHKM7OBF2UK3B6L63MZBLIWK7SB4AQC
NLJJZVHO3UXBURL2P7VGGCVUOMKFUYT3UX5JXQU3FFFAHUGEKO3AC
E6IC7YIKCWI3LIG3DK7VTACIKCMMQWCOYROXXZL5FYHUWJ7CPN4AC
QU5I5GCLSKUEKWPQBFPEHHLH3OODK6KSFHDAIDN52U45U6FNTFNAC
ZNFDFJHGXHSUP3NT5BZSGZPUFYMXCNTJRLSVD6PYF3N6O6ONAWRAC
A52HEFHQNVNF2OUSWDSUYVVXLYR2UFCGOORPCN27CJJYA4UDJA3AC
EYNG4EL4N7LDQD4XKVVLYCDBCRHJZIEEYU7KQWDTAVADVE34TVZQC
LQ5QEDVVHVGX67NJZQ46HOSY336VCLN63L3DT6QNSDV6ARVARITAC
LZO3C2KIACZ3HN72RBGWWIT5ED4RJMYKI3SAHXT6RIUPHDFL3STQC
5IK6NYKFNY25MHV4SHACJMVGFZBRQICVSOUWNGZFAQ2GO6QUBYNAC
5NO7NCKTMM5ZW7JYOETUFOSWK2ACTXWDZGJAFXZN6L3OF6BFTNOQC
H5REHM3MZKP6SZPMSTMO7SHAVS6W756Q6P2AEJ27R4FZB2IZ2HVAC
UVMFS73TI6RARMAAGY2UVS5LCPZUKLQECXQQVER4F7S4BNUXQQ3AC
2AUODJBTW2UJ47UB3SREZ7O7UTTJDQ4AGUQMPZAI4F3Y6BUF6LUQC
D5QIOJGPKQJIYBUCSC3MFJ3TXLPNZ2XMI37GXMFRVRFWWR2VMTFAC
2GK5DOU7ODF4WBSN3QTD3WIO52VTL2LOAXKGCDEMMAQPTEO4A4HAC
SJLEZFC472OWVCR7WEUUYNS6BJDDR77SHWADKDCPIS2INMTPTIVAC
PHX2HIVGHHKCAX6VNN2WXD4LRGSA74KQMJCCTMHK7HS6JPELVECAC
L2E6EVE2RVFVDCUNRJ4CZYSQNS2DZUA5DTBETHBDUQUV2KQQRAOQC
CLJQCY2XHIDNNMFBJ5PK3GQEN6RFALEFKXBJRWZPEIKR4PR5ZQ5AC
ZVTSOVHNQNQCRF3N44RKDQSL3UM7HSLTAXICMWEE6EIA6SWJXZCQC
S5PV6IIMKJ7PGWIFLLXERHYF3BCP2UEGFRZEZLD6UUBLVEZXJLUAC
M552HLIAP52D42AVXVC5SGROAYN2TBCEUZOXESWEMBBUX7G3U6TAC
X27GNHDV5KPZ5GSH6DCAJMNCEMZLCP7M43JWF2X3O5QWXMOX273AC
BVOPAMLSAU4UTV3DUX53OYDMXP2SETAQVUKAYE2OTCVVN4RD7LLQC
TWVSALRLHGSY6SHLMLT53K2A5SUCPU3SNFPZ2KWYOLDQUJBSZ2OAC
RU7AQO7U4HCWJNQTR2KRGDLLG24WYD47MWIHREV6SIAPCPDQHAWQC
S66BOMVUACAUDSGSDWP7ZIXVMZSQHWXOZYVTB7ILUCWZ7DDFAKVAC
AHTEIK7GGPHUC3AXIJ2NX4TI3RLX65XYKGAIIC6MC2S6I6QPWTAAC
LCKWLQW3TCEGY4E7FRZYWYSP7SHRA5LNJ2A7TWU4LVIRZTF7K7ZQC
7YBYT2LQML2PKEO6UO4444AGSASS664UCDXW2YO3ALB7THQHCEBQC
PBFZEQLZXMOBQIWL5WQWH7D62XG6M7ROEEAH6PWAKKKOM3W5I3RQC
IGNQFFV767W2N53L634LEZSBJC35OVC3BDLB52RIRAUEFTPX3ZYQC
KFFNFE4D7OTXSHUI5W5FD4SZNZIUCOFNY44ZCQXG5SNAPHYQYQHAC
N22GPKYTOLZLBGTGDATQDVZ4R5APZEAOIA7L32X4UXBH4XNI7MWAC
3E6IP3R3JGH76PNGG7RCADV65KOV24HQXPXNLVVYIQ46AVYJRG3AC
# Releases -> Views.
alter table ReleaseSets rename to Views;
alter table Views rename column name to view_;
alter table ReleaseSetJobs rename to ViewJobs;
alter table ViewJobs rename column release_ to view_;
alter table ViewJobs drop column mayFail;
alter table ViewJobs add column autorelease integer not null default 0;
}
sub getReleaseSet {
my ($c, $projectName, $releaseSetName) = @_;
my $project = $c->model('DB::Projects')->find($projectName);
notFound($c, "Project $projectName doesn't exist.") if !defined $project;
$c->stash->{project} = $project;
(my $releaseSet) = $c->model('DB::ReleaseSets')->find($projectName, $releaseSetName);
notFound($c, "Release set $releaseSetName doesn't exist.") if !defined $releaseSet;
$c->stash->{releaseSet} = $releaseSet;
(my $primaryJob) = $releaseSet->releasesetjobs->search({isprimary => 1});
#die "Release set $releaseSetName doesn't have a primary job." if !defined $primaryJob;
my $jobs = [$releaseSet->releasesetjobs->search({},
{order_by => ["isprimary DESC", "job", "attrs"]})];
$c->stash->{jobs} = $jobs;
return ($project, $releaseSet, $primaryJob, $jobs);
}
sub updateReleaseSet {
my ($c, $releaseSet) = @_;
my $releaseSetName = trim $c->request->params->{name};
error($c, "Invalid release set name: $releaseSetName")
unless $releaseSetName =~ /^[[:alpha:]][\w\-]*$/;
$releaseSet->update(
{ name => $releaseSetName
, description => trim $c->request->params->{description} });
$releaseSet->releasesetjobs->delete_all;
foreach my $param (keys %{$c->request->params}) {
next unless $param =~ /^job-(\d+)-name$/;
my $baseName = $1;
my $name = trim $c->request->params->{"job-$baseName-name"};
my $description = trim $c->request->params->{"job-$baseName-description"};
my $attrs = trim $c->request->params->{"job-$baseName-attrs"};
$name =~ /^([\w\-]+):([\w\-]+)$/ or error($c, "Invalid job name: $name");
my $jobsetName = $1;
my $jobName = $2;
error($c, "Jobset `$jobsetName' doesn't exist.")
unless $releaseSet->project->jobsets->find({name => $jobsetName});
# !!! We could check whether the job exists, but that would
# require the scheduler to have seen the job, which may not be
# the case.
$releaseSet->releasesetjobs->create(
{ jobset => $jobsetName
, job => $jobName
, description => $description
, attrs => $attrs
, isprimary => $c->request->params->{"primary"} eq $baseName ? 1 : 0
});
}
error($c, "There must be one primary job.")
if $releaseSet->releasesetjobs->search({isprimary => 1})->count != 1;
}
sub releases :Local {
my ($self, $c, $projectName, $releaseSetName, $subcommand) = @_;
my ($project, $releaseSet, $primaryJob, $jobs) = getReleaseSet($c, $projectName, $releaseSetName);
my $resultsPerPage = 10;
my $page = 1;
if (defined $subcommand && $subcommand =~ /^\d+$/ ) {
$page = int($subcommand)
}
elsif (defined $subcommand && $subcommand ne "") {
requireProjectOwner($c, $project);
if ($subcommand eq "edit") {
$c->stash->{template} = 'edit-releaseset.tt';
return;
}
elsif ($subcommand eq "submit") {
txn_do($c->model('DB')->schema, sub {
updateReleaseSet($c, $releaseSet);
});
return $c->res->redirect($c->uri_for("/releases", $projectName, $releaseSet->name));
}
elsif ($subcommand eq "delete") {
txn_do($c->model('DB')->schema, sub {
$releaseSet->delete;
});
return $c->res->redirect($c->uri_for($c->controller('Project')->action_for('view'), [$project->name]));
}
else { error($c, "Unknown subcommand."); }
}
$c->stash->{template} = 'releases.tt';
my @releases = ();
push @releases, getRelease($_, $jobs) foreach getPrimaryBuildsForReleaseSet($project, $primaryJob, $page, $resultsPerPage);
$c->stash->{baseUri} = $c->uri_for($self->action_for("releases"), $projectName, $releaseSetName);
$c->stash->{releases} = [@releases];
$c->stash->{page} = $page;
$c->stash->{totalReleases} = getPrimaryBuildTotal($project, $primaryJob);
$c->stash->{resultsPerPage} = $resultsPerPage;
sub create_releaseset :Local {
my ($self, $c, $projectName, $subcommand) = @_;
my $project = $c->model('DB::Projects')->find($projectName);
error($c, "Project $projectName doesn't exist.") if !defined $project;
$c->stash->{project} = $project;
if (defined $subcommand && $subcommand eq "submit") {
my $releaseSetName = $c->request->params->{name};
txn_do($c->model('DB')->schema, sub {
# Note: $releaseSetName is validated in updateProject,
# which will abort the transaction if the name isn't
# valid.
my $releaseSet = $project->releasesets->create({name => $releaseSetName});
updateReleaseSet($c, $releaseSet);
return $c->res->redirect($c->uri_for("/releases", $projectName, $releaseSet->name));
});
}
$c->stash->{template} = 'edit-releaseset.tt';
$c->stash->{create} = 1;
}
sub release :Local {
my ($self, $c, $projectName, $releaseSetName, $releaseId, @args) = @_;
$c->stash->{template} = 'release.tt';
my ($project, $releaseSet, $primaryJob, $jobs) = getReleaseSet($c, $projectName, $releaseSetName);
if ($releaseId eq "latest") {
# Redirect to the latest successful release.
my $latest = getLatestSuccessfulRelease($project, $primaryJob, $jobs);
error($c, "This release set has no successful releases yet.") if !defined $latest;
return $c->res->redirect($c->uri_for("/release", $projectName, $releaseSetName, $latest->id, @args));
}
# Note: we don't actually check whether $releaseId is a primary
# build, but who cares?
my $primaryBuild = $project->builds->find($releaseId,
{ join => 'resultInfo',
, '+select' => ["resultInfo.releasename", "resultInfo.buildstatus"]
, '+as' => ["releasename", "buildstatus"] })
or error($c, "Release $releaseId doesn't exist.");
$c->stash->{release} = getRelease($primaryBuild, $jobs);
# Provide a redirect to the specified job of this release. !!!
# This isn't uniquely defined if there are multiple jobs with the
# same name (e.g. builds for different platforms). However, this
# mechanism is primarily to allow linking to resources of which
# there is only one build, such as the manual of the latest
# release.
if (scalar @args != 0) {
my $jobName = shift @args;
(my $build, my @others) = grep { $_->{job}->job eq $jobName } @{$c->stash->{release}->{jobs}};
notFound($c, "Release doesn't have a job named `$jobName'")
unless defined $build;
error($c, "Job `$jobName' isn't unique.") if @others;
return $c->res->redirect($c->uri_for($c->controller('Build')->action_for('view_build'),
[$build->{build}->id], @args));
}
}
package Hydra::Controller::View;
use strict;
use warnings;
use base 'Catalyst::Controller';
use Hydra::Helper::Nix;
use Hydra::Helper::CatalystUtils;
sub getView {
my ($c, $projectName, $viewName) = @_;
my $project = $c->model('DB::Projects')->find($projectName);
notFound($c, "Project $projectName doesn't exist.") if !defined $project;
$c->stash->{project} = $project;
(my $view) = $c->model('DB::Views')->find($projectName, $viewName);
notFound($c, "View $viewName doesn't exist.") if !defined $view;
$c->stash->{view} = $view;
(my $primaryJob) = $view->viewjobs->search({isprimary => 1});
#die "View $viewName doesn't have a primary job." if !defined $primaryJob;
my $jobs = [$view->viewjobs->search({},
{order_by => ["isprimary DESC", "job", "attrs"]})];
$c->stash->{jobs} = $jobs;
return ($project, $view, $primaryJob, $jobs);
}
sub updateReleaseSet {
my ($c, $releaseSet) = @_;
my $releaseSetName = trim $c->request->params->{name};
error($c, "Invalid release set name: $releaseSetName")
unless $releaseSetName =~ /^[[:alpha:]][\w\-]*$/;
$releaseSet->update(
{ name => $releaseSetName
, description => trim $c->request->params->{description} });
$releaseSet->releasesetjobs->delete_all;
foreach my $param (keys %{$c->request->params}) {
next unless $param =~ /^job-(\d+)-name$/;
my $baseName = $1;
my $name = trim $c->request->params->{"job-$baseName-name"};
my $description = trim $c->request->params->{"job-$baseName-description"};
my $attrs = trim $c->request->params->{"job-$baseName-attrs"};
$name =~ /^([\w\-]+):([\w\-]+)$/ or error($c, "Invalid job name: $name");
my $jobsetName = $1;
my $jobName = $2;
error($c, "Jobset `$jobsetName' doesn't exist.")
unless $releaseSet->project->jobsets->find({name => $jobsetName});
# !!! We could check whether the job exists, but that would
# require the scheduler to have seen the job, which may not be
# the case.
$releaseSet->releasesetjobs->create(
{ jobset => $jobsetName
, job => $jobName
, description => $description
, attrs => $attrs
, isprimary => $c->request->params->{"primary"} eq $baseName ? 1 : 0
});
}
error($c, "There must be one primary job.")
if $releaseSet->releasesetjobs->search({isprimary => 1})->count != 1;
}
sub view : Chained('/') PathPart('view') CaptureArgs(2) {
my ($self, $c, $projectName, $viewName) = @_;
my ($project, $view, $primaryJob, $jobs) = getView($c, $projectName, $viewName);
$c->stash->{project} = $project;
$c->stash->{view} = $view;
$c->stash->{primaryJob} = $primaryJob;
$c->stash->{jobs} = $jobs;
}
sub view_view : Chained('view') PathPart('') Args(0) {
my ($self, $c) = @_;
$c->stash->{template} = 'view.tt';
my $resultsPerPage = 10;
my $page = int($c->req->param('page')) || 1;
my @results = ();
push @results, getRelease($_, $c->stash->{jobs}) foreach
getPrimaryBuildsForReleaseSet($c->stash->{project}, $c->stash->{primaryJob}, $page, $resultsPerPage);
$c->stash->{baseUri} = $c->uri_for($self->action_for("view"), $c->stash->{project}->name, $c->stash->{view}->name);
$c->stash->{results} = [@results];
$c->stash->{page} = $page;
$c->stash->{totalResults} = getPrimaryBuildTotal($c->stash->{project}, $c->stash->{primaryJob});
$c->stash->{resultsPerPage} = $resultsPerPage;
}
sub edit : Chained('view') PathPart('edit') Args(0) {
my ($self, $c) = @_;
requireProjectOwner($c, $c->stash->{project});
$c->stash->{template} = 'edit-view.tt';
}
sub latest : Chained('view') PathPart('latest') {
my ($self, $c, @args) = @_;
# Redirect to the latest result in the view in which every build
# is successful.
my $latest = getLatestSuccessfulRelease(
$c->stash->{project}, $c->stash->{primaryJob}, $c->stash->{jobs});
error($c, "This view set has no successful results yet.") if !defined $latest;
return $c->res->redirect($c->uri_for("/view", $c->stash->{project}->name, $c->stash->{view}->name, $latest->id, @args));
}
sub result : Chained('view') PathPart('') {
my ($self, $c, $id, @args) = @_;
$c->stash->{template} = 'release.tt';
# Note: we don't actually check whether $id is a primary build,
# but who cares?
my $primaryBuild = $c->stash->{project}->builds->find($id,
{ join => 'resultInfo',
, '+select' => ["resultInfo.releasename", "resultInfo.buildstatus"]
, '+as' => ["releasename", "buildstatus"] })
or error($c, "Build $id doesn't exist.");
$c->stash->{release} = getRelease($primaryBuild, $c->stash->{jobs});
# Provide a redirect to the specified job of this release. !!!
# This isn't uniquely defined if there are multiple jobs with the
# same name (e.g. builds for different platforms). However, this
# mechanism is primarily to allow linking to resources of which
# there is only one build, such as the manual of the latest
# release.
if (scalar @args != 0) {
my $jobName = shift @args;
(my $build, my @others) = grep { $_->{job}->job eq $jobName } @{$c->stash->{release}->{jobs}};
notFound($c, "Release doesn't have a job named `$jobName'")
unless defined $build;
error($c, "Job `$jobName' isn't unique.") if @others;
return $c->res->redirect($c->uri_for($c->controller('Build')->action_for('view_build'),
[$build->{build}->id], @args));
}
}
1;
if ($job->mayfail != 1) {
if (!defined $thisBuild) {
$status = 2 if $status == 0; # = unfinished
} elsif ($thisBuild->get_column('buildstatus') != 0) {
$status = 1; # = failed
}
if (!defined $thisBuild) {
$status = 2 if $status == 0; # = unfinished
} elsif ($thisBuild->get_column('buildstatus') != 0) {
$status = 1; # = failed
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yodYRloko+NdaEVy+IL5JA
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gtA3wQA2CLsXs4X95PfX9A
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GdjLBqXz+LK4ewxnpIs9eQ
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ii6N3v4M1fX1tQ3YmJNFWw
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KTPvLaqbXGpynWt107ISew
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EMvF2g+MDIE84yjnJOs7og
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:thMie1PGP25FGbo5qypE/w
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RcdX5dHefBQnxQYbMxNF/w
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ua+P31BMRmMKP6QFOdA89A
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1AQCHpuv8Lqk/FYdU8JYFA
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:luxYxoOAtLoCgl5iFTYdJA
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CcYlMej7OPRUJn6375Qlqw
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DeoyeS42ddQ2FXa+8n31OQ
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mYBdemei1tFuK8Ll6eMLfQ
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CaFTGQtLjPwCISqk5W4fag
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bE+w54cACUS2L0PJ9gPjtw
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+Cb0mIbX8ddDbZY39u9feA
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c0OEe2zPd/E4vh0PRXm4Ag
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:m3a1Q6c2FePidqbqYhz5dg
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jS8pitmHFnplE8WcK0OyMQ
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QSYSg5xsN292LnfvbAG0Vw
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:W0rhMTOzLBZNsVShQHg5+A
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:85FwtlvNxjGix7PUCJTMqA
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CB5lPsrozpvO8gLXHTyMrQ
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Dru36PNUe9iYHEwhhHKJ3A
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N6NPLJfc1gKM4zz6dS5PJw
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mfZTzyri5eSRhfmBmwyuFQ
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EkpopxgwlZf8Du3EmWzTKQ
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6RgJY04rmD+PumWXz5KGoQ
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:W2Q6219GlZl2IqQkBoFmFA
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZWzljXMF0IbU12wNUn+djg
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qH+qBI3xxQgTNf3v7E3sDw
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qSQjyHzxQp0qO3CbRdcXmw
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LkiGAkZOiLNJk6oDY0+zNw
"releasesetjobs",
"Hydra::Schema::ReleaseSetJobs",
{
"foreign.project" => "self.project",
"foreign.release_" => "self.name",
},
"viewjobs",
"Hydra::Schema::ViewJobs",
{ "foreign.project" => "self.project", "foreign.view_" => "self.name" },
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pEjxqTAwP4ZmP/s6F4VOsg
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hV+xzi564rgcYeDvz75zCA
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-08 13:25:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vdr83mcEie4i5Fn/Uj17Vg
# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-15 23:14:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ODLRc6VfDQpb8MyXPKmqtg
<form action="[% IF create %][% c.uri_for('/create_releaseset' project.name 'submit') %][% ELSE %][% c.uri_for('/releases' project.name releaseSet.name 'submit') %][% END %]" method="post">
<form action="[% IF create %][% c.uri_for('/create-view' project.name 'submit') %][% ELSE %][% c.uri_for('/view' project.name view.name 'submit') %][% END %]" method="post">
<form action="[% c.uri_for('/releases' project.name releaseSet.name 'delete') %]" method="post">
<p><button id="delete-project" type="submit"><img src="/static/images/failure.gif" />Delete this release set</button></p>
<form action="[% c.uri_for('/view' project.name view.name 'delete') %]" method="post">
<p><button id="delete-project" type="submit"><img src="/static/images/failure.gif" />Delete this view</button></p>
<a href="[% c.uri_for('/releases' project.name releaseSet.name) %]"><tt>[% releaseSet.name %]</tt></a>
[<a href="[% c.uri_for('/releases' project.name releaseSet.name "edit") %]">Edit</a>]
<a href="[% c.uri_for('/view' project.name view.name) %]"><tt>[% view.name %]</tt></a>
[<a href="[% c.uri_for('/view' project.name view.name "edit") %]">Edit</a>]
[<a href="[% c.uri_for('/releases' project.name releaseSet.name "edit") %]">Edit</a>]
[<a href="[% c.uri_for('/release' project.name releaseSet.name "latest") %]">Latest</a>]
[<a href="[% c.uri_for('/view' project.name view.name "edit") %]">Edit</a>]
[<a href="[% c.uri_for('/view' project.name view.name "latest") %]">Latest</a>]
<p>Showing releases [% (page - 1) * resultsPerPage + 1 %] - [% (page - 1) * resultsPerPage + releases.size %] out of [% totalReleases %].</p>
<p>Showing results [% (page - 1) * resultsPerPage + 1 %] - [% (page - 1) * resultsPerPage + results.size %] out of [% totalResults %].</p>
update ReleaseSets set project = new.name where project = old.name;
update ReleaseSetJobs set project = new.name where project = old.name;
update Views set project = new.name where project = old.name;
update ViewJobs set project = new.name where project = old.name;
-- Release sets are a mechanism to automatically group related builds
-- together. A release set defines what an individual release
-- consists of, namely: a release consists of a build of some
-- "primary" job, plus all builds of the other jobs named in
-- ReleaseSetJobs that have that build as an input. If there are
-- multiple builds matching a ReleaseSetJob, then we take the oldest
-- successful build, or the oldest unsuccessful build if there is no
-- successful build. A release is itself considered successful if all
-- builds (except those for jobs that have mayFail set) are
-- successful.
--
-- Note that individual releases aren't separately stored in the
-- database, so they're really just a dynamic view on the universe of
-- builds, defined by a ReleaseSet.
create table ReleaseSets (
-- Views are a mechanism to automatically group related builds
-- together. A view definition consists of a build of some "primary"
-- job, plus all builds of the other jobs named in ViewJobs that have
-- that build as an input. If there are multiple builds matching a
-- ViewJob, then we take the oldest successful build, or the oldest
-- unsuccessful build if there is no successful build.
create table Views (
-- `release' is a reserved keyword in sqlite >= 3.6.8. We could
-- quote them ("release") here, but since the Perl bindings don't
-- do that it still wouldn't work. So use `release_' instead.
release_ text not null,
view_ text not null,