diff --git a/doc/dev-notes.txt b/doc/dev-notes.txt index 56c25649..6dd51cbe 100644 --- a/doc/dev-notes.txt +++ b/doc/dev-notes.txt @@ -96,6 +96,15 @@ alter table Jobsets add column enabled integer not null default 1; + # 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; + + * Job selection: diff --git a/src/lib/Hydra/Controller/Project.pm b/src/lib/Hydra/Controller/Project.pm index e815280f..c6c43c1b 100644 --- a/src/lib/Hydra/Controller/Project.pm +++ b/src/lib/Hydra/Controller/Project.pm @@ -24,7 +24,7 @@ sub view : Chained('project') PathPart('') Args(0) { getBuildStats($c, scalar $c->stash->{project}->builds); - $c->stash->{releaseSets} = [$c->stash->{project}->releasesets->all]; + $c->stash->{views} = [$c->stash->{project}->views->all]; } diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm index 9c78a29e..e1e1cc86 100644 --- a/src/lib/Hydra/Controller/Root.pm +++ b/src/lib/Hydra/Controller/Root.pm @@ -63,192 +63,6 @@ sub queue :Local { } -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; - - requireProjectOwner($c, $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)); - } -} - - # Hydra::Base::Controller::ListBuilds needs this. sub get_builds : Chained('/') PathPart('') CaptureArgs(0) { my ($self, $c) = @_; diff --git a/src/lib/Hydra/Controller/View.pm b/src/lib/Hydra/Controller/View.pm new file mode 100644 index 00000000..11cf976d --- /dev/null +++ b/src/lib/Hydra/Controller/View.pm @@ -0,0 +1,161 @@ +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; diff --git a/src/lib/Hydra/Helper/Nix.pm b/src/lib/Hydra/Helper/Nix.pm index 5872bb0c..74cadbf8 100644 --- a/src/lib/Hydra/Helper/Nix.pm +++ b/src/lib/Hydra/Helper/Nix.pm @@ -239,12 +239,10 @@ sub getRelease { $thisBuild = findLastJobForPrimaryBuild($primaryBuild, $job) ; } - 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 } $timestamp = $thisBuild->timestamp diff --git a/src/lib/Hydra/Schema.pm b/src/lib/Hydra/Schema.pm index 18602efc..f3e50c22 100644 --- a/src/lib/Hydra/Schema.pm +++ b/src/lib/Hydra/Schema.pm @@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema'; __PACKAGE__->load_classes; -# 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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/BuildInputs.pm b/src/lib/Hydra/Schema/BuildInputs.pm index 5fdb0d4a..f0767f74 100644 --- a/src/lib/Hydra/Schema/BuildInputs.pm +++ b/src/lib/Hydra/Schema/BuildInputs.pm @@ -103,8 +103,8 @@ __PACKAGE__->belongs_to( ); -# 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 use Hydra::Helper::Nix; diff --git a/src/lib/Hydra/Schema/BuildProducts.pm b/src/lib/Hydra/Schema/BuildProducts.pm index ab0ecd3f..d9579ef9 100644 --- a/src/lib/Hydra/Schema/BuildProducts.pm +++ b/src/lib/Hydra/Schema/BuildProducts.pm @@ -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-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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/BuildResultInfo.pm b/src/lib/Hydra/Schema/BuildResultInfo.pm index 4554c2e0..84357722 100644 --- a/src/lib/Hydra/Schema/BuildResultInfo.pm +++ b/src/lib/Hydra/Schema/BuildResultInfo.pm @@ -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-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 __PACKAGE__->belongs_to( "failedDep", diff --git a/src/lib/Hydra/Schema/BuildSchedulingInfo.pm b/src/lib/Hydra/Schema/BuildSchedulingInfo.pm index 87bc2d1d..8ec329c4 100644 --- a/src/lib/Hydra/Schema/BuildSchedulingInfo.pm +++ b/src/lib/Hydra/Schema/BuildSchedulingInfo.pm @@ -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-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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/BuildSteps.pm b/src/lib/Hydra/Schema/BuildSteps.pm index 60bd120c..e3bcf63e 100644 --- a/src/lib/Hydra/Schema/BuildSteps.pm +++ b/src/lib/Hydra/Schema/BuildSteps.pm @@ -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-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 1; diff --git a/src/lib/Hydra/Schema/Builds.pm b/src/lib/Hydra/Schema/Builds.pm index 60fca2f1..dd1c0299 100644 --- a/src/lib/Hydra/Schema/Builds.pm +++ b/src/lib/Hydra/Schema/Builds.pm @@ -163,8 +163,8 @@ __PACKAGE__->has_many( ); -# 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 use Hydra::Helper::Nix; diff --git a/src/lib/Hydra/Schema/CachedPathInputs.pm b/src/lib/Hydra/Schema/CachedPathInputs.pm index 9c5f4a51..d3b71bcd 100644 --- a/src/lib/Hydra/Schema/CachedPathInputs.pm +++ b/src/lib/Hydra/Schema/CachedPathInputs.pm @@ -47,8 +47,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("srcpath", "sha256hash"); -# 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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/CachedSubversionInputs.pm b/src/lib/Hydra/Schema/CachedSubversionInputs.pm index aa5a758e..85e0f3a6 100644 --- a/src/lib/Hydra/Schema/CachedSubversionInputs.pm +++ b/src/lib/Hydra/Schema/CachedSubversionInputs.pm @@ -40,8 +40,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("uri", "revision"); -# 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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/Jobs.pm b/src/lib/Hydra/Schema/Jobs.pm index 4f27c1bc..fe899dba 100644 --- a/src/lib/Hydra/Schema/Jobs.pm +++ b/src/lib/Hydra/Schema/Jobs.pm @@ -75,8 +75,8 @@ __PACKAGE__->belongs_to( ); -# 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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/JobsetInputAlts.pm b/src/lib/Hydra/Schema/JobsetInputAlts.pm index 76f1d258..8ad27cfc 100644 --- a/src/lib/Hydra/Schema/JobsetInputAlts.pm +++ b/src/lib/Hydra/Schema/JobsetInputAlts.pm @@ -69,8 +69,8 @@ __PACKAGE__->belongs_to( ); -# 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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/JobsetInputs.pm b/src/lib/Hydra/Schema/JobsetInputs.pm index 14188fec..e6b5f58d 100644 --- a/src/lib/Hydra/Schema/JobsetInputs.pm +++ b/src/lib/Hydra/Schema/JobsetInputs.pm @@ -65,8 +65,8 @@ __PACKAGE__->has_many( ); -# 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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/Jobsets.pm b/src/lib/Hydra/Schema/Jobsets.pm index 892450f2..5d9bad3c 100644 --- a/src/lib/Hydra/Schema/Jobsets.pm +++ b/src/lib/Hydra/Schema/Jobsets.pm @@ -103,8 +103,8 @@ __PACKAGE__->has_many( ); -# 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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/Projects.pm b/src/lib/Hydra/Schema/Projects.pm index cebd29e4..c85ab2b2 100644 --- a/src/lib/Hydra/Schema/Projects.pm +++ b/src/lib/Hydra/Schema/Projects.pm @@ -65,19 +65,19 @@ __PACKAGE__->has_many( { "foreign.project" => "self.name" }, ); __PACKAGE__->has_many( - "releasesets", - "Hydra::Schema::ReleaseSets", + "views", + "Hydra::Schema::Views", { "foreign.project" => "self.name" }, ); __PACKAGE__->has_many( - "releasesetjobs", - "Hydra::Schema::ReleaseSetJobs", + "viewjobs", + "Hydra::Schema::ViewJobs", { "foreign.project" => "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: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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/SystemTypes.pm b/src/lib/Hydra/Schema/SystemTypes.pm index 99c87e8d..93312a75 100644 --- a/src/lib/Hydra/Schema/SystemTypes.pm +++ b/src/lib/Hydra/Schema/SystemTypes.pm @@ -21,8 +21,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("system"); -# 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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/UserRoles.pm b/src/lib/Hydra/Schema/UserRoles.pm index 39752056..c01878dc 100644 --- a/src/lib/Hydra/Schema/UserRoles.pm +++ b/src/lib/Hydra/Schema/UserRoles.pm @@ -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-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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/Users.pm b/src/lib/Hydra/Schema/Users.pm index d0dbee72..4ad1f94d 100644 --- a/src/lib/Hydra/Schema/Users.pm +++ b/src/lib/Hydra/Schema/Users.pm @@ -50,8 +50,8 @@ __PACKAGE__->has_many( ); -# 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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/ReleaseSetJobs.pm b/src/lib/Hydra/Schema/ViewJobs.pm similarity index 75% rename from src/lib/Hydra/Schema/ReleaseSetJobs.pm rename to src/lib/Hydra/Schema/ViewJobs.pm index ad7f9abb..3dc22793 100644 --- a/src/lib/Hydra/Schema/ReleaseSetJobs.pm +++ b/src/lib/Hydra/Schema/ViewJobs.pm @@ -1,4 +1,4 @@ -package Hydra::Schema::ReleaseSetJobs; +package Hydra::Schema::ViewJobs; use strict; use warnings; @@ -6,7 +6,7 @@ use warnings; use base 'DBIx::Class'; __PACKAGE__->load_components("Core"); -__PACKAGE__->table("ReleaseSetJobs"); +__PACKAGE__->table("ViewJobs"); __PACKAGE__->add_columns( "project", { @@ -16,7 +16,7 @@ __PACKAGE__->add_columns( is_nullable => 0, size => undef, }, - "release_", + "view_", { data_type => "text", default_value => undef, @@ -40,8 +40,6 @@ __PACKAGE__->add_columns( }, "isprimary", { data_type => "integer", default_value => 0, is_nullable => 0, size => undef }, - "mayfail", - { data_type => "integer", default_value => 0, is_nullable => 0, size => undef }, "description", { data_type => "text", @@ -56,18 +54,20 @@ __PACKAGE__->add_columns( is_nullable => 0, size => undef, }, + "autorelease", + { data_type => "integer", default_value => 0, is_nullable => 0, size => undef }, ); -__PACKAGE__->set_primary_key("project", "release_", "job", "attrs"); +__PACKAGE__->set_primary_key("project", "view_", "job", "attrs"); __PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }); __PACKAGE__->belongs_to( - "releaseset", - "Hydra::Schema::ReleaseSets", - { name => "release_", project => "project" }, + "view", + "Hydra::Schema::Views", + { name => "view_", project => "project" }, ); -# 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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/ReleaseSets.pm b/src/lib/Hydra/Schema/Views.pm similarity index 70% rename from src/lib/Hydra/Schema/ReleaseSets.pm rename to src/lib/Hydra/Schema/Views.pm index bf3a2cd3..78eee999 100644 --- a/src/lib/Hydra/Schema/ReleaseSets.pm +++ b/src/lib/Hydra/Schema/Views.pm @@ -1,4 +1,4 @@ -package Hydra::Schema::ReleaseSets; +package Hydra::Schema::Views; use strict; use warnings; @@ -6,7 +6,7 @@ use warnings; use base 'DBIx::Class'; __PACKAGE__->load_components("Core"); -__PACKAGE__->table("ReleaseSets"); +__PACKAGE__->table("Views"); __PACKAGE__->add_columns( "project", { @@ -36,17 +36,14 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("project", "name"); __PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }); __PACKAGE__->has_many( - "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 # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/root/edit-releaseset.tt b/src/root/edit-view.tt similarity index 78% rename from src/root/edit-releaseset.tt rename to src/root/edit-view.tt index a8d847eb..6d9f0e6e 100644 --- a/src/root/edit-releaseset.tt +++ b/src/root/edit-view.tt @@ -1,8 +1,8 @@ -[% WRAPPER layout.tt title=(create ? "New Release Set" : "Release Set ‘$project.name:$releaseSet.name’") %] +[% WRAPPER layout.tt title=(create ? "New View" : "View ‘$project.name:$view.name’") %] [% PROCESS common.tt %] [% USE HTML %] -
Project [% project.name %] has the following release sets:
+Project [% project.name %] has the following views:
Project [% project.name %] has no release sets.
+Project [% project.name %] has no views.
[% END %] - +Showing releases [% (page - 1) * resultsPerPage + 1 %] - [% (page - 1) * resultsPerPage + releases.size %] out of [% totalReleases %].
- -- | # | -Release | -Date | - [% FOREACH j IN jobs %] -[% INCLUDE renderReleaseJobName job=j %] | - [% END %] -
---|---|---|---|---|
- [% IF release.status == 0 %] - - [% ELSIF release.status == 1 %] - - [% ELSIF release.status == 2 %] - - [% END %] - | -[% release.id %] | -- [% IF release.releasename %] - [% release.releasename %] - [% ELSE %] - No name - [% END %] - | -[% INCLUDE renderDateTime timestamp=release.timestamp %] | - [% FOREACH j IN release.jobs %] -- [% IF j.build %] - - [% IF j.build.get_column('buildstatus') == 0 %] - - [% ELSE %] - - [% END %] - - [% END %] - | - [% END %] -
Showing results [% (page - 1) * resultsPerPage + 1 %] - [% (page - 1) * resultsPerPage + results.size %] out of [% totalResults %].
+ ++ | # | +Name | +Date | + [% FOREACH j IN jobs %] +[% INCLUDE renderReleaseJobName job=j %] | + [% END %] +
---|---|---|---|---|
+ [% IF result.status == 0 %] + + [% ELSIF result.status == 1 %] + + [% ELSIF result.status == 2 %] + + [% END %] + | +[% result.id %] | ++ [% IF result.releasename %] + [% result.releasename %] + [% ELSE %] + No name + [% END %] + | +[% INCLUDE renderDateTime timestamp=result.timestamp %] | + [% FOREACH j IN result.jobs %] ++ [% IF j.build %] + + [% IF j.build.get_column('buildstatus') == 0 %] + + [% ELSE %] + + [% END %] + + [% END %] + | + [% END %] +