diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-08-04 18:24:15 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-08-04 18:24:15 +0200 |
commit | f44392e8cdbea85ac308b2472f813ee605ebae4b (patch) | |
tree | 6e7adaf99a0e5a43eb1bf5a0d673d86b60f34f99 /scripts | |
parent | 5be3a7fd0061aa0bc3059e09079741873b9b833f (diff) | |
parent | 4528b21bc922f8b1e0ba8581d230a492aa43c9cf (diff) | |
download | bugzilla-f44392e8cdbea85ac308b2472f813ee605ebae4b.tar.gz bugzilla-f44392e8cdbea85ac308b2472f813ee605ebae4b.tar.xz |
Merge branch 'mojo-poc'
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/entrypoint.pl | 13 | ||||
-rwxr-xr-x | scripts/generate_conduit_data.pl | 35 | ||||
-rwxr-xr-x | scripts/remove-non-public-data.pl | 2 |
3 files changed, 32 insertions, 18 deletions
diff --git a/scripts/entrypoint.pl b/scripts/entrypoint.pl index c48582606..f5c52f6a6 100755 --- a/scripts/entrypoint.pl +++ b/scripts/entrypoint.pl @@ -78,7 +78,6 @@ sub cmd_demo { sub cmd_httpd { check_data_dir(); wait_for_db(); - check_httpd_env(); my $httpd_exit_f = run_cereal_and_httpd(); assert_httpd()->get(); @@ -208,8 +207,6 @@ sub cmd_test_bmo { sub run_prove { my (%param) = @_; - check_httpd_env(); - my $prove_cmd = $param{prove_cmd}; my $prove_dir = $param{prove_dir}; assert_httpd()->then(sub { @@ -273,16 +270,6 @@ sub check_env { die 'Missing required environmental variables: ', join(', ', @missing_env), "\n"; } } -sub check_httpd_env { - check_env(qw( - HTTPD_StartServers - HTTPD_MinSpareServers - HTTPD_MaxSpareServers - HTTPD_ServerLimit - HTTPD_MaxClients - HTTPD_MaxRequestsPerChild - )) -} sub fix_path { $ENV{PATH} = "/app/local/bin:$ENV{PATH}"; 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' }, ); diff --git a/scripts/remove-non-public-data.pl b/scripts/remove-non-public-data.pl index ce7948dd0..47c123464 100755 --- a/scripts/remove-non-public-data.pl +++ b/scripts/remove-non-public-data.pl @@ -155,7 +155,7 @@ foreach my $view (sort @{ $dbh->selectcol_arrayref("SHOW FULL TABLES IN $db_name # drop tables/columns -my @tables = map { lc } sort @{ $dbh->selectcol_arrayref("SHOW TABLES") }; +my @tables = sort @{ $dbh->selectcol_arrayref("SHOW TABLES") }; foreach my $table (@tables) { if (exists $whitelist{$table}) { my @drop_columns; |