Skip to content
Permalink
Browse files

Remove the "releases" feature

We haven't used this in many years (it was really only used for nix
and patchelf releases).
  • Loading branch information
edolstra committed May 6, 2020
1 parent ace30b4 commit 96a514c16906a99e7b8569bb3e8362701c22edd5
@@ -25,24 +25,6 @@

$ 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:

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

@@ -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) {
my ($self, $c) = @_;
my $build = $c->stash->{build};
@@ -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) {
my ($self, $c) = @_;
my $eval = $c->stash->{eval};
@@ -29,8 +29,6 @@ sub project_GET {
$c->stash->{template} = 'project.tt';

$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});
}
@@ -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;

This file was deleted.

@@ -529,21 +529,6 @@ __PACKAGE__->belongs_to(
{ 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
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
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EEXlcKN/ydXJ129vT0jTUw
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-05-06 12:32:57
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3IyFj/9Zf/hvmhBY4U/IBQ

__PACKAGE__->has_many(
"dependents",
@@ -247,36 +247,6 @@ __PACKAGE__->has_many(
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
Type: has_many
@@ -303,8 +273,8 @@ Composing rels: L</projectmembers> -> username
__PACKAGE__->many_to_many("usernames", "projectmembers", "username");


# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-06 12:22:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pcF/8351zyo9VL6N5eimdQ
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-05-06 12:32:57
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dEIVgrFGilPfITprs6nYuA

my %hint = (
columns => [
@@ -316,7 +286,6 @@ my %hint = (
"owner"
],
relations => {
releases => "name",
jobsets => "name"
}
);

0 comments on commit 96a514c

Please sign in to comment.
You can’t perform that action at this time.