summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authordklawren <dklawren@users.noreply.github.com>2018-07-16 17:32:15 +0200
committerGitHub <noreply@github.com>2018-07-16 17:32:15 +0200
commit77dcbc804df9133207dd112a1a99821f66b2b9f7 (patch)
tree719987c59048d40680592aa7d6c60b362f69eac3 /scripts
parent163b1cab7daaa9843dffefaab090ed5f60961f72 (diff)
downloadbugzilla-77dcbc804df9133207dd112a1a99821f66b2b9f7.tar.gz
bugzilla-77dcbc804df9133207dd112a1a99821f66b2b9f7.tar.xz
Bug 1474617 - conduit-suite phabricator local development instance missing some default configuration
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generate_conduit_data.pl35
1 files changed, 31 insertions, 4 deletions
diff --git a/scripts/generate_conduit_data.pl b/scripts/generate_conduit_data.pl
index 541afb52a..627f3a199 100755
--- a/scripts/generate_conduit_data.pl
+++ b/scripts/generate_conduit_data.pl
@@ -27,19 +27,19 @@ my $admin_email = shift || 'admin@mozilla.bugs';
Bugzilla->set_user( Bugzilla::User->check( { name => $admin_email } ) );
##########################################################################
-# Create Conduit Test User
+# Create Conduit Test Users
##########################################################################
my $conduit_login = $ENV{CONDUIT_USER_LOGIN} || 'conduit@mozilla.bugs';
my $conduit_password = $ENV{CONDUIT_USER_PASSWORD} || 'password123456789!';
my $conduit_api_key = $ENV{CONDUIT_USER_API_KEY} || '';
-print "creating conduit user account...\n";
+print "creating conduit developer user account...\n";
if ( !Bugzilla::User->new( { name => $conduit_login } ) ) {
my $new_user = Bugzilla::User->create(
{
login_name => $conduit_login,
- realname => 'Conduit Test User',
+ realname => 'Conduit Developer',
cryptpassword => $conduit_password
},
);
@@ -48,12 +48,38 @@ if ( !Bugzilla::User->new( { name => $conduit_login } ) ) {
Bugzilla::User::APIKey->create_special(
{
user_id => $new_user->id,
- description => 'API key for Conduit User',
+ description => 'API key for Conduit Developer',
api_key => $conduit_api_key
}
);
}
}
+
+my $conduit_reviewer_login = $ENV{CONDUIT_REVIEWER_USER_LOGIN} || 'conduit-reviewer@mozilla.bugs';
+my $conduit_reviewer_password = $ENV{CONDUIT_REVIEWER_USER_PASSWORD} || 'password123456789!';
+my $conduit_reviewer_api_key = $ENV{CONDUIT_REVIEWER_USER_API_KEY} || '';
+
+print "creating conduit reviewer user account...\n";
+if ( !Bugzilla::User->new( { name => $conduit_reviewer_login } ) ) {
+ my $new_user = Bugzilla::User->create(
+ {
+ login_name => $conduit_reviewer_login,
+ realname => 'Conduit Reviewer',
+ cryptpassword => $conduit_reviewer_password
+ },
+ );
+
+ if ($conduit_reviewer_api_key) {
+ Bugzilla::User::APIKey->create_special(
+ {
+ user_id => $new_user->id,
+ description => 'API key for Conduit Reviewer',
+ api_key => $conduit_reviewer_api_key
+ }
+ );
+ }
+}
+
##########################################################################
# Create Phabricator Automation Bot
##########################################################################
@@ -88,6 +114,7 @@ if ( !Bugzilla::User->new( { name => $phab_login } ) ) {
my @users_groups = (
{ user => 'conduit@mozilla.bugs', group => 'editbugs' },
{ user => 'conduit@mozilla.bugs', group => 'core-security' },
+ { user => 'conduit-reviewer@mozilla.bugs', group => 'editbugs' },
{ user => 'phab-bot@bmo.tld', group => 'editbugs' },
{ user => 'phab-bot@bmo.tld', group => 'core-security' },
);