Remove the "releases" feature

We haven't used this in many years (it was really only used for nix
and patchelf releases).
This commit is contained in:
Eelco Dolstra 2020-05-06 12:39:21 +02:00
parent ace30b4184
commit 96a514c169
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
17 changed files with 6 additions and 712 deletions

View file

@ -25,24 +25,6 @@
$ hydra-create-user root --role create-projects $ hydra-create-user root --role create-projects
* Creating a release set:
insert into ReleaseSets(project, name) values('patchelf', 'unstable');
insert into ReleaseSetJobs(isPrimary, project, release, job, attrs, description) values(1, 'patchelf', 'unstable', 'tarball', 'officialRelease=false', 'Source distribution');
insert into ReleaseSetJobs(project, release, job, attrs, description) values('patchelf', 'unstable', 'build', 'system=i686-linux', 'Build on i686-linux');
insert into ReleaseSetJobs(project, release, job, attrs, description) values('patchelf', 'unstable', 'build', 'system=x86_64-linux', 'Build on x86_64-linux');
insert into ReleaseSetJobs(project, release, job, attrs, description, mayFail) values('patchelf', 'unstable', 'rpm_fedora9i386', '', 'Fedora 9 (i386)', 1);
insert into ReleaseSetJobs(project, release, job, attrs, description) values('patchelf', 'unstable', 'rpm_fedora10i386', '', 'Fedora 10 (i386)');
insert into ReleaseSetJobs(project, release, job, attrs, description) values('patchelf', 'unstable', 'deb_ubuntu804i386', '', 'Ubuntu 8.04 (i386)');
insert into ReleaseSets(project, name) values('patchelf', 'stable');
insert into ReleaseSetJobs(isPrimary, project, release, job, attrs, description) values(1, 'patchelf', 'stable', 'tarball', 'officialRelease=true', 'Source distribution');
insert into ReleaseSetJobs(project, release, job, attrs, description) values('patchelf', 'stable', 'build', 'system=i686-linux', 'Build on i686-linux');
insert into ReleaseSetJobs(project, release, job, attrs, description) values('patchelf', 'stable', 'build', 'system=x86_64-linux', 'Build on x86_64-linux');
insert into ReleaseSetJobs(project, release, job, attrs, description, mayFail) values('patchelf', 'stable', 'rpm_fedora9i386', '', 'Fedora 9 (i386)', 1);
insert into ReleaseSetJobs(project, release, job, attrs, description) values('patchelf', 'stable', 'rpm_fedora10i386', '', 'Fedora 10 (i386)');
insert into ReleaseSetJobs(project, release, job, attrs, description) values('patchelf', 'stable', 'deb_ubuntu804i386', '', 'Ubuntu 8.04 (i386)');
* Changing the priority of a scheduled build: * Changing the priority of a scheduled build:
update buildschedulinginfo set priority = 200 where id = <ID>; update buildschedulinginfo set priority = 200 where id = <ID>;

View file

@ -66,7 +66,6 @@ Content-Type: application/json
{ {
"displayname": "Acoda", "displayname": "Acoda",
"name": "acoda", "name": "acoda",
"releases": [],
"description": "Acoda is a tool set for automatic data migration along an evolving data model", "description": "Acoda is a tool set for automatic data migration along an evolving data model",
"enabled": 0, "enabled": 0,
"owner": "sander", "owner": "sander",
@ -78,7 +77,6 @@ Content-Type: application/json
{ {
"displayname": "cabal2nix", "displayname": "cabal2nix",
"name": "cabal2nix", "name": "cabal2nix",
"releases": [],
"description": "Convert Cabal files into Nix build instructions", "description": "Convert Cabal files into Nix build instructions",
"enabled": 0, "enabled": 0,
"owner": "simons@cryp.to", "owner": "simons@cryp.to",
@ -129,8 +127,7 @@ Content-Type: application/json
], ],
"name": "hydra", "name": "hydra",
"enabled": 1, "enabled": 1,
"owner": "eelco", "owner": "eelco"
"releases": []
} }
</programlisting> </programlisting>

View file

@ -554,35 +554,6 @@ sub bump : Chained('buildChain') PathPart('bump') {
} }
sub add_to_release : Chained('buildChain') PathPart('add-to-release') Args(0) {
my ($self, $c) = @_;
my $build = $c->stash->{build};
requireProjectOwner($c, $build->project);
my $releaseName = trim $c->request->params->{name};
my $release = $build->project->releases->find({name => $releaseName});
error($c, "This project has no release named `$releaseName'.") unless $release;
error($c, "This build is already a part of release `$releaseName'.")
if $release->releasemembers->find({build => $build->id});
foreach my $output ($build->buildoutputs) {
error($c, "This build is no longer available.") unless isValidPath $output->path;
registerRoot $output->path;
}
$release->releasemembers->create({build => $build->id, description => $build->description});
$c->flash->{successMsg} = "Build added to project <tt>$releaseName</tt>.";
$c->res->redirect($c->uri_for($self->action_for("build"), $c->req->captures));
}
sub get_info : Chained('buildChain') PathPart('api/get-info') Args(0) { sub get_info : Chained('buildChain') PathPart('api/get-info') Args(0) {
my ($self, $c) = @_; my ($self, $c) = @_;
my $build = $c->stash->{build}; my $build = $c->stash->{build};

View file

@ -130,42 +130,6 @@ sub view_GET {
} }
sub release : Chained('evalChain') PathPart('release') Args(0) {
my ($self, $c) = @_;
my $eval = $c->stash->{eval};
requireProjectOwner($c, $c->stash->{project});
my @builds = $eval->builds;
my $releaseName;
$releaseName ||= $_->releasename foreach @builds;
# If no release name has been defined by any of the builds, compose one of the project name and evaluation id
$releaseName = $eval->get_column('project') . "-" . $eval->id unless defined $releaseName;
my $release;
$c->model('DB')->schema->txn_do(sub {
$release = $c->stash->{project}->releases->create(
{ name => $releaseName
, timestamp => time
});
foreach my $build (@builds) {
$release->releasemembers->create(
{ build => $build->id
, description => $build->description
}) if $build->buildstatus == 0;
}
});
$c->res->redirect($c->uri_for($c->controller('Release')->action_for('view'),
[$c->stash->{project}->name, $release->name]));
}
sub create_jobset : Chained('evalChain') PathPart('create-jobset') Args(0) { sub create_jobset : Chained('evalChain') PathPart('create-jobset') Args(0) {
my ($self, $c) = @_; my ($self, $c) = @_;
my $eval = $c->stash->{eval}; my $eval = $c->stash->{eval};

View file

@ -29,8 +29,6 @@ sub project_GET {
$c->stash->{template} = 'project.tt'; $c->stash->{template} = 'project.tt';
$c->stash->{jobsets} = [jobsetOverview($c, $c->stash->{project})]; $c->stash->{jobsets} = [jobsetOverview($c, $c->stash->{project})];
$c->stash->{releases} = [$c->stash->{project}->releases->search({},
{order_by => ["timestamp DESC"]})];
$self->status_ok($c, entity => $c->stash->{project}); $self->status_ok($c, entity => $c->stash->{project});
} }
@ -182,35 +180,4 @@ sub get_builds : Chained('projectChain') PathPart('') CaptureArgs(0) {
} }
sub create_release : Chained('projectChain') PathPart('create-release') Args(0) {
my ($self, $c) = @_;
requireProjectOwner($c, $c->stash->{project});
$c->stash->{template} = 'edit-release.tt';
$c->stash->{create} = 1;
}
sub create_release_submit : Chained('projectChain') PathPart('create-release/submit') Args(0) {
my ($self, $c) = @_;
requireProjectOwner($c, $c->stash->{project});
my $releaseName = $c->request->params->{name};
my $release;
$c->model('DB')->schema->txn_do(sub {
# Note: $releaseName is validated in updateRelease, which will
# abort the transaction if the name isn't valid.
$release = $c->stash->{project}->releases->create(
{ name => $releaseName
, timestamp => time
});
Hydra::Controller::Release::updateRelease($c, $release);
});
$c->res->redirect($c->uri_for($c->controller('Release')->action_for('view'),
[$c->stash->{project}->name, $release->name]));
}
1; 1;

View file

@ -1,81 +0,0 @@
package Hydra::Controller::Release;
use strict;
use warnings;
use base 'Catalyst::Controller';
use Hydra::Helper::Nix;
use Hydra::Helper::CatalystUtils;
sub release : Chained('/') PathPart('release') CaptureArgs(2) {
my ($self, $c, $projectName, $releaseName) = @_;
$c->stash->{project} = $c->model('DB::Projects')->find($projectName)
or notFound($c, "Project $projectName doesn't exist.");
$c->stash->{release} = $c->stash->{project}->releases->find({name => $releaseName})
or notFound($c, "Release $releaseName doesn't exist.");
}
sub view : Chained('release') PathPart('') Args(0) {
my ($self, $c) = @_;
$c->stash->{template} = 'release.tt';
$c->stash->{members} = [$c->stash->{release}->releasemembers->search({},
{order_by => ["description"]})];
}
sub updateRelease {
my ($c, $release) = @_;
my $releaseName = trim $c->request->params->{name};
error($c, "Invalid release name: $releaseName")
unless $releaseName =~ /^$relNameRE$/;
$release->update(
{ name => $releaseName
, description => trim $c->request->params->{description}
});
$release->releasemembers->delete;
foreach my $param (keys %{$c->request->params}) {
next unless $param =~ /^member-(\d+)-description$/;
my $buildId = $1;
my $description = trim $c->request->params->{"member-$buildId-description"};
$release->releasemembers->create({ build => $buildId, description => $description });
}
}
sub edit : Chained('release') PathPart('edit') Args(0) {
my ($self, $c) = @_;
requireProjectOwner($c, $c->stash->{project});
$c->stash->{template} = 'edit-release.tt';
$c->stash->{members} = [$c->stash->{release}->releasemembers->search({},
{order_by => ["description"]})];
}
sub submit : Chained('release') PathPart('submit') Args(0) {
my ($self, $c) = @_;
requireProjectOwner($c, $c->stash->{project});
if (($c->request->params->{action} || "") eq "delete") {
$c->model('DB')->schema->txn_do(sub {
$c->stash->{release}->delete;
});
$c->res->redirect($c->uri_for($c->controller('Project')->action_for('project'),
[$c->stash->{project}->name]));
} else {
$c->model('DB')->schema->txn_do(sub {
updateRelease($c, $c->stash->{release});
});
$c->res->redirect($c->uri_for($self->action_for("view"),
[$c->stash->{project}->name, $c->stash->{release}->name]));
}
}
1;

View file

@ -529,21 +529,6 @@ __PACKAGE__->belongs_to(
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "CASCADE" }, { is_deferrable => 0, on_delete => "NO ACTION", on_update => "CASCADE" },
); );
=head2 releasemembers
Type: has_many
Related object: L<Hydra::Schema::ReleaseMembers>
=cut
__PACKAGE__->has_many(
"releasemembers",
"Hydra::Schema::ReleaseMembers",
{ "foreign.build" => "self.id" },
undef,
);
=head2 aggregates =head2 aggregates
Type: many_to_many Type: many_to_many
@ -573,8 +558,8 @@ __PACKAGE__->many_to_many(
); );
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-06 12:34:25 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-05-06 12:32:57
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EEXlcKN/ydXJ129vT0jTUw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3IyFj/9Zf/hvmhBY4U/IBQ
__PACKAGE__->has_many( __PACKAGE__->has_many(
"dependents", "dependents",

View file

@ -247,36 +247,6 @@ __PACKAGE__->has_many(
undef, undef,
); );
=head2 releasemembers
Type: has_many
Related object: L<Hydra::Schema::ReleaseMembers>
=cut
__PACKAGE__->has_many(
"releasemembers",
"Hydra::Schema::ReleaseMembers",
{ "foreign.project" => "self.name" },
undef,
);
=head2 releases
Type: has_many
Related object: L<Hydra::Schema::Releases>
=cut
__PACKAGE__->has_many(
"releases",
"Hydra::Schema::Releases",
{ "foreign.project" => "self.name" },
undef,
);
=head2 starredjobs =head2 starredjobs
Type: has_many Type: has_many
@ -303,8 +273,8 @@ Composing rels: L</projectmembers> -> username
__PACKAGE__->many_to_many("usernames", "projectmembers", "username"); __PACKAGE__->many_to_many("usernames", "projectmembers", "username");
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-06 12:22:36 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-05-06 12:32:57
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pcF/8351zyo9VL6N5eimdQ # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dEIVgrFGilPfITprs6nYuA
my %hint = ( my %hint = (
columns => [ columns => [
@ -316,7 +286,6 @@ my %hint = (
"owner" "owner"
], ],
relations => { relations => {
releases => "name",
jobsets => "name" jobsets => "name"
} }
); );

View file

@ -1,141 +0,0 @@
use utf8;
package Hydra::Schema::ReleaseMembers;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Hydra::Schema::ReleaseMembers
=cut
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 COMPONENTS LOADED
=over 4
=item * L<Hydra::Component::ToJSON>
=back
=cut
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
=head1 TABLE: C<releasemembers>
=cut
__PACKAGE__->table("releasemembers");
=head1 ACCESSORS
=head2 project
data_type: 'text'
is_foreign_key: 1
is_nullable: 0
=head2 release_
data_type: 'text'
is_foreign_key: 1
is_nullable: 0
=head2 build
data_type: 'integer'
is_foreign_key: 1
is_nullable: 0
=head2 description
data_type: 'text'
is_nullable: 1
=cut
__PACKAGE__->add_columns(
"project",
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
"release_",
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
"build",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
"description",
{ data_type => "text", is_nullable => 1 },
);
=head1 PRIMARY KEY
=over 4
=item * L</project>
=item * L</release_>
=item * L</build>
=back
=cut
__PACKAGE__->set_primary_key("project", "release_", "build");
=head1 RELATIONS
=head2 build
Type: belongs_to
Related object: L<Hydra::Schema::Builds>
=cut
__PACKAGE__->belongs_to(
"build",
"Hydra::Schema::Builds",
{ id => "build" },
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
);
=head2 project
Type: belongs_to
Related object: L<Hydra::Schema::Projects>
=cut
__PACKAGE__->belongs_to(
"project",
"Hydra::Schema::Projects",
{ name => "project" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
);
=head2 release
Type: belongs_to
Related object: L<Hydra::Schema::Releases>
=cut
__PACKAGE__->belongs_to(
"release",
"Hydra::Schema::Releases",
{ name => "release_", project => "project" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
);
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-06 12:22:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:k4z2YeB4gRAeAP6hmR93sQ
1;

View file

@ -1,125 +0,0 @@
use utf8;
package Hydra::Schema::Releases;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Hydra::Schema::Releases
=cut
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 COMPONENTS LOADED
=over 4
=item * L<Hydra::Component::ToJSON>
=back
=cut
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
=head1 TABLE: C<releases>
=cut
__PACKAGE__->table("releases");
=head1 ACCESSORS
=head2 project
data_type: 'text'
is_foreign_key: 1
is_nullable: 0
=head2 name
data_type: 'text'
is_nullable: 0
=head2 timestamp
data_type: 'integer'
is_nullable: 0
=head2 description
data_type: 'text'
is_nullable: 1
=cut
__PACKAGE__->add_columns(
"project",
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
"name",
{ data_type => "text", is_nullable => 0 },
"timestamp",
{ data_type => "integer", is_nullable => 0 },
"description",
{ data_type => "text", is_nullable => 1 },
);
=head1 PRIMARY KEY
=over 4
=item * L</project>
=item * L</name>
=back
=cut
__PACKAGE__->set_primary_key("project", "name");
=head1 RELATIONS
=head2 project
Type: belongs_to
Related object: L<Hydra::Schema::Projects>
=cut
__PACKAGE__->belongs_to(
"project",
"Hydra::Schema::Projects",
{ name => "project" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
);
=head2 releasemembers
Type: has_many
Related object: L<Hydra::Schema::ReleaseMembers>
=cut
__PACKAGE__->has_many(
"releasemembers",
"Hydra::Schema::ReleaseMembers",
{
"foreign.project" => "self.project",
"foreign.release_" => "self.name",
},
undef,
);
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-06 12:22:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:b4M/tHOhsy234tgTf+wqjQ
1;

View file

@ -137,12 +137,6 @@ END;
<li><a href="[% c.uri_for('/build' build.id 'cancel') %]">Cancel</a></li> <li><a href="[% c.uri_for('/build' build.id 'cancel') %]">Cancel</a></li>
<li><a href="[% c.uri_for('/build' build.id 'bump') %]">Bump up</a></li> <li><a href="[% c.uri_for('/build' build.id 'bump') %]">Bump up</a></li>
[% END %] [% END %]
[% IF available && project.releases %]
[% INCLUDE menuItem
uri = "#add-to-release"
title = "Add to release"
modal = 1 %]
[% END %]
[% END %] [% END %]
</ul> </ul>
</li> </li>
@ -496,30 +490,6 @@ END;
</div> </div>
[% IF c.user_exists && available && project.releases %]
<div id="add-to-release" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
<form class="form-horizontal" action="[% c.uri_for('/build' build.id 'add-to-release') %]" method="post">
<div class="modal-body">
<div class="control-group">
<label class="control-label">Add to release</label>
<div class="controls">
<select class="span2" name="name">
[% FOREACH r IN project.releases %]
<option>[% HTML.escape(r.name) %]</option>
[% END %]
</select>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Add</button>
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
</div>
</form>
</div>
[% END %]
<div id="reproduce" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true"> <div id="reproduce" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
[% url = c.uri_for('/build' build.id 'reproduce') %] [% url = c.uri_for('/build' build.id 'reproduce') %]

View file

@ -1,62 +0,0 @@
[% WRAPPER layout.tt title=(create ? "New release" : "Edit release ${release.name}") %]
[% PROCESS common.tt %]
[% USE HTML %]
<form class="form-horizontal" action="[% IF create %][% c.uri_for('/project' project.name 'create-release/submit') %][% ELSE %][% c.uri_for('/release' project.name release.name 'submit') %][% END %]" method="post">
<fieldset>
<div class="control-group">
<label class="control-label">Identifier</label>
<div class="controls">
<input type="text" class="span3" name="name" [% HTML.attributes(value => release.name) %]/>
</div>
</div>
<div class="control-group">
<label class="control-label">Description</label>
<div class="controls">
<input type="text" class="span3" name="description" [% HTML.attributes(value => release.description) %]/>
</div>
</div>
<h3>Release members</h3>
<p><em>Note:</em> to add a build to this release, go to the builds
information page and click on “Add to release”.</p>
[% FOREACH m IN members %]
<div class="releaseMember control-group">
<label class="control-label">Build [% m.build.id %] Label</label>
<div class="controls">
<input type="text" class="span3" name="member-[% m.build.id %]-description" [% HTML.attributes(value => m.description) %]/>
<button class="btn btn-warning" type="button" onclick='$(this).parents(".releaseMember").remove()'><i class="icon-trash icon-white"></i></button>
</div>
</div>
[% END %]
<div class="form-actions">
<button type="submit" class="btn btn-primary">
<i class="icon-ok icon-white"></i>
[%IF create %]Create[% ELSE %]Apply changes[% END %]
</button>
[% IF !create %]
<button id="delete-release" type="submit" class="btn btn-danger" name="action" value="delete">
<i class="icon-trash icon-white"></i>
Delete this release
</button>
<script type="text/javascript">
$("#delete-release").click(function() {
return confirm("Are you sure you want to delete this release?");
});
</script>
[% END %]
</div>
</fieldset>
</form>
[% END %]

View file

@ -14,14 +14,12 @@
[% UNLESS project.declfile %] [% UNLESS project.declfile %]
[% INCLUDE menuItem title="Create jobset" icon="icon-plus" uri=c.uri_for(c.controller('Project').action_for('create_jobset'), c.req.captures) %] [% INCLUDE menuItem title="Create jobset" icon="icon-plus" uri=c.uri_for(c.controller('Project').action_for('create_jobset'), c.req.captures) %]
[% END %] [% END %]
[% INCLUDE menuItem title="Create release" icon="icon-plus" uri=c.uri_for(c.controller('Project').action_for('create_release'), c.req.captures) %]
</ul> </ul>
</li> </li>
[% END %] [% END %]
<li class="active"><a href="#tabs-project" data-toggle="tab">Jobsets</a></li> <li class="active"><a href="#tabs-project" data-toggle="tab">Jobsets</a></li>
<li><a href="#tabs-configuration" data-toggle="tab">Configuration</a></li> <li><a href="#tabs-configuration" data-toggle="tab">Configuration</a></li>
<li><a href="#tabs-releases" data-toggle="tab">Releases</a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@ -95,37 +93,6 @@
</table> </table>
</div> </div>
<div id="tabs-releases" class="tab-pane">
[% IF releases.size == 0 %]
<p><em>This project has no releases yet.</em></p>
[% ELSE %]
<p>This project has made the following releases:</p>
<table class="table table-condensed table-striped clickable-rows">
<thead>
<tr>
<th>Name</th>
<th>Date</th>
</tr>
</thead>
<tbody>
[% FOREACH release IN releases %]
<tr>
<td><a class="row-link" href="[% c.uri_for('/release' project.name release.name) %]"><tt>[% release.name %]</tt></a></td>
<td>[% INCLUDE renderDateTime timestamp = release.timestamp %]</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
</div>
</div> </div>
<script> <script>

View file

@ -1,29 +0,0 @@
[% WRAPPER layout.tt title="Release $release.name" %]
[% PROCESS common.tt %]
[% PROCESS "product-list.tt" %]
[% USE HTML %]
<p><em>Released on [% INCLUDE renderDateTime timestamp =
release.timestamp %].</em> <a class="btn" href="[% c.uri_for('/release' project.name release.name "edit") %]"><i class="icon-edit"></i></a></p>
[% IF !members %]
<p><em>No builds have been added to this release yet.</em></p>
[% ELSE %]
[% FOREACH m IN members %]
<h3>
<a href="[% c.uri_for('/build' m.build.id) %]">
[% HTML.escape(m.description) %]
</a>
</h3>
[% INCLUDE renderProductList build=m.build %]
[% END %]
[% END %]
[% END %]

View file

@ -72,13 +72,6 @@ print STDERR "*** looking for scheduled builds\n";
keepBuild($_, 0) foreach $db->resultset('Builds')->search({ finished => 0 }, { columns => [ @columns ] }); keepBuild($_, 0) foreach $db->resultset('Builds')->search({ finished => 0 }, { columns => [ @columns ] });
# Keep every build in every release of every project.
print STDERR "*** looking for release members\n";
keepBuild($_, 0) foreach $db->resultset('Builds')->search_literal(
"exists (select 1 from releasemembers where build = me.id)",
{ order_by => ["project", "jobset", "job", "id"], columns => [ @columns ] });
# Keep all builds that have been marked as "keep". # Keep all builds that have been marked as "keep".
print STDERR "*** looking for kept builds\n"; print STDERR "*** looking for kept builds\n";
my @buildsToKeep = $db->resultset('Builds')->search( my @buildsToKeep = $db->resultset('Builds')->search(

View file

@ -378,8 +378,7 @@ create table BuildMetrics (
-- Cache for inputs of type "path" (used for testing Hydra), storing -- Cache for inputs of type "path" (used for testing Hydra), storing
-- the SHA-256 hash and store path for each source path. Also stores -- the SHA-256 hash and store path for each source path. Also stores
-- the timestamp when we first saw the path have these contents, which -- the timestamp when we first saw the path have these contents.
-- may be used to generate release names.
create table CachedPathInputs ( create table CachedPathInputs (
srcPath text not null, srcPath text not null,
timestamp integer not null, -- when we first saw this hash timestamp integer not null, -- when we first saw this hash
@ -451,35 +450,6 @@ create table SystemTypes (
); );
-- A release is a named set of builds. The ReleaseMembers table lists
-- the builds that constitute each release.
create table Releases (
project text not null,
name text not null,
timestamp integer not null,
description text,
primary key (project, name),
foreign key (project) references Projects(name) on delete cascade
);
create table ReleaseMembers (
project text not null,
release_ text not null,
build integer not null,
description text,
primary key (project, release_, build),
foreign key (project) references Projects(name) on delete cascade on update cascade,
foreign key (project, release_) references Releases(project, name) on delete cascade on update cascade,
foreign key (build) references Builds(id)
);
create table JobsetEvals ( create table JobsetEvals (
id serial primary key not null, id serial primary key not null,
@ -660,7 +630,6 @@ create index IndexJobsetEvalMembersOnEval on JobsetEvalMembers(eval);
create index IndexJobsetInputAltsOnInput on JobsetInputAlts(project, jobset, input); create index IndexJobsetInputAltsOnInput on JobsetInputAlts(project, jobset, input);
create index IndexJobsetInputAltsOnJobset on JobsetInputAlts(project, jobset); create index IndexJobsetInputAltsOnJobset on JobsetInputAlts(project, jobset);
create index IndexProjectsOnEnabled on Projects(enabled); create index IndexProjectsOnEnabled on Projects(enabled);
create index IndexReleaseMembersOnBuild on ReleaseMembers(build);
-- For hydra-update-gc-roots. -- For hydra-update-gc-roots.
create index IndexBuildsOnKeep on Builds(keep) where keep = 1; create index IndexBuildsOnKeep on Builds(keep) where keep = 1;

View file

@ -34,8 +34,6 @@ make_schema_at("Hydra::Schema", {
"nrbuilds" => "NrBuilds", "nrbuilds" => "NrBuilds",
"projectmembers" => "ProjectMembers", "projectmembers" => "ProjectMembers",
"projects" => "Projects", "projects" => "Projects",
"releasemembers" => "ReleaseMembers",
"releases" => "Releases",
"schemaversion" => "SchemaVersion", "schemaversion" => "SchemaVersion",
"starredjobs" => "StarredJobs", "starredjobs" => "StarredJobs",
"systemstatus" => "SystemStatus", "systemstatus" => "SystemStatus",