Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2016-10-08 18:37:31 +0000
committerFrank Becker2016-10-18 19:11:05 +0000
commiteb3862868d2d721211a1cb89d798c8e741b6b9d3 (patch)
treeca2ceb2d6c2a8e0ee3d8467503eebe3ac1158af8 /org.eclipse.mylyn.bugzilla.releng
parent0cb159ddc3ba5e84f9a7ab70ab37c1c069691074 (diff)
downloadorg.eclipse.mylyn.tasks-eb3862868d2d721211a1cb89d798c8e741b6b9d3.tar.gz
org.eclipse.mylyn.tasks-eb3862868d2d721211a1cb89d798c8e741b6b9d3.tar.xz
org.eclipse.mylyn.tasks-eb3862868d2d721211a1cb89d798c8e741b6b9d3.zip
472936: Add support for Bugzilla 5.0 API Keys
Change-Id: I15c0db37576838bdfc0102b7fd86998e7b849fdb Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=472936
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.releng')
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp25
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/site.pp22
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb15
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/service.json.erb1
4 files changed, 59 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp
index 85c3db523..d28d91c6f 100644
--- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp
@@ -92,7 +92,6 @@ define bugzilla::defaultsites($base = $bugzilla::bugzillaBase, $userOwner = $bug
envdefault_rest => true,
testdataVersion => "Version1",
}
-
bugzilla::site { "bugzilla-rest-master":
major => "5",
@@ -107,4 +106,28 @@ define bugzilla::defaultsites($base = $bugzilla::bugzillaBase, $userOwner = $bug
testdataVersion => "Version2",
}
+ bugzilla::site { "bugzilla-rest-apikey-5.0.3":
+ major => "5",
+ minor => "0",
+ micro => "3",
+ envtype => "bugzillaREST",
+ rest_enabled => true,
+ testdataVersion => "Version1",
+ api_key_enabled => true,
+ }
+
+ bugzilla::site { "bugzilla-rest-apikey-master":
+ major => "5",
+ minor => "1",
+ micro => "1",
+ branch => "master",
+ branchTag => "HEAD",
+ envversion => "5.1.1+",
+ envinfo => "Master, APIKEY enabled",
+ envtype => "bugzillaREST",
+ rest_enabled => true,
+ testdataVersion => "Version2",
+ api_key_enabled => true,
+ }
+
} \ No newline at end of file
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/site.pp b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/site.pp
index 7be98fc2d..49f1fcb99 100644
--- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/site.pp
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/site.pp
@@ -35,6 +35,7 @@ define bugzilla::site (
$usebugaliases = false,
$clearMode = $bugzilla::clearMode,
$rest_enabled = false,
+ $api_key_enabled = false,
$envinfo = "",
$testdataVersion = "",
) {
@@ -82,10 +83,26 @@ define bugzilla::site (
$envinfo2 = ""
}
}
+
+ if $envinfo2 != "" {
+ if $api_key_enabled {
+ $envinfo3 = "$envinfo2, APIKEY enabled"
+ } else {
+ $envinfo3 = "$envinfo2"
+ }
+ } else {
+ if $api_key_enabled {
+ $envinfo3 = "APIKEY enabled"
+ } else {
+ $envinfo3 = ""
+ }
+ }
+
+
if $envinfo != "" {
$envinfo_intern = $envinfo
} else {
- $envinfo_intern = $envinfo2
+ $envinfo_intern = $envinfo3
}
if $major == "3" {
if $minor == "6" {
@@ -107,7 +124,6 @@ define bugzilla::site (
timeout => 300,
logoutput => true,
require => Exec["prepare bugzilla"],
- notify => Exec["end extract bugzilla $bugzillaDir"],
}
exec { "master master git clone $bugzillaDir":
command => "git clone https://github.com/bugzilla/bugzilla $base/$bugzillaDir",
@@ -155,7 +171,7 @@ define bugzilla::site (
user => "$userOwner",
timeout => 300,
creates => "$base/$bugzillaDir",
- require => Exec["prepare bugzilla"],
+ require => Exec["$branch $branchTagInternal git fetch $bugzillaDir"],
}
if $branchTagInternal == "HEAD" {
exec { "$branch $branchTagInternal dummy git checkout $bugzillaDir":
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb
index b61d4c014..c83928d41 100644
--- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb
@@ -83,6 +83,21 @@ sub install_before_final_checks {
cryptpassword => 'mylyntest' });
}
+<% if @api_key_enabled %>
+ my ($testuser_id_admin) = $dbh->selectrow_array(
+ 'SELECT userid FROM profiles WHERE login_name = ? ' ,
+ undef, 'admin@mylyn.eclipse.org');
+ my ($testuser_id_test) = $dbh->selectrow_array(
+ 'SELECT userid FROM profiles WHERE login_name = ? ' ,
+ undef, 'tests@mylyn.eclipse.org');
+ my $sth = $dbh->prepare( "INSERT INTO user_api_keys
+ (user_id, api_key, description)
+ VALUES (?, ?, ?)");
+ $sth->execute($testuser_id_admin, 'XkjcuGGfDcoNx0U6uyMM8ZaNuBlEdjrmXd8In3no', 'Mylyn REST Connector Admin');
+ $sth->execute($testuser_id_test, 'wvkz2SoBMBQEKv6ishp1j7NY1R9l711g5w2afXc6', 'Mylyn REST Connector Test');
+<% end %>
+
+
# create two new products
if (!$dbh->selectrow_array('SELECT 1 FROM products where id > 1')) {
print "create additional products...\n" unless $args->{silent};
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/service.json.erb b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/service.json.erb
index 5100e00bd..e83883a17 100644
--- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/service.json.erb
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/service.json.erb
@@ -14,6 +14,7 @@
<% if @branch %><% if @propertyanz.to_i > 0 %> ,<% else %> <% end %><% @propertyanz = @propertyanz.to_i -%><% @propertyanz += 1 -%>"branch": "<%= @branch %>"<% end %>
<% if @branchTag %><% if @propertyanz.to_i > 0 %> ,<% else %> <% end %><% @propertyanz = @propertyanz.to_i -%><% @propertyanz += 1 -%>"branchTag": "<%= @branchTag %>"<% end %>
<% if @rest_enabled %><% if @propertyanz.to_i > 0 %> ,<% else %> <% end %><% @propertyanz = @propertyanz.to_i -%><% @propertyanz += 1 -%>"rest_enabled": "<%= @rest_enabled %>"<% end %>
+<% if @api_key_enabled %><% if @propertyanz.to_i > 0 %> ,<% else %> <% end %><% @propertyanz = @propertyanz.to_i -%><% @propertyanz += 1 -%>"api_key_enabled": "<%= @api_key_enabled %>"<% end %>
<% if @testdataVersion %><% if @propertyanz.to_i > 0 %> ,<% else %> <% end %><% @propertyanz = @propertyanz.to_i -%><% @propertyanz += 1 -%>"testdataVersion": "<%= @testdataVersion %>"<% end %>
}
} \ No newline at end of file

Back to the top