From 385ceaff4d1b603ba80b17da58f0dff20fb53638 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 5 Nov 2013 09:42:05 -0500 Subject: [PATCH 01/10] Show buildinput and buildproduct information in the Builds API Signed-off-by: Shea Levy --- src/lib/Hydra/Schema/BuildInputs.pm | 13 +++++++++++++ src/lib/Hydra/Schema/BuildProducts.pm | 19 ++++++++++++++++++- src/lib/Hydra/Schema/Builds.pm | 7 +++---- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/lib/Hydra/Schema/BuildInputs.pm b/src/lib/Hydra/Schema/BuildInputs.pm index dafae860..446f9b57 100644 --- a/src/lib/Hydra/Schema/BuildInputs.pm +++ b/src/lib/Hydra/Schema/BuildInputs.pm @@ -179,4 +179,17 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-10-08 13:08:15 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OaJPzRM+8XGsu3eIkqeYEw +my %hint = ( + columns => [ + 'type', + 'uri', + 'value', + 'revision', + ], +); + +sub json_hint { + return \%hint; +} + 1; diff --git a/src/lib/Hydra/Schema/BuildProducts.pm b/src/lib/Hydra/Schema/BuildProducts.pm index 538b1eff..1ab22493 100644 --- a/src/lib/Hydra/Schema/BuildProducts.pm +++ b/src/lib/Hydra/Schema/BuildProducts.pm @@ -153,5 +153,22 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-06-13 01:54:50 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+0LkZiaRL5tGJvbLxnwD/g -# You can replace this text with custom content, and it will be preserved on regeneration +my %hint = ( + columns => [ + 'type', + 'subtype', + 'name', + 'fileSize', + 'sha1hash', + 'sha256hash', + 'description', + 'path', + 'defaultPath' + ], +); + +sub json_hint { + return \%hint; +} + 1; diff --git a/src/lib/Hydra/Schema/Builds.pm b/src/lib/Hydra/Schema/Builds.pm index 2355e4ee..438f33ab 100644 --- a/src/lib/Hydra/Schema/Builds.pm +++ b/src/lib/Hydra/Schema/Builds.pm @@ -603,9 +603,6 @@ makeQueries('ForJob', "and project = ? and jobset = ? and job = ?"); my %hint = ( columns => [ - 'id', - 'finished', - 'timestamp', 'starttime', 'stoptime', 'project', @@ -619,7 +616,9 @@ my %hint = ( 'releasename' ], eager_relations => { - buildoutputs => 'name' + buildoutputs => 'name', + buildinputs => 'name' + buildproducts => 'productnr', } ); From 217ba725a31176d9c81b8b2f72a2cb4a563b6078 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 5 Nov 2013 09:43:32 -0500 Subject: [PATCH 02/10] Restore accidentally-removed fields to the Builds API Signed-off-by: Shea Levy --- src/lib/Hydra/Schema/Builds.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/Hydra/Schema/Builds.pm b/src/lib/Hydra/Schema/Builds.pm index 438f33ab..4c4a1a3e 100644 --- a/src/lib/Hydra/Schema/Builds.pm +++ b/src/lib/Hydra/Schema/Builds.pm @@ -603,6 +603,9 @@ makeQueries('ForJob', "and project = ? and jobset = ? and job = ?"); my %hint = ( columns => [ + 'id', + 'finished', + 'timestamp', 'starttime', 'stoptime', 'project', From d5574230e4219c00c56446b6217054d37224bbeb Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 5 Nov 2013 09:57:15 -0500 Subject: [PATCH 03/10] typo Signed-off-by: Shea Levy --- src/lib/Hydra/Schema/Builds.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Hydra/Schema/Builds.pm b/src/lib/Hydra/Schema/Builds.pm index 4c4a1a3e..6de55271 100644 --- a/src/lib/Hydra/Schema/Builds.pm +++ b/src/lib/Hydra/Schema/Builds.pm @@ -620,7 +620,7 @@ my %hint = ( ], eager_relations => { buildoutputs => 'name', - buildinputs => 'name' + buildinputs => 'name', buildproducts => 'productnr', } ); From f6a83bcc5b593ba92b7a4c9e690c91bcc3510fce Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 31 Oct 2013 10:02:29 +0100 Subject: [PATCH 04/10] user: Fix spelling of create-projects role. This actually is right in the manual but displayed incorrectly on the web interface. Signed-off-by: aszlig --- src/root/user.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/root/user.tt b/src/root/user.tt index 10c49b76..18de0ebb 100644 --- a/src/root/user.tt +++ b/src/root/user.tt @@ -73,7 +73,7 @@
From cfd4843290fa576284d6243beb499073a9301b29 Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 31 Oct 2013 10:03:54 +0100 Subject: [PATCH 05/10] topbar: Include "Create project" in menu. For users who only have the "create-projects" role, actually display the item in the menu as the only option. Signed-off-by: aszlig --- src/root/topbar.tt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/root/topbar.tt b/src/root/topbar.tt index 28e3885c..642e40d2 100644 --- a/src/root/topbar.tt +++ b/src/root/topbar.tt @@ -72,12 +72,14 @@ [% END %] [% END %] - [% IF c.user_exists && c.check_user_roles('admin') %] + [% IF c.user_exists && (c.check_user_roles('admin') || + c.check_user_roles('create-projects')) %] [% WRAPPER makeSubMenu title="Admin" %] - [% IF c.check_user_roles('admin') %] + [% IF c.check_user_roles('admin') || c.check_user_roles('create-projects') %] [% INCLUDE menuItem uri = c.uri_for(c.controller('Project').action_for('create')) title = "Create project" %]
  • [% END %] + [% IF c.check_user_roles('admin') %] [% INCLUDE menuItem uri = c.uri_for(c.controller('Admin').action_for('machines')) title = "Manage machines" %] @@ -103,6 +105,7 @@ title = "Clear VCS caches" confirmmsg = "Are you sure you want to clear the VCS cache?" class = "" %] + [% END %] [% END %] [% END %] From 2e1c07c5f70cde569a45a8360466faa88b3612d7 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 5 Nov 2013 12:31:36 -0500 Subject: [PATCH 06/10] Argh ALWAYS RUN THE TESTS Signed-off-by: Shea Levy --- src/lib/Hydra/Schema/Builds.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Hydra/Schema/Builds.pm b/src/lib/Hydra/Schema/Builds.pm index 6de55271..c81f6523 100644 --- a/src/lib/Hydra/Schema/Builds.pm +++ b/src/lib/Hydra/Schema/Builds.pm @@ -620,7 +620,7 @@ my %hint = ( ], eager_relations => { buildoutputs => 'name', - buildinputs => 'name', + buildinputs_builds => 'name', buildproducts => 'productnr', } ); From f1c187198cb784166120514e61799c4429b8443b Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 5 Nov 2013 12:39:55 -0500 Subject: [PATCH 07/10] Stupid capitalization scheme Signed-off-by: Shea Levy --- src/lib/Hydra/Schema/BuildProducts.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Hydra/Schema/BuildProducts.pm b/src/lib/Hydra/Schema/BuildProducts.pm index 1ab22493..31b0c1e4 100644 --- a/src/lib/Hydra/Schema/BuildProducts.pm +++ b/src/lib/Hydra/Schema/BuildProducts.pm @@ -158,12 +158,12 @@ my %hint = ( 'type', 'subtype', 'name', - 'fileSize', + 'filesize', 'sha1hash', 'sha256hash', 'description', 'path', - 'defaultPath' + 'defaultpath' ], ); From ecadcef64289ea03c8efd00b9b433a4e98c0e360 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 6 Nov 2013 11:59:04 +0100 Subject: [PATCH 08/10] Prevent a division by zero in hydra-queue-runner Fixes #131. --- src/script/hydra-queue-runner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/hydra-queue-runner b/src/script/hydra-queue-runner index f67d8cc2..2744c243 100755 --- a/src/script/hydra-queue-runner +++ b/src/script/hydra-queue-runner @@ -106,7 +106,7 @@ sub checkBuilds { { join => ['project'], select => ['system'], as => ['system'], distinct => 1 }); # Get the total number of scheduling shares. - my $totalShares = getTotalShares($db); + my $totalShares = getTotalShares($db) || 1; # For each system type, select up to the maximum number of # concurrent build for that system type. From a0b58b6b622d1fe846b5549de7b3b274b6da2bce Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 6 Nov 2013 12:03:08 +0100 Subject: [PATCH 09/10] Fix typo that caused empty news item to show up --- src/root/overview.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/root/overview.tt b/src/root/overview.tt index 8ae4ff77..965cb129 100644 --- a/src/root/overview.tt +++ b/src/root/overview.tt @@ -1,7 +1,7 @@ [% WRAPPER layout.tt title="Overview" hideHeader=1 %] [% PROCESS common.tt %] -[% IF newItems.size != 0 %] +[% IF newsItems.size != 0 %]
    [% FOREACH i IN newsItems %]
    From 27a740d4b1ad36f4783523932d050ef316ba17a6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 6 Nov 2013 12:05:56 +0100 Subject: [PATCH 10/10] Don't show an empty projects list --- src/root/overview.tt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/root/overview.tt b/src/root/overview.tt index 965cb129..9b31aeb5 100644 --- a/src/root/overview.tt +++ b/src/root/overview.tt @@ -15,6 +15,8 @@

    Projects

    +[% IF projects.size != 0 %] +

    The following projects are hosted on this server:

    @@ -36,4 +38,11 @@
    +[% ELSE %] + +
    Hydra has no projects yet. Please + create a project.
    + +[% END %] + [% END %]