summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.circleci/config.yml103
-rw-r--r--.gitignore2
-rw-r--r--Bugzilla.pm48
-rw-r--r--Bugzilla/CGI.pm4
-rw-r--r--Bugzilla/Config/BugFields.pm2
-rw-r--r--Bugzilla/Config/General.pm8
-rw-r--r--Bugzilla/Constants.pm4
-rw-r--r--Bugzilla/DB.pm14
-rw-r--r--Bugzilla/Install.pm51
-rw-r--r--Bugzilla/Install/DB.pm2
-rw-r--r--Bugzilla/Install/Filesystem.pm82
-rw-r--r--Bugzilla/Install/Localconfig.pm7
-rw-r--r--Bugzilla/PSGI.pm42
-rw-r--r--Bugzilla/Search.pm26
-rw-r--r--Bugzilla/Template.pm6
-rw-r--r--Dockerfile2
-rwxr-xr-xMakefile.PL2
-rw-r--r--app.psgi115
-rw-r--r--docs/en/rst/integrating/templates.rst2
-rwxr-xr-xeditusers.cgi5
-rw-r--r--errors/401.html40
-rw-r--r--errors/403.html37
-rw-r--r--errors/404.html37
-rw-r--r--errors/500.html37
-rw-r--r--extensions/AntiSpam/lib/Config.pm2
-rw-r--r--extensions/BMO/Extension.pm33
-rwxr-xr-xextensions/BMO/bin/bug_1093952.pl2
-rwxr-xr-xextensions/BMO/bin/bug_1141452.pl2
-rwxr-xr-xextensions/BMO/bin/migrate-github-pull-requests.pl2
-rw-r--r--extensions/BMO/lib/WebService.pm2
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl2
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-poweredby.html.tmpl2
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl2
-rw-r--r--extensions/BMO/template/en/default/bug/create/user-message.html.tmpl2
-rw-r--r--extensions/BMO/template/en/default/pages/bug-writing.html.tmpl2
-rw-r--r--extensions/BMO/template/en/default/pages/etiquette.html.tmpl2
-rw-r--r--extensions/BMO/template/en/default/pages/group_admins.html.tmpl2
-rw-r--r--extensions/BugModal/Extension.pm10
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl2
-rw-r--r--extensions/BzAPI/Extension.pm9
-rw-r--r--extensions/ComponentWatching/Extension.pm2
-rw-r--r--extensions/EditComments/lib/WebService.pm2
-rw-r--r--extensions/Ember/lib/WebService.pm2
-rw-r--r--extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl2
-rw-r--r--extensions/MyDashboard/lib/WebService.pm2
-rw-r--r--extensions/PhabBugz/lib/Util.pm2
-rwxr-xr-xextensions/Review/bin/migrate_mentor_from_whiteboard.pl2
-rw-r--r--extensions/Review/lib/WebService.pm2
-rw-r--r--extensions/SecureMail/Extension.pm5
-rwxr-xr-xextensions/TrackingFlags/bin/bug_825946.pl2
-rwxr-xr-xextensions/TrackingFlags/bin/bulk_flag_clear.pl2
-rwxr-xr-xheartbeat.cgi2
-rw-r--r--mod_perl.pl5
-rwxr-xr-xscripts/eject-users-from-groups.pl2
-rwxr-xr-xscripts/entrypoint.pl14
-rwxr-xr-xscripts/generate_bmo_data.pl6
-rwxr-xr-xscripts/move_os.pl2
-rwxr-xr-xscripts/movebugs.pl6
-rwxr-xr-xscripts/nagios_blocker_checker.pl2
-rwxr-xr-xscripts/remove_idle_group_members.pl2
-rwxr-xr-xscripts/reset_default_user.pl2
-rw-r--r--t/bmo/comments.t4
-rw-r--r--t/docker.t4
-rw-r--r--template/en/default/account/prefs/account.html.tmpl2
-rw-r--r--template/en/default/attachment/create.html.tmpl4
-rw-r--r--template/en/default/bug/create/user-message.html.tmpl2
-rw-r--r--template/en/default/bug/new_bug.html.tmpl6
-rw-r--r--template/en/default/global/variables.none.tmpl4
-rw-r--r--template/en/default/index.html.tmpl2
-rw-r--r--template/en/default/list/edit-multiple.html.tmpl1
-rwxr-xr-xtoken.cgi2
-rwxr-xr-xuserprefs.cgi2
-rwxr-xr-xvotes.cgi3
73 files changed, 473 insertions, 387 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 1283d573b..f5b35833a 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -7,7 +7,7 @@ version: 2
defaults:
bmo_slim_image: &bmo_slim_image
- image: mozillabteam/bmo-slim:20180330.1
+ image: bugzilla/harmony-slim:20180318.1
user: app
mysql_image: &mysql_image
@@ -66,64 +66,12 @@ defaults:
run:
name: default qa setup
command: |
- [[ -f build_info/only_version_changed.txt ]] && exit 0
mv /opt/bmo/local /app/local
perl -MSys::Hostname -i -pE 's/bmo.test/hostname() . ":$ENV{PORT}"/ges' $BZ_QA_CONF_FILE
- perl checksetup.pl --no-database --default-localconfig
+ /app/scripts/entrypoint.pl checksetup_gen_files --default-localconfig
mkdir artifacts
jobs:
- build_info:
- parallelism: 1
- working_directory: /app
- docker:
- - <<: *bmo_slim_image
- environment:
- <<: *bmo_env
- steps:
- - checkout
- - run:
- name: build push data
- command: |
- mv /opt/bmo/local /app/local
- perl Makefile.PL
- perl -I/app -I/app/local/lib/perl5 -MBugzilla -e 1
- perl checksetup.pl --no-database --no-templates --no-permissions
- perl scripts/build-bmo-push-data.pl
- - run:
- name: only publish if tag exists
- command: |
- tag="$(cat build_info/tag.txt)"
- git fetch --tags
- if git tag | fgrep -q "$tag"; then
- echo "tag $tag exists!"
- else
- echo "tag $tag does not exist"
- echo yes > build_info/publish.txt
- fi
- - run:
- name: check if only version changed
- command: |
- if git diff 'HEAD~..HEAD' --name-only | grep -qv '^Bugzilla.pm'; then
- echo "more files than just Bugzilla.pm changed."
- exit 0
- fi
- if git diff 'HEAD~..HEAD' |grep '^[+-][^+-]' | grep -qv '^[+-]our $VERSION'; then
- echo "Something other than the version number changed."
- exit 0
- fi
- if [[ "$CIRCLE_BRANCH" == "master" ]]; then
- echo "Can't cut corners on the master branch"
- exit 0
- fi
- echo yes > build_info/only_version_changed.txt
- - persist_to_workspace:
- root: /app/build_info
- paths: ["*.txt"]
- - store_artifacts:
- path: /app/build_info
- - *store_log
-
build:
working_directory: /app
docker:
@@ -149,22 +97,7 @@ jobs:
- *store_log
- deploy:
command: |
- TAG="$(cat /app/build_info/tag.txt)"
- [[ "$CIRCLE_BRANCH" == "master" ]] || exit 0
- [[ -n "$DOCKERHUB_REPO" && -n "$DOCKER_USER" && -n "$DOCKER_PASS" ]] || exit 0
- [[ -n "$GITHUB_PERSONAL_TOKEN" ]] || exit 0
- docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
- if [[ -n "$TAG" && -f build_info/publish.txt ]]; then
- git config credential.helper "cache --timeout 120"
- git config user.email "$GITHUB_EMAIL"
- git config user.name "$GITHUB_NAME"
- git tag $TAG
- git push https://${GITHUB_PERSONAL_TOKEN}:x-oauth-basic@github.com/$GITHUB_REPO.git $TAG
- docker tag bmo "$DOCKERHUB_REPO:$TAG"
- docker push "$DOCKERHUB_REPO:$TAG"
- fi
- docker tag bmo "$DOCKERHUB_REPO:latest"
- docker push "$DOCKERHUB_REPO:latest"
+ exit 0
test_sanity:
parallelism: 1
@@ -174,19 +107,14 @@ jobs:
environment: *bmo_env
steps:
- checkout
- - attach_workspace:
- at: /app/build_info
- run: |
- [[ -f build_info/only_version_changed.txt ]] && exit 0
mv /opt/bmo/local /app/local
mkdir artifacts
- run: |
- [[ -f build_info/only_version_changed.txt ]] && exit 0
perl Makefile.PL
- run:
name: run sanity tests
command: |
- [[ -f build_info/only_version_changed.txt ]] && exit 0
/app/scripts/entrypoint.pl prove -qf $(circleci tests glob 't/*.t' | circleci tests split) | tee artifacts/$CIRCLE_JOB.txt
- store_artifacts:
path: /app/artifacts
@@ -198,14 +126,10 @@ jobs:
docker: *docker_oldtests
steps:
- checkout
- - attach_workspace:
- at: /app/build_info
- *default_qa_setup
- run: |
- [[ -f build_info/only_version_changed.txt ]] && exit 0
/app/scripts/entrypoint.pl load_test_data
- run: |
- [[ -f build_info/only_version_changed.txt ]] && exit 0
/app/scripts/entrypoint.pl test_webservices | tee artifacts/$CIRCLE_JOB.txt
- store_artifacts:
path: /app/artifacts
@@ -217,14 +141,10 @@ jobs:
docker: *docker_oldtests
steps:
- checkout
- - attach_workspace:
- at: /app/build_info
- *default_qa_setup
- run: |
- [[ -f build_info/only_version_changed.txt ]] && exit 0
/app/scripts/entrypoint.pl load_test_data --legacy
- run: |
- [[ -f build_info/only_version_changed.txt ]] && exit 0
/app/scripts/entrypoint.pl test_selenium | tee artifacts/$CIRCLE_JOB.txt
- store_artifacts:
path: /app/artifacts
@@ -247,16 +167,12 @@ jobs:
- image: selenium/standalone-firefox:2.53.1
steps:
- checkout
- - attach_workspace:
- at: /app/build_info
- run: |
- [[ -f build_info/only_version_changed.txt ]] && exit 0
mv /opt/bmo/local /app/local
- perl checksetup.pl --no-database
+ /app/scripts/entrypoint.pl checksetup_gen_files
/app/scripts/entrypoint.pl load_test_data
mkdir artifacts
- run: |
- [[ -f build_info/only_version_changed.txt ]] && exit 0
/app/scripts/entrypoint.pl test_bmo -q -f t/bmo/*.t
- *store_log
@@ -264,29 +180,18 @@ workflows:
version: 2
main:
jobs:
- - build_info:
- filters: *main_filters
- build:
filters: *main_filters
requires:
- - build_info
- test_sanity
- test_bmo
- test_webservices
- test_selenium
- test_sanity:
filters: *main_filters
- requires:
- - build_info
- test_bmo:
filters: *main_filters
- requires:
- - build_info
- test_webservices:
filters: *main_filters
- requires:
- - build_info
- test_selenium:
filters: *main_filters
- requires:
- - build_info
diff --git a/.gitignore b/.gitignore
index 18f2d0a17..7bf2816b9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,7 +16,9 @@
/data
/localconfig
/localconfig.*
+/conf/env.conf
/index.html
+/errors/
/error_reports
/.DS_Store
/template_cache
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 1188102d3..f5e64c371 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -58,6 +58,7 @@ use File::Spec::Functions;
use Safe;
use Sys::Syslog qw(:DEFAULT);
use JSON::XS qw(decode_json);
+use URI;
use parent qw(Bugzilla::CPAN);
@@ -117,20 +118,6 @@ sub init_page {
# 001compile.t test).
return if $^C;
- # IIS prints out warnings to the webpage, so ignore them, or log them
- # to a file if the file exists.
- if ($ENV{SERVER_SOFTWARE} && $ENV{SERVER_SOFTWARE} =~ /microsoft-iis/i) {
- $SIG{__WARN__} = sub {
- my ($msg) = @_;
- my $datadir = bz_locations()->{'datadir'};
- if (-w "$datadir/errorlog") {
- my $warning_log = new IO::File(">>$datadir/errorlog");
- print $warning_log $msg;
- $warning_log->close();
- }
- };
- }
-
my $script = basename($0);
# BMO - init metrics collection if required
@@ -246,6 +233,15 @@ sub template_inner {
sub extensions {
my ($class) = @_;
+
+ # Guard against extensions querying the extension list during initialization
+ # (through this method or has_extension).
+ # The extension list is not fully populated at that point,
+ # so the results would not be meaningful.
+ state $recursive = 0;
+ die "Recursive attempt to load/query extensions" if $recursive;
+ $recursive = 1;
+
my $cache = $class->request_cache;
if (!$cache->{extensions}) {
my $extension_packages = Bugzilla::Extension->load_all();
@@ -258,9 +254,20 @@ sub extensions {
}
$cache->{extensions} = \@extensions;
}
+ $recursive = 0;
return $cache->{extensions};
}
+sub has_extension {
+ my ($class, $name) = @_;
+ my $cache = $class->request_cache;
+ if (!$cache->{extensions_hash}) {
+ my %extensions = map { $_->NAME => 1 } @{ Bugzilla->extensions };
+ $cache->{extensions_hash} = \%extensions;
+ }
+ return exists $cache->{extensions_hash}{$name};
+}
+
sub cgi {
return $_[0]->request_cache->{cgi} ||= new Bugzilla::CGI();
}
@@ -285,6 +292,13 @@ sub localconfig {
return $_[0]->process_cache->{localconfig} ||= read_localconfig();
}
+sub urlbase {
+ my ($class) = @_;
+
+ # Since this could be modified, we have to return a new one every time.
+ return URI->new($class->localconfig->{urlbase});
+}
+
sub params {
return $_[0]->request_cache->{params} ||= Bugzilla::Config::read_param_file();
}
@@ -369,7 +383,7 @@ sub login {
return $class->user if $class->user->id;
# Load all extensions here if not running under mod_perl
- $class->extensions unless $ENV{MOD_PERL};
+ $class->extensions unless BZ_PERSISTENT;
my $authorizer = new Bugzilla::Auth();
$type = LOGIN_REQUIRED if $class->cgi->param('GoAheadAndLogIn');
@@ -902,10 +916,10 @@ sub _cleanup {
sub END {
# Bugzilla.pm cannot compile in mod_perl.pl if this runs.
- _cleanup() unless $ENV{MOD_PERL};
+ _cleanup() unless BZ_PERSISTENT;
}
-init_page() if !$ENV{MOD_PERL};
+init_page() unless BZ_PERSISTENT;
1;
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm
index b0bc15e78..b932116a2 100644
--- a/Bugzilla/CGI.pm
+++ b/Bugzilla/CGI.pm
@@ -114,7 +114,7 @@ sub new {
# Under mod_perl, CGI's global variables get reset on each request,
# so we need to set them up again every time.
- $class->_init_bz_cgi_globals() if $ENV{MOD_PERL};
+ $class->_init_bz_cgi_globals() if BZ_PERSISTENT;
my $self = $class->SUPER::new(@args);
@@ -678,7 +678,7 @@ sub send_cookie {
}
# Add the default path and the domain in.
- state $uri = URI->new( Bugzilla->localconfig->{urlbase} );
+ state $uri = Bugzilla->urlbase;
$paramhash{'-path'} = $uri->path;
# we don't set the domain.
$paramhash{'-secure'} = 1
diff --git a/Bugzilla/Config/BugFields.pm b/Bugzilla/Config/BugFields.pm
index 94a16b7c2..c443ffe78 100644
--- a/Bugzilla/Config/BugFields.pm
+++ b/Bugzilla/Config/BugFields.pm
@@ -65,7 +65,7 @@ sub get_param_list {
name => 'defaultpriority',
type => 's',
choices => \@legal_priorities,
- default => $legal_priorities[-1],
+ default => $legal_priorities[0],
checker => \&check_priority
},
diff --git a/Bugzilla/Config/General.pm b/Bugzilla/Config/General.pm
index 9d85aecaf..7e1c812c1 100644
--- a/Bugzilla/Config/General.pm
+++ b/Bugzilla/Config/General.pm
@@ -25,6 +25,14 @@ use constant get_param_list => (
},
{
+ name => 'nobody_user',
+ type => 't',
+ no_reset => '1',
+ default => 'nobody@mozilla.org',
+ checker => \&check_email
+ },
+
+ {
name => 'docs_urlbase',
type => 't',
default => 'docs/%lang%/html/',
diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm
index 6e3a12736..65b37dced 100644
--- a/Bugzilla/Constants.pm
+++ b/Bugzilla/Constants.pm
@@ -193,6 +193,8 @@ use Memoize;
EMAIL_LIMIT_EXCEPTION
JOB_QUEUE_VIEW_MAX_JOBS
+
+ BZ_PERSISTENT
);
@Bugzilla::Constants::EXPORT_OK = qw(contenttypes);
@@ -700,6 +702,8 @@ sub _bz_locations {
};
}
+use constant BZ_PERSISTENT => $main::BUGZILLA_PERSISTENT;
+
# This makes us not re-compute all the bz_locations data every time it's
# called.
BEGIN { memoize('_bz_locations') };
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index 0dfa47c23..15acfd0d9 100644
--- a/Bugzilla/DB.pm
+++ b/Bugzilla/DB.pm
@@ -49,14 +49,12 @@ use constant ISOLATION_LEVEL => 'REPEATABLE READ';
# Bugzilla with enums. After that, they are either controlled through
# the Bugzilla UI or through the DB.
use constant ENUM_DEFAULTS => {
- bug_severity => ['blocker', 'critical', 'major', 'normal',
- 'minor', 'trivial', 'enhancement'],
- priority => ["Highest", "High", "Normal", "Low", "Lowest", "---"],
- op_sys => ["All","Windows","Mac OS","Linux","Other"],
- rep_platform => ["All","PC","Macintosh","Other"],
- bug_status => ["UNCONFIRMED","CONFIRMED","IN_PROGRESS","RESOLVED",
- "VERIFIED"],
- resolution => ["","FIXED","INVALID","WONTFIX", "DUPLICATE","WORKSFORME"],
+ bug_severity => [qw(blocker critical major normal minor trivial enhancement )],
+ priority => [qw(-- P1 P2 P3 P4 P5)],
+ op_sys => [ "Unspecified", "All", "Windows", "Mac OS", "Linux", "Other" ],
+ rep_platform => [ "Unspecified", "All", "PC", "Macintosh", "Other" ],
+ bug_status => [qw(UNCONFIRMED NEW ASSIGNED REOPENED RESOLVED VERIFIED CLOSED)],
+ resolution => [ "", qw(FIXED INVALID WONTFIX DUPLICATE WORKSFORME INCOMPLETE) ],
};
# The character that means "OR" in a boolean fulltext search. If empty,
diff --git a/Bugzilla/Install.pm b/Bugzilla/Install.pm
index ced559111..6ac16821e 100644
--- a/Bugzilla/Install.pm
+++ b/Bugzilla/Install.pm
@@ -19,6 +19,7 @@ use 5.10.1;
use strict;
use warnings;
+use Bugzilla::Logging;
use Bugzilla::Component;
use Bugzilla::Config qw(:admin);
use Bugzilla::Constants;
@@ -31,21 +32,31 @@ use Bugzilla::Util qw(get_text);
use Bugzilla::Version;
use constant STATUS_WORKFLOW => (
- [undef, 'UNCONFIRMED'],
- [undef, 'CONFIRMED'],
- [undef, 'IN_PROGRESS'],
- ['UNCONFIRMED', 'CONFIRMED'],
- ['UNCONFIRMED', 'IN_PROGRESS'],
- ['UNCONFIRMED', 'RESOLVED'],
- ['CONFIRMED', 'IN_PROGRESS'],
- ['CONFIRMED', 'RESOLVED'],
- ['IN_PROGRESS', 'CONFIRMED'],
- ['IN_PROGRESS', 'RESOLVED'],
- ['RESOLVED', 'UNCONFIRMED'],
- ['RESOLVED', 'CONFIRMED'],
- ['RESOLVED', 'VERIFIED'],
- ['VERIFIED', 'UNCONFIRMED'],
- ['VERIFIED', 'CONFIRMED'],
+ [ undef, 'UNCONFIRMED' ],
+ [ undef, 'NEW' ],
+ [ undef, 'ASSIGNED' ],
+ [ 'UNCONFIRMED', 'NEW' ],
+ [ 'UNCONFIRMED', 'ASSIGNED' ],
+ [ 'UNCONFIRMED', 'RESOLVED' ],
+ [ 'NEW', 'UNCONFIRMED' ],
+ [ 'NEW', 'ASSIGNED' ],
+ [ 'NEW', 'RESOLVED' ],
+ [ 'ASSIGNED', 'UNCONFIRMED' ],
+ [ 'ASSIGNED', 'NEW' ],
+ [ 'ASSIGNED', 'RESOLVED' ],
+ [ 'REOPENED', 'UNCONFIRMED' ],
+ [ 'REOPENED', 'NEW' ],
+ [ 'REOPENED', 'ASSIGNED' ],
+ [ 'REOPENED', 'RESOLVED' ],
+ [ 'RESOLVED', 'UNCONFIRMED' ],
+ [ 'RESOLVED', 'REOPENED' ],
+ [ 'RESOLVED', 'VERIFIED' ],
+ [ 'VERIFIED', 'UNCONFIRMED' ],
+ [ 'VERIFIED', 'REOPENED' ],
+ [ 'VERIFIED', 'RESOLVED' ],
+ [ 'CLOSED', 'UNCONFIRMED' ],
+ [ 'CLOSED', 'REOPENED' ],
+ [ 'CLOSED', 'RESOLVED' ],
);
sub SETTINGS {
@@ -273,6 +284,12 @@ use constant DEFAULT_PRODUCT => {
defaultmilestone => DEFAULT_MILESTONE,
};
+use constant DEFAULT_PRODUCT_GROUP => {
+ name => 'test-product-security',
+ description => "Security Sensitive TestProduct Bug",
+ isbuggroup => 1,
+};
+
use constant DEFAULT_COMPONENT => {
name => 'TestComponent',
description => 'This is a test component in the test product database.'
@@ -351,7 +368,8 @@ sub create_default_product {
print get_text('install_default_product',
{ name => DEFAULT_PRODUCT->{name} }) . "\n";
- my $product = Bugzilla::Product->create(DEFAULT_PRODUCT);
+ my $group = Bugzilla::Group->create(DEFAULT_PRODUCT_GROUP);
+ my $product = Bugzilla::Product->create({ %{DEFAULT_PRODUCT()}, security_group_id => $group->id });
# Get the user who will be the owner of the Component.
# We pick the admin with the lowest id, which is probably the
@@ -381,6 +399,7 @@ sub init_workflow {
'SELECT value, id FROM bug_status', {Columns=>[1,2]}) };
foreach my $pair (STATUS_WORKFLOW) {
+ WARN("unknown bug_status: " . $pair->[1]) unless $status_ids{$pair->[1]};
my $old_id = $pair->[0] ? $status_ids{$pair->[0]} : undef;
my $new_id = $status_ids{$pair->[1]};
$dbh->do('INSERT INTO status_workflow (old_status, new_status)
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm
index e6a7a3be0..2c8a22448 100644
--- a/Bugzilla/Install/DB.pm
+++ b/Bugzilla/Install/DB.pm
@@ -3895,7 +3895,7 @@ sub _migrate_group_owners {
my $dbh = Bugzilla->dbh;
return if $dbh->bz_column_info('groups', 'owner_user_id');
$dbh->bz_add_column('groups', 'owner_user_id', {TYPE => 'INT3'});
- my $nobody = Bugzilla::User->check('nobody@mozilla.org');
+ my $nobody = Bugzilla::User->check(Bugzilla->params->{'nobody_user'});
$dbh->do('UPDATE groups SET owner_user_id = ?', undef, $nobody->id);
}
diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm
index 71169345b..5e51dd9cc 100644
--- a/Bugzilla/Install/Filesystem.pm
+++ b/Bugzilla/Install/Filesystem.pm
@@ -115,6 +115,52 @@ sub HTTPD_ENV_CONF {
return join( "\n", map { "PerlPassEnv " . $_ } @env ) . "\n";
}
+sub _error_page {
+ my ($code, $title, $description) = @_;
+ warn "urlbase: ", Bugzilla->urlbase, "\n";
+ my $host = Bugzilla->urlbase->host;
+
+ return <<EOT;
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>$title</title>
+ <style>
+ body {
+ margin: 1em 2em;
+ background-color: #455372;
+ color: #ddd;
+ font-family: sans-serif;
+ }
+ h1, h3 {
+ color: #fff;
+ }
+ a {
+ color: #fff;
+ text-decoration: none;
+ }
+ #buggie {
+ float: left;
+ }
+ #content {
+ margin-left: 100px;
+ padding-top: 20px;
+ }
+ </style>
+ </head>
+ <body>
+ <img src="/images/buggie.png" id="buggie" alt="buggie" width="78" height="215">
+ <div id="content">
+ <h1>$title</h1>
+ <p>$description</p>
+ <h3>Error $code</h3>
+ <p><a href="/">$host</a></p>
+ </div>
+ </body>
+</html>
+EOT
+}
+
###############
# Permissions #
###############
@@ -430,6 +476,40 @@ sub FILESYSTEM {
contents => \&HTTPD_ENV_CONF },
);
+ # Create static error pages.
+ $create_dirs{"errors"} = DIR_CGI_READ;
+ $create_files{"errors/401.html"} = {
+ perms => CGI_READ,
+ overwrite => 1,
+ contents => _error_page(
+ 401, 'Authentication Required',
+ "This server could not verify that you are authorized to access
+ that url. you either supplied the wrong credentials (e.g., bad
+ password), or your browser doesn't understand how to supply the
+ credentials required.")
+ };
+ $create_files{"errors/403.html"} = {
+ perms => CGI_READ,
+ overwrite => 1,
+ contents => _error_page(
+ 403, 'Access Denied',
+ "Access to the requested resource has been denied.")
+ };
+ $create_files{"errors/404.html"} = {
+ perms => CGI_READ,
+ overwrite => 1,
+ contents => _error_page(
+ 404, 'Object Not Found',
+ "The requested URL was not found on this server.")
+ };
+ $create_files{"errors/500.html"} = {
+ perms => CGI_READ,
+ overwrite => 1,
+ contents => _error_page(
+ 500, 'Internal Server Error',
+ "The server encountered an internal error and was unable to complete your request.")
+ };
+
# Because checksetup controls the creation of index.html separately
# from all other files, it gets its very own hash.
my %index_html = (
@@ -564,7 +644,7 @@ sub update_filesystem {
# Delete old files that no longer need to exist
# 2001-04-29 jake@bugzilla.org - Remove oldemailtech
- # http://bugzilla.mozilla.org/show_bugs.cgi?id=71552
+ # http://bugzilla.mozilla.org/show_bug.cgi?id=71552
if (-d 'shadow') {
print "Removing shadow directory...\n";
rmtree("shadow");
diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm
index 7a913358c..85092f23a 100644
--- a/Bugzilla/Install/Localconfig.pm
+++ b/Bugzilla/Install/Localconfig.pm
@@ -283,7 +283,12 @@ sub read_localconfig {
my ($include_deprecated) = @_;
if ($ENV{LOCALCONFIG_ENV}) {
- return _read_localconfig_from_env();
+ my $lc = _read_localconfig_from_env();
+ if ( $lc->{urlbase} eq 'AUTOMATIC' ) {
+ $lc->{urlbase} = sprintf 'http://%s:%d/%s', hostname(), $ENV{PORT}, $ENV{BZ_QA_LEGACY_MODE} ? 'bmo/' : '';
+ $ENV{BZ_BASE_URL} = sprintf 'http://%s:%d', hostname(), $ENV{PORT};
+ }
+ return $lc;
}
else {
return _read_localconfig_from_file($include_deprecated);
diff --git a/Bugzilla/PSGI.pm b/Bugzilla/PSGI.pm
new file mode 100644
index 000000000..46352b319
--- /dev/null
+++ b/Bugzilla/PSGI.pm
@@ -0,0 +1,42 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
+
+package Bugzilla::PSGI;
+use 5.10.1;
+use strict;
+use warnings;
+
+use base qw(Exporter);
+
+use Bugzilla::Logging;
+our @EXPORT_OK = qw(compile_cgi);
+
+sub compile_cgi {
+ my ($script) = @_;
+ require CGI::Compile;
+ require CGI::Emulate::PSGI;
+
+ my $cgi = CGI::Compile->compile($script);
+ my $app = CGI::Emulate::PSGI->handler(
+ sub {
+ Bugzilla::init_page();
+ $cgi->();
+ }
+ );
+ return sub {
+ my $env = shift;
+ if ($env->{'psgix.cleanup'}) {
+ push @{ $env->{'psgix.cleanup.handler'} }, \&Bugzilla::_cleanup;
+ }
+ my $res = $app->($env);
+ Bugzilla::_cleanup() if not $env->{'psgix.cleanup'};
+ return $res;
+ };
+}
+
+
+1; \ No newline at end of file
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index f419955dc..e15c60f7f 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -802,18 +802,20 @@ sub data {
# BMO - to avoid massive amounts of joins, if we're selecting a lot of
# tracking flags, replace them with placeholders. the values will be
# retrieved later and injected into the result.
- my %tf_map = map { $_ => 1 } Bugzilla::Extension::TrackingFlags::Flag->get_all_names();
- my @tf_selected = grep { exists $tf_map{$_} } @orig_fields;
- # mysql has a limit of 61 joins, and we want to avoid massive amounts of joins
- # 30 ensures we won't hit the limit, nor generate too many joins
- if (scalar @tf_selected > 30) {
- foreach my $column (@tf_selected) {
- $self->COLUMNS->{$column}->{name} = "'---'";
+ if (Bugzilla->has_extension('TrackingFlags')) {
+ my %tf_map = map { $_ => 1 } Bugzilla::Extension::TrackingFlags::Flag->get_all_names();
+ my @tf_selected = grep { exists $tf_map{$_} } @orig_fields;
+ # mysql has a limit of 61 joins, and we want to avoid massive amounts of joins
+ # 30 ensures we won't hit the limit, nor generate too many joins
+ if (scalar @tf_selected > 30) {
+ foreach my $column (@tf_selected) {
+ $self->COLUMNS->{$column}->{name} = "'---'";
+ }
+ $self->{tracking_flags} = \@tf_selected;
+ }
+ else {
+ $self->{tracking_flags} = [];
}
- $self->{tracking_flags} = \@tf_selected;
- }
- else {
- $self->{tracking_flags} = [];
}
my $start_time = [gettimeofday()];
@@ -863,7 +865,7 @@ sub data {
$self->{data} = [map { $data{$_} } @$bug_ids];
# BMO - get tracking flags values, and insert into result
- if (@{ $self->{tracking_flags} }) {
+ if (Bugzilla->has_extension('TrackingFlags') && @{ $self->{tracking_flags} }) {
# read values
my $values;
$sql = "
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index ae4f9bbad..3ace60cf8 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -571,7 +571,7 @@ sub create {
# if a packager has modified bz_locations() to contain absolute
# paths.
ABSOLUTE => 1,
- RELATIVE => $ENV{MOD_PERL} ? 0 : 1,
+ RELATIVE => 1,
# Only use an on-disk template cache if we're running as the web
# server. This ensures the permissions of the cache remain correct.
@@ -928,7 +928,7 @@ sub create {
'sudoer' => sub { return Bugzilla->sudoer; },
# Allow templates to access the "corect" URLBase value
- 'urlbase' => sub { return Bugzilla->localconfig->{urlbase}; },
+ 'urlbase' => sub { Bugzilla->urlbase },
# Allow templates to access docs url with users' preferred language
'docs_urlbase' => sub {
@@ -1040,7 +1040,7 @@ sub create {
# under mod_perl, use a provider (template loader) that preloads all templates into memory
my $provider_class
- = $ENV{MOD_PERL}
+ = BZ_PERSISTENT
? 'Bugzilla::Template::PreloadProvider'
: 'Template::Provider';
diff --git a/Dockerfile b/Dockerfile
index 6aa2f2646..35a5f22e9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM mozillabteam/bmo-slim:20180330.1
+FROM bugzilla/harmony-slim:20180318.1
ARG CI
ARG CIRCLE_SHA1
diff --git a/Makefile.PL b/Makefile.PL
index 9f56cd487..2c7b8fad7 100755
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -35,6 +35,8 @@ BEGIN {
my %requires = (
'Algorithm::BloomFilter' => '0.02',
'CGI' => '3.51',
+ 'CGI::Compile' => 0,
+ 'CGI::Emulate::PSGI' => 0,
'CPAN::Meta::Prereqs' => '2.132830',
'CPAN::Meta::Requirements' => '2.121',
'Class::XSAccessor' => '1.18',
diff --git a/app.psgi b/app.psgi
new file mode 100644
index 000000000..4425b3e0c
--- /dev/null
+++ b/app.psgi
@@ -0,0 +1,115 @@
+#!/usr/bin/perl
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
+
+use 5.10.1;
+use strict;
+use warnings;
+
+BEGIN { $main::BUGZILLA_PERSISTENT = 1 }
+
+use File::Basename;
+use File::Spec;
+
+BEGIN {
+ require lib;
+ my $dir = File::Spec->rel2abs( dirname(__FILE__) );
+ lib->import(
+ $dir,
+ File::Spec->catdir( $dir, 'lib' ),
+ File::Spec->catdir( $dir, qw(local lib perl5) )
+ );
+
+ # disable "use lib" from now on
+ no warnings qw(redefine);
+ *lib::import = sub { };
+}
+
+# it is very important for CGI::Compile to be loaded first.
+use CGI::Compile;
+use Bugzilla::PSGI qw(compile_cgi);
+use Bugzilla::Logging;
+use Bugzilla ();
+use Bugzilla::Constants ();
+use Bugzilla::BugMail ();
+use Bugzilla::CGI ();
+use Bugzilla::Extension ();
+use Bugzilla::Install::Requirements ();
+use Bugzilla::Util ();
+use Bugzilla::RNG ();
+
+use Plack;
+use Plack::Builder;
+use Plack::App::URLMap;
+use Plack::App::WrapCGI;
+use Plack::Response;
+
+# Pre-load all extensions and find their static dirs.
+my @extensions = map { $_->NAME } @{ Bugzilla::Extension->load_all() };
+my @static_dirs = qw( data/webdot docs graphs images js skins static );
+foreach my $name (@extensions) {
+ my $dir = File::Spec->catfile('extensions', $name, 'web');
+ push @static_dirs, $dir if -d $dir;
+}
+
+Bugzilla->preload_features();
+
+# Force instantiation of template so Bugzilla::Template::PreloadProvider can do its magic.
+Bugzilla->template;
+
+use Bugzilla::Sentry;
+
+
+my $bugzilla_app = builder {
+ my $static_paths = join '|', map quotemeta, sort {length $b <=> length $a || $a cmp $b } @static_dirs;
+
+ enable 'Log4perl', category => 'Plack';
+
+ enable 'Static',
+ path => sub { s{^/(?:static/v\d+\.\d+/)?($static_paths)/}{$1/}gs },
+ root => Bugzilla::Constants::bz_locations->{cgi_path};
+
+ my @scripts = glob('*.cgi');
+
+ my %mount;
+
+ foreach my $script (@scripts) {
+ my $name = basename($script);
+ $mount{$name} = compile_cgi($script);
+ }
+
+ Bugzilla::Hook::process('psgi_builder', { mount => \%mount });
+
+ foreach my $name ( keys %mount ) {
+ mount "/$name" => $mount{$name};
+ }
+
+ # so mount / => $app will make *all* files redirect to the index.
+ # instead we use an inline middleware to rewrite / to /index.cgi
+ enable sub {
+ my $app = shift;
+ return sub {
+ my $env = shift;
+ $env->{PATH_INFO} = '/index.cgi' if $env->{PATH_INFO} eq '/';
+ return $app->($env);
+ };
+ };
+
+ mount '/robots.txt' => $mount{'robots.cgi'};
+ mount '/rest' => $mount{'rest.cgi'};
+
+};
+
+unless (caller) {
+ require Plack::Runner;
+ my $runner = Plack::Runner->new;
+ $runner->parse_options(@ARGV);
+ $runner->run($bugzilla_app);
+ exit 0;
+}
+
+return $bugzilla_app;
diff --git a/docs/en/rst/integrating/templates.rst b/docs/en/rst/integrating/templates.rst
index b477a9553..ee2c08e92 100644
--- a/docs/en/rst/integrating/templates.rst
+++ b/docs/en/rst/integrating/templates.rst
@@ -262,7 +262,7 @@ customizing for your installation.
It needs a couple of lines of boilerplate at the top like this::
[% USE Bugzilla %]
- [% cgi = Bugzilla.cgi %
+ [% cgi = Bugzilla.cgi %]
Then, this template can reference the form fields you have created using
the syntax ``[% cgi.param("field_name") %]``. When a bug report is
diff --git a/editusers.cgi b/editusers.cgi
index 934e0a4ef..ae1f35835 100755
--- a/editusers.cgi
+++ b/editusers.cgi
@@ -24,14 +24,13 @@ use Bugzilla::Field;
use Bugzilla::Group;
use Bugzilla::Token;
-my $user = Bugzilla->login(LOGIN_REQUIRED);
-
+local our $user = Bugzilla->login(LOGIN_REQUIRED);
my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template;
my $dbh = Bugzilla->dbh;
my $userid = $user->id;
my $editusers = $user->in_group('editusers');
-local our $vars = {};
+local our $vars = {};
# Reject access if there is no sense in continuing.
$editusers
diff --git a/errors/401.html b/errors/401.html
deleted file mode 100644
index 8242b549f..000000000
--- a/errors/401.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE HTML>
-<html>
- <head>
- <title>Access Denied</title>
- <style>
- body {
- margin: 1em 2em;
- background-color: #455372;
- color: #ddd;
- font-family: sans-serif;
- }
- h1, h3 {
- color: #fff;
- }
- a {
- color: #fff;
- text-decoration: none;
- }
- #buggie {
- float: left;
- }
- #content {
- margin-left: 100px;
- padding-top: 20px;
- }
- </style>
- </head>
- <body>
- <img src="/images/buggie.png" id="buggie" alt="buggie" width="78" height="215">
- <div id="content">
- <h1>Authentication Required</h1>
- <p>This server could not verify that you are authorized to access
- that url. you either supplied the wrong credentials (e.g., bad
- password), or your browser doesn't understand how to supply the
- credentials required.</p>
- <h3>Error 401</h3>
- <p><a href="/">bugzilla.mozilla.org</a></p>
- </div>
- </body>
-</html>
diff --git a/errors/403.html b/errors/403.html
deleted file mode 100644
index e2faf8522..000000000
--- a/errors/403.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE HTML>
-<html>
- <head>
- <title>Access Denied</title>
- <style>
- body {
- margin: 1em 2em;
- background-color: #455372;
- color: #ddd;
- font-family: sans-serif;
- }
- h1, h3 {
- color: #fff;
- }
- a {
- color: #fff;
- text-decoration: none;
- }
- #buggie {
- float: left;
- }
- #content {
- margin-left: 100px;
- padding-top: 20px;
- }
- </style>
- </head>
- <body>
- <img src="/images/buggie.png" id="buggie" alt="buggie" width="78" height="215">
- <div id="content">
- <h1>Access Denied</h1>
- <p>Access to the requested resource has been denied.</p>
- <h3>Error 403</h3>
- <p><a href="/">bugzilla.mozilla.org</a></p>
- </div>
- </body>
-</html>
diff --git a/errors/404.html b/errors/404.html
deleted file mode 100644
index 3b476471c..000000000
--- a/errors/404.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE HTML>
-<html>
- <head>
- <title>Object Not Found</title>
- <style>
- body {
- margin: 1em 2em;
- background-color: #455372;
- color: #ddd;
- font-family: sans-serif;
- }
- h1, h3 {
- color: #fff;
- }
- a {
- color: #fff;
- text-decoration: none;
- }
- #buggie {
- float: left;
- }
- #content {
- margin-left: 100px;
- padding-top: 20px;
- }
- </style>
- </head>
- <body>
- <img src="/images/buggie.png" id="buggie" alt="buggie" width="78" height="215">
- <div id="content">
- <h1>Object Not Found</h1>
- <p>The requested URL was not found on this server.</p>
- <h3>Error 404</h3>
- <p><a href="/">bugzilla.mozilla.org</a></p>
- </div>
- </body>
-</html>
diff --git a/errors/500.html b/errors/500.html
deleted file mode 100644
index e0657001d..000000000
--- a/errors/500.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE HTML>
-<html>
- <head>
- <title>Internal Server Error</title>
- <style>
- body {
- margin: 1em 2em;
- background-color: #455372;
- color: #ddd;
- font-family: sans-serif;
- }
- h1, h3 {
- color: #fff;
- }
- a {
- color: #fff;
- text-decoration: none;
- }
- #buggie {
- float: left;
- }
- #content {
- margin-left: 100px;
- padding-top: 20px;
- }
- </style>
- </head>
- <body>
- <img src="/images/buggie.png" id="buggie" alt="buggie" width="78" height="215">
- <div id="content">
- <h1>Internal Server Error</h1>
- <p>The server encountered an internal error and was unable to complete your request.</p>
- <h3>Error 500</h3>
- <p><a href="/">bugzilla.mozilla.org</a></p>
- </div>
- </body>
-</html>
diff --git a/extensions/AntiSpam/lib/Config.pm b/extensions/AntiSpam/lib/Config.pm
index e35a7f001..278baea8f 100644
--- a/extensions/AntiSpam/lib/Config.pm
+++ b/extensions/AntiSpam/lib/Config.pm
@@ -55,7 +55,7 @@ sub get_param_list {
"This account has been automatically disabled as a result of " .
"a high number of comments tagged as abusive.<br>\n<br>\n" .
"All interactions on Bugzilla should follow our " .
- "<a href=\"https://bugzilla.mozilla.org/page.cgi?id=etiquette.html\">" .
+ "<a href=\"" . Bugzilla->localconfig->{'urlbase'} . "page.cgi?id=etiquette.html\">" .
"etiquette guidelines</a>.<br>\n<br>\n" .
"Please contact the address at the end of this message if you " .
"believe this to be an error, or if you would like your account " .
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm
index 2d5d2b182..f23ab723f 100644
--- a/extensions/BMO/Extension.pm
+++ b/extensions/BMO/Extension.pm
@@ -46,6 +46,7 @@ use Bugzilla::User;
use Bugzilla::UserAgent qw(detect_platform detect_op_sys);
use Bugzilla::User::Setting;
use Bugzilla::Util;
+use Bugzilla::PSGI qw(compile_cgi);
use Date::Parse;
use DateTime;
@@ -878,7 +879,7 @@ sub object_end_of_create {
# Add default searches to new user's footer
my $dbh = Bugzilla->dbh;
- my $sharer = Bugzilla::User->new({ name => 'nobody@mozilla.org' })
+ my $sharer = Bugzilla::User->new({ name => Bugzilla->params->{'nobody_user'} })
or return;
my $group = Bugzilla::Group->new({ name => 'everyone' })
or return;
@@ -919,7 +920,7 @@ sub _bug_reporters_hw_os {
sub _bug_is_unassigned {
my ($self) = @_;
my $assignee = $self->assigned_to->login;
- return $assignee eq 'nobody@mozilla.org' || $assignee =~ /\.bugs$/;
+ return $assignee eq Bugzilla->params->{'nobody_user'} || $assignee =~ /\.bugs$/;
}
sub _bug_has_current_patch {
@@ -1100,7 +1101,7 @@ sub object_start_of_update {
# and the assignee isn't a real person
return unless
- $new_bug->assigned_to->login eq 'nobody@mozilla.org'
+ $new_bug->assigned_to->login eq Bugzilla->params->{'nobody_user'}
|| $new_bug->assigned_to->login =~ /\.bugs$/;
# and the user can set the status to NEW
@@ -1595,7 +1596,7 @@ sub field_end_of_create {
my $name = $field->name;
if (Bugzilla->usage_mode == USAGE_MODE_CMDLINE) {
- Bugzilla->set_user(Bugzilla::User->check({ name => 'nobody@mozilla.org' }));
+ Bugzilla->set_user(Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'} }));
print "Creating IT permission grant bug for new field '$name'...";
}
@@ -1666,6 +1667,28 @@ sub webservice {
$dispatch->{BMO} = "Bugzilla::Extension::BMO::WebService";
}
+sub psgi_builder {
+ my ($self, $args) = @_;
+ my $mount = $args->{mount};
+
+ my $ses_index = Plack::Builder::builder(sub {
+ my $auth_user = Bugzilla->localconfig->{ses_username};
+ my $auth_pass = Bugzilla->localconfig->{ses_password};
+ Plack::Builder::enable("Auth::Basic", authenticator => sub {
+ my ($username, $password, $env) = @_;
+ return ( $auth_user
+ && $auth_pass
+ && $username
+ && $password
+ && $username eq $auth_user
+ && $password eq $auth_pass );
+ });
+ compile_cgi("ses/index.cgi");
+ });
+
+ $mount->{'ses/index.cgi'} = $ses_index;
+}
+
our $search_content_matches;
BEGIN {
$search_content_matches = \&Bugzilla::Search::_content_matches;
@@ -1951,7 +1974,7 @@ sub _post_employee_incident_bug {
my ($investigate_bug, $ssh_key_bug);
my $old_user = Bugzilla->user;
eval {
- Bugzilla->set_user(Bugzilla::User->new({ name => 'nobody@mozilla.org' }));
+ Bugzilla->set_user(Bugzilla::User->new({ name => Bugzilla->params->{'nobody_user'} }));
my $new_user = Bugzilla->user;
# HACK: User needs to be in the editbugs and primary bug's group to allow
diff --git a/extensions/BMO/bin/bug_1093952.pl b/extensions/BMO/bin/bug_1093952.pl
index 735c6a37a..fd891f4ae 100755
--- a/extensions/BMO/bin/bug_1093952.pl
+++ b/extensions/BMO/bin/bug_1093952.pl
@@ -52,7 +52,7 @@ printf "About to fix %s bugs\n", scalar(@$bugs);
print "Press <Ctrl-C> to stop or <Enter> to continue...\n";
getc();
-my $nobody = Bugzilla::User->check({ name => 'nobody@mozilla.org' });
+my $nobody = Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'} });
my $field = Bugzilla::Field->check({ name => 'status_whiteboard' });
my $when = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
diff --git a/extensions/BMO/bin/bug_1141452.pl b/extensions/BMO/bin/bug_1141452.pl
index 869593802..155c4704c 100755
--- a/extensions/BMO/bin/bug_1141452.pl
+++ b/extensions/BMO/bin/bug_1141452.pl
@@ -50,7 +50,7 @@ printf "About to fix %s bugs\n", scalar(@$flags);
print "Press <Ctrl-C> to stop or <Enter> to continue...\n";
getc();
-my $nobody = Bugzilla::User->check({ name => 'nobody@mozilla.org' });
+my $nobody = Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'} });
my $when = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
$dbh->bz_start_transaction();
diff --git a/extensions/BMO/bin/migrate-github-pull-requests.pl b/extensions/BMO/bin/migrate-github-pull-requests.pl
index 53c1727b5..c39778a4a 100755
--- a/extensions/BMO/bin/migrate-github-pull-requests.pl
+++ b/extensions/BMO/bin/migrate-github-pull-requests.pl
@@ -23,7 +23,7 @@ use Bugzilla::User;
use Bugzilla::Util qw(trim);
my $dbh = Bugzilla->dbh;
-my $nobody = Bugzilla::User->check({ name => 'nobody@mozilla.org' });
+my $nobody = Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'} });
my $field = Bugzilla::Field->check({ name => 'attachments.mimetype' });
# grab list of suitable attachments
diff --git a/extensions/BMO/lib/WebService.pm b/extensions/BMO/lib/WebService.pm
index 327c8563f..b9d8e4132 100644
--- a/extensions/BMO/lib/WebService.pm
+++ b/extensions/BMO/lib/WebService.pm
@@ -116,7 +116,7 @@ Bugzilla::Extension::BMO::Webservice - The BMO WebServices API
=head1 DESCRIPTION
-This module contains API methods that are useful to user's of bugzilla.mozilla.org.
+This module contains API methods that are useful to users of bugzilla.mozilla.org.
=head1 METHODS
diff --git a/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl
index 697542ead..0bd1c94d7 100644
--- a/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl
@@ -297,7 +297,7 @@ function validate_form() {
<input type="hidden" name="version" value="unspecified">
<input type="hidden" name="bug_severity" value="normal">
<input type="hidden" name="group" value="pr-private">
-<input type="hidden" name="assigned_to" id="assigned_to" value="nobody@mozilla.org">
+<input type="hidden" name="assigned_to" id="assigned_to" value="[% Param('nobody_user') FILTER html %]">
<input type="hidden" name="token" value="[% token FILTER html %]">
<div class="head">
diff --git a/extensions/BMO/template/en/default/bug/create/create-poweredby.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-poweredby.html.tmpl
index d6243c73b..9c0c4780d 100644
--- a/extensions/BMO/template/en/default/bug/create/create-poweredby.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-poweredby.html.tmpl
@@ -43,7 +43,7 @@ please provide some information about your application or product.</p>
<input type="hidden" name="priority" value="--">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
- <input type="hidden" name="assigned_to" value="nobody@mozilla.org">
+ <input type="hidden" name="assigned_to" value="[% Param('nobody_user') FILTER html %]">
<input type="hidden" name="cc" value="liz@mozilla.com">
<input type="hidden" name="groups" value="marketing-private">
<input type="hidden" name="token" value="[% token FILTER html %]">
diff --git a/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl
index 92517cb80..803f2a746 100644
--- a/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl
@@ -88,7 +88,7 @@ function validateAndSubmit() {
<input type="hidden" name="token" value="[% token FILTER html %]">
<div class="head_desc">
- <a href="https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines">
+ <a href="[% terms.BugWritingGuidelinesURL %]">
[% terms.Bug %] writing guidelines</a>
</div>
diff --git a/extensions/BMO/template/en/default/bug/create/user-message.html.tmpl b/extensions/BMO/template/en/default/bug/create/user-message.html.tmpl
index 6ecd0bc75..d3c7412bf 100644
--- a/extensions/BMO/template/en/default/bug/create/user-message.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/user-message.html.tmpl
@@ -17,7 +17,7 @@
[% END +%]
[% UNLESS no_bug_guidelines %]
Before reporting a [% terms.bug %], make sure you've read our
- <a href="https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines">
+ <a href="[% terms.BugWritingGuidelinesURL %]">
[% terms.bug %] writing guidelines</a> and double checked that your [% terms.bug %] hasn't already
been reported. Consult our list of <a href="https://bugzilla.mozilla.org/duplicates.cgi">
most frequently reported [% terms.bugs %]</a> and <a href="https://bugzilla.mozilla.org/query.cgi">
diff --git a/extensions/BMO/template/en/default/pages/bug-writing.html.tmpl b/extensions/BMO/template/en/default/pages/bug-writing.html.tmpl
index e1c67605f..dc253ee03 100644
--- a/extensions/BMO/template/en/default/pages/bug-writing.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/bug-writing.html.tmpl
@@ -7,5 +7,5 @@
#%]
[% PROCESS global/redirect.html.tmpl
- url = "https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines"
+ url = terms.BugWritingGuidelinesURL
%]
diff --git a/extensions/BMO/template/en/default/pages/etiquette.html.tmpl b/extensions/BMO/template/en/default/pages/etiquette.html.tmpl
index 45dd5bd65..fe7d2cd3d 100644
--- a/extensions/BMO/template/en/default/pages/etiquette.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/etiquette.html.tmpl
@@ -173,7 +173,7 @@
<h2>See Also</h2>
<p>
- <a href="https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines">The [% terms.Bug %] Writing Guidelines</a>.
+ <a href="[% terms.BugWritingGuidelinesURL %]">The [% terms.Bug %] Writing Guidelines</a>.
</p>
[% INCLUDE global/footer.html.tmpl %]
diff --git a/extensions/BMO/template/en/default/pages/group_admins.html.tmpl b/extensions/BMO/template/en/default/pages/group_admins.html.tmpl
index cfa3bd3ea..838a1e84a 100644
--- a/extensions/BMO/template/en/default/pages/group_admins.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/group_admins.html.tmpl
@@ -39,7 +39,7 @@
[% group.name FILTER html %]</span>
</td>
<td nowrap>
- [% IF group.owner.login == 'nobody@mozilla.org' %]
+ [% IF group.owner.login == Param('nobody_user') %]
&ndash;
[% ELSE %]
[% INCLUDE global/user.html.tmpl who = group.owner %]
diff --git a/extensions/BugModal/Extension.pm b/extensions/BugModal/Extension.pm
index 1291fca21..ef9c93a37 100644
--- a/extensions/BugModal/Extension.pm
+++ b/extensions/BugModal/Extension.pm
@@ -188,10 +188,12 @@ sub template_before_process {
return if exists $bug->{error};
# trigger loading of tracking flags
- Bugzilla::Extension::TrackingFlags->template_before_process({
- file => 'bug/edit.html.tmpl',
- vars => $vars,
- });
+ if (Bugzilla->has_extension('TrackingFlags')) {
+ Bugzilla::Extension::TrackingFlags->template_before_process({
+ file => 'bug/edit.html.tmpl',
+ vars => $vars,
+ });
+ }
if (any { $bug->product eq $_ } READABLE_BUG_STATUS_PRODUCTS) {
my @flags = map { { name => $_->name, status => $_->status } } @{$bug->flags};
diff --git a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
index b61e742b4..48c2c1803 100644
--- a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
@@ -19,7 +19,7 @@
# these are used in a few places
is_cced = bug.cc.contains(user.login);
- unassigned = (bug.assigned_to.login == "nobody@mozilla.org")
+ unassigned = (bug.assigned_to.login == Param('nobody_user'))
|| (bug.assigned_to.login.search('\.bugs$'));
# custom fields that have custom rendering, or should not be rendered
diff --git a/extensions/BzAPI/Extension.pm b/extensions/BzAPI/Extension.pm
index bb9805134..1f7cce04a 100644
--- a/extensions/BzAPI/Extension.pm
+++ b/extensions/BzAPI/Extension.pm
@@ -15,6 +15,7 @@ use base qw(Bugzilla::Extension);
use Bugzilla::Extension::BzAPI::Constants;
use Bugzilla::Extension::BzAPI::Util qw(fix_credentials filter_wants_nocache);
+use Bugzilla::PSGI qw(compile_cgi);
use Bugzilla::Error;
use Bugzilla::Util qw(trick_taint datetime_from);
@@ -188,6 +189,14 @@ sub webservice_status_code_map {
$status_code_map->{51} = STATUS_BAD_REQUEST;
}
+sub psgi_builder {
+ my ($self, $args) = @_;
+ my $mount = $args->{mount};
+
+ $mount->{'bzapi'} = compile_cgi('extensions/BzAPI/bin/rest.cgi');
+}
+
+
#####################
# Utility Functions #
#####################
diff --git a/extensions/ComponentWatching/Extension.pm b/extensions/ComponentWatching/Extension.pm
index 01d843c7a..526ba1c5e 100644
--- a/extensions/ComponentWatching/Extension.pm
+++ b/extensions/ComponentWatching/Extension.pm
@@ -23,7 +23,7 @@ use Bugzilla::Util qw(detaint_natural trim trick_taint);
our $VERSION = '2';
use constant REQUIRE_WATCH_USER => 1;
-use constant DEFAULT_ASSIGNEE => 'nobody@mozilla.org';
+use constant DEFAULT_ASSIGNEE => Bugzilla->params->{'nobody_user'};
use constant REL_COMPONENT_WATCHER => 15;
diff --git a/extensions/EditComments/lib/WebService.pm b/extensions/EditComments/lib/WebService.pm
index 6969ca742..5fdd6ffee 100644
--- a/extensions/EditComments/lib/WebService.pm
+++ b/extensions/EditComments/lib/WebService.pm
@@ -88,7 +88,7 @@ Bugzilla::Extension::EditComments::Webservice - The EditComments WebServices API
=head1 DESCRIPTION
-This module contains API methods that are useful to user's of bugzilla.mozilla.org.
+This module contains API methods that are useful to users of bugzilla.mozilla.org.
=head1 METHODS
diff --git a/extensions/Ember/lib/WebService.pm b/extensions/Ember/lib/WebService.pm
index 10c828537..2e00773f2 100644
--- a/extensions/Ember/lib/WebService.pm
+++ b/extensions/Ember/lib/WebService.pm
@@ -781,7 +781,7 @@ Bugzilla::Extension::Ember::Webservice - The BMO Ember WebServices API
=head1 DESCRIPTION
-This module contains API methods that are useful to user's of the Bugzilla Ember
+This module contains API methods that are useful to users of the Bugzilla Ember
based UI.
=head1 METHODS
diff --git a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
index e1a9e0bc5..7ffa04922 100644
--- a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
+++ b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
@@ -356,7 +356,7 @@ Product: <b><span id="dupes_product_name">?</span></b>:
<ul>
<li>Please fill out this form clearly, precisely and in as much detail as you can manage.</li>
<li>Please report only a single problem at a time.</li>
-<li><a href="https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines" target="_blank" rel="noopener noreferrer">These guidelines</a>
+<li><a href="[% terms.BugWritingGuidelinesURL %]" target="_blank" rel="noopener noreferrer">These guidelines</a>
explain how to write effective [% terms.bug %] reports.</li>
</ul>
diff --git a/extensions/MyDashboard/lib/WebService.pm b/extensions/MyDashboard/lib/WebService.pm
index 5407c1d0b..5ab849350 100644
--- a/extensions/MyDashboard/lib/WebService.pm
+++ b/extensions/MyDashboard/lib/WebService.pm
@@ -172,7 +172,7 @@ Bugzilla::Extension::MyDashboard::Webservice - The MyDashboard WebServices API
=head1 DESCRIPTION
-This module contains API methods that are useful to user's of bugzilla.mozilla.org.
+This module contains API methods that are useful to users of bugzilla.mozilla.org.
=head1 METHODS
diff --git a/extensions/PhabBugz/lib/Util.pm b/extensions/PhabBugz/lib/Util.pm
index 52ea9c0d5..844d8c0b5 100644
--- a/extensions/PhabBugz/lib/Util.pm
+++ b/extensions/PhabBugz/lib/Util.pm
@@ -128,7 +128,7 @@ sub get_bug_role_phids {
my @bug_users = ( $bug->reporter );
push(@bug_users, $bug->assigned_to)
- if $bug->assigned_to->email !~ /^nobody\@mozilla\.org$/;
+ if $bug->assigned_to->email != Bugzilla->params->{'nobody_user'};
push(@bug_users, $bug->qa_contact) if $bug->qa_contact;
push(@bug_users, @{ $bug->cc_users }) if @{ $bug->cc_users };
diff --git a/extensions/Review/bin/migrate_mentor_from_whiteboard.pl b/extensions/Review/bin/migrate_mentor_from_whiteboard.pl
index c6b69006f..debf173a7 100755
--- a/extensions/Review/bin/migrate_mentor_from_whiteboard.pl
+++ b/extensions/Review/bin/migrate_mentor_from_whiteboard.pl
@@ -36,7 +36,7 @@ EOF
<>;
# we need to be logged in to do user searching and update bugs
-my $nobody = Bugzilla::User->check({ name => 'nobody@mozilla.org' });
+my $nobody = Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'} });
$nobody->{groups} = [ Bugzilla::Group->get_all ];
Bugzilla->set_user($nobody);
diff --git a/extensions/Review/lib/WebService.pm b/extensions/Review/lib/WebService.pm
index 3f6816916..0c54d725a 100644
--- a/extensions/Review/lib/WebService.pm
+++ b/extensions/Review/lib/WebService.pm
@@ -51,7 +51,7 @@ sub suggestions {
# we always need to be authentiated to perform user matching
my $user = Bugzilla->user;
if (!$user->id) {
- Bugzilla->set_user(Bugzilla::User->check({ name => 'nobody@mozilla.org' }));
+ Bugzilla->set_user(Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'} }));
push @reviewers, @{ $bug->mentors };
Bugzilla->set_user($user);
} else {
diff --git a/extensions/SecureMail/Extension.pm b/extensions/SecureMail/Extension.pm
index d684b5a39..b05dc97f6 100644
--- a/extensions/SecureMail/Extension.pm
+++ b/extensions/SecureMail/Extension.pm
@@ -102,7 +102,10 @@ sub object_columns {
my $columns = $args->{'columns'};
if ($class->isa('Bugzilla::Group')) {
- push(@$columns, 'secure_mail');
+ my $dbh = Bugzilla->dbh;
+ if ($dbh->bz_column_info(Bugzilla::Group->DB_TABLE, 'securemail')) {
+ push @$columns, 'secure_mail';
+ }
}
}
diff --git a/extensions/TrackingFlags/bin/bug_825946.pl b/extensions/TrackingFlags/bin/bug_825946.pl
index 3f380b7ac..896dc5448 100755
--- a/extensions/TrackingFlags/bin/bug_825946.pl
+++ b/extensions/TrackingFlags/bin/bug_825946.pl
@@ -24,7 +24,7 @@ use Bugzilla::Bug qw(LogActivityEntry);
Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
my $dbh = Bugzilla->dbh;
-my $user = Bugzilla::User->check({name => 'nobody@mozilla.org'});
+my $user = Bugzilla::User->check({name => Bugzilla->params->{'nobody_user'}});
my $tf_vis = $dbh->selectall_arrayref(<<SQL);
SELECT
diff --git a/extensions/TrackingFlags/bin/bulk_flag_clear.pl b/extensions/TrackingFlags/bin/bulk_flag_clear.pl
index 1745018d5..305fbf883 100755
--- a/extensions/TrackingFlags/bin/bulk_flag_clear.pl
+++ b/extensions/TrackingFlags/bin/bulk_flag_clear.pl
@@ -110,7 +110,7 @@ if (!$config->{update_db}) {
# update bugs
-my $nobody = Bugzilla::User->check({ name => 'nobody@mozilla.org' });
+my $nobody = Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'} });
# put our nobody user into all groups to avoid permissions issues
$nobody->{groups} = [Bugzilla::Group->get_all];
Bugzilla->set_user($nobody);
diff --git a/heartbeat.cgi b/heartbeat.cgi
index 0597f1e3a..08cf13fa7 100755
--- a/heartbeat.cgi
+++ b/heartbeat.cgi
@@ -29,7 +29,7 @@ my $ok = eval {
die "database not available" unless $database_ok;
die "memcached server(s) not available" unless $memcached_ok;
- die "mod_perl not configured?" unless $ENV{MOD_PERL};
+ die "mod_perl/psgi not configured?" unless BZ_PERSISTENT;
1;
};
FATAL("heartbeat error: $@") if !$ok && $@;
diff --git a/mod_perl.pl b/mod_perl.pl
index 73406be56..c64352600 100644
--- a/mod_perl.pl
+++ b/mod_perl.pl
@@ -6,12 +6,15 @@
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
+
package Bugzilla::ModPerl;
use 5.10.1;
use strict;
use warnings;
+BEGIN { $main::BUGZILLA_PERSISTENT = 1 }
+
# This sets up our libpath without having to specify it in the mod_perl
# configuration.
use File::Basename;
@@ -173,7 +176,7 @@ sub handler : method {
DB::disable_profile();
DB::finish_profile();
}
- warn "[request_time] ", Bugzilla->cgi->request_uri, " took ", Time::HiRes::time() - $start, " seconds to execute";
+ #warn "[request_time] ", Bugzilla->cgi->request_uri, " took ", Time::HiRes::time() - $start, " seconds to execute";
# When returning data from the REST api we must only return 200 or 304,
# which tells Apache not to append its error html documents to the
diff --git a/scripts/eject-users-from-groups.pl b/scripts/eject-users-from-groups.pl
index 52e2bbbf3..4b27be83d 100755
--- a/scripts/eject-users-from-groups.pl
+++ b/scripts/eject-users-from-groups.pl
@@ -23,7 +23,7 @@ Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
my $dbh = Bugzilla->dbh;
my @remove_group_names;
-my $nobody_name = 'nobody@mozilla.org';
+my $nobody_name = Bugzilla->params->{'nobody_user'};
my $admin_name = 'automation@bmo.tld';
GetOptions(
diff --git a/scripts/entrypoint.pl b/scripts/entrypoint.pl
index ce1cc795b..e80fa193a 100755
--- a/scripts/entrypoint.pl
+++ b/scripts/entrypoint.pl
@@ -57,11 +57,6 @@ check_env(qw(
BMO_urlbase
));
-if ( $ENV{BMO_urlbase} eq 'AUTOMATIC' ) {
- $ENV{BMO_urlbase} = sprintf 'http://%s:%d/%s', hostname(), $ENV{PORT}, $ENV{BZ_QA_LEGACY_MODE} ? 'bmo/' : '';
- $ENV{BZ_BASE_URL} = sprintf 'http://%s:%d', hostname(), $ENV{PORT};
-}
-
$func->($opts->());
sub cmd_demo {
@@ -111,6 +106,11 @@ sub cmd_dev_httpd {
exit $httpd_exit_f->get;
}
+sub cmd_checksetup_gen_files {
+ my (@args) = @_;
+ run( 'perl', 'checksetup.pl', '--no-database', @args);
+}
+
sub cmd_checksetup {
check_data_dir();
wait_for_db();
@@ -141,7 +141,7 @@ sub cmd_test_webservices {
check_data_dir();
copy_qa_extension();
assert_database()->get;
- my $httpd_exit_f = run_cereal_and_httpd('-DHTTPD_IN_SUBDIR', '-DACCESS_LOGS');
+ my $httpd_exit_f = run_cereal_and_httpd('-DHTTPD_IN_SUBDIR');
my $prove_exit_f = run_prove(
httpd_url => $conf->{browser_url},
prove_cmd => [
@@ -195,7 +195,7 @@ sub cmd_test_bmo {
$ENV{BZ_TEST_NEWBIE2} = 'newbie2@mozilla.example';
$ENV{BZ_TEST_NEWBIE2_PASS} = 'captain.space.pants.time.lord';
- my $httpd_exit_f = run_cereal_and_httpd('-DACCESS_LOGS');
+ my $httpd_exit_f = run_cereal_and_httpd();
my $prove_exit_f = run_prove(
httpd_url => $ENV{BZ_BASE_URL},
prove_cmd => [ 'prove', '-I/app', '-I/app/local/lib/perl5', @prove_args ],
diff --git a/scripts/generate_bmo_data.pl b/scripts/generate_bmo_data.pl
index 6356762c8..8a9f72d17 100755
--- a/scripts/generate_bmo_data.pl
+++ b/scripts/generate_bmo_data.pl
@@ -158,7 +158,7 @@ $group->update();
my @users = (
{
- login => 'nobody@mozilla.org',
+ login => Bugzilla->params->{'nobody_user'},
realname => 'Nobody; OK to take it and work on it',
password => '*'
},
@@ -267,7 +267,7 @@ my @products = (
name => 'General',
description => 'For bugs in Firefox which do not fit into ' .
'other more specific Firefox components',
- initialowner => 'nobody@mozilla.org',
+ initialowner => Bugzilla->params->{'nobody_user'},
initialqaowner => '',
initial_cc => [],
watch_user => 'general@firefox.bugs'
@@ -287,7 +287,7 @@ my @products = (
name => 'General',
description => 'This is the component for issues specific to bugzilla.mozilla.org '
. 'that do not belong in other components.',
- initialowner => 'nobody@mozilla.org',
+ initialowner => Bugzilla->params->{'nobody_user'},
initialqaowner => '',
initial_cc => [],
watch_user => 'general@bugzilla.bugs'
diff --git a/scripts/move_os.pl b/scripts/move_os.pl
index 546b47c7e..963188261 100755
--- a/scripts/move_os.pl
+++ b/scripts/move_os.pl
@@ -40,7 +40,7 @@ my $dbh = Bugzilla->dbh;
my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
my $bug_ids = $dbh->selectcol_arrayref(q{SELECT bug_id FROM bugs WHERE bugs.op_sys = ?}, undef, $from_os);
my $field = Bugzilla::Field->check({ name => 'op_sys', cache => 1 });
-my $nobody = Bugzilla::User->check({ name => 'nobody@mozilla.org', cache => 1 });
+my $nobody = Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'}, cache => 1 });
my $bug_count = @$bug_ids;
if ($bug_count == 0) {
diff --git a/scripts/movebugs.pl b/scripts/movebugs.pl
index 2c643cdfb..55a43d943 100755
--- a/scripts/movebugs.pl
+++ b/scripts/movebugs.pl
@@ -73,10 +73,12 @@ my $component_field_id = $dbh->selectrow_array(
$component_field_id
or die "Can't find field ID for 'component' field\n";
+my $nobody = Bugzilla->params->{'nobody_user'};
my $user_id = $dbh->selectrow_array(
- "SELECT userid FROM profiles WHERE login_name='nobody\@mozilla.org'");
+ "SELECT userid FROM profiles WHERE login_name=?",
+ undef, $nobody);
$user_id
- or die "Can't find user ID for 'nobody\@mozilla.org'\n";
+ or die "Can't find user ID for '$nobody'\n";
$dbh->bz_start_transaction();
diff --git a/scripts/nagios_blocker_checker.pl b/scripts/nagios_blocker_checker.pl
index 0a9ec96b6..8c4277507 100755
--- a/scripts/nagios_blocker_checker.pl
+++ b/scripts/nagios_blocker_checker.pl
@@ -28,7 +28,7 @@ my $config = {
assignee => '',
product => '',
component => '',
- unassigned => 'nobody@mozilla.org',
+ unassigned => Bugzilla->params->{'nobody_user'},
# severities
severity => 'major,critical,blocker',
# time in hours to wait before paging/warning
diff --git a/scripts/remove_idle_group_members.pl b/scripts/remove_idle_group_members.pl
index 74e8658ff..e4ef88bc1 100755
--- a/scripts/remove_idle_group_members.pl
+++ b/scripts/remove_idle_group_members.pl
@@ -78,7 +78,7 @@ foreach my $group_id (keys %remove_data) {
$dbh->bz_commit_transaction();
# nobody@mozilla.org cannot recieve email
- next if $group->owner->login eq 'nobody@mozilla.org';
+ next if $group->owner->login eq Bugzilla->params->{'nobody_user'};
_send_email($group, \@users_removed);
}
diff --git a/scripts/reset_default_user.pl b/scripts/reset_default_user.pl
index d0d2534f2..942afda17 100755
--- a/scripts/reset_default_user.pl
+++ b/scripts/reset_default_user.pl
@@ -52,7 +52,7 @@ if (!$product || $help
}
# We will need these for entering into bugs_activity
-my $who = Bugzilla::User->new({ name => 'nobody@mozilla.org' });
+my $who = Bugzilla::User->new({ name => Bugzilla->params->{'nobody_user'} });
my $field = Bugzilla::Field->new({ name => $field_name });
trick_taint($product);
diff --git a/t/bmo/comments.t b/t/bmo/comments.t
index 4b0bb8177..00002040c 100644
--- a/t/bmo/comments.t
+++ b/t/bmo/comments.t
@@ -35,7 +35,7 @@ my $bug_1 = Bugzilla::Bug->create(
keywords => [],
cc => [],
comment => 'This is a brand new bug',
- assigned_to => 'nobody@mozilla.org',
+ assigned_to => Bugzilla->params->{'nobody_user'},
}
);
ok($bug_1->id, "got a new bug");
@@ -55,7 +55,7 @@ my $bug_2 = Bugzilla::Bug->create(
keywords => [],
cc => [],
comment => "This is related to ${urlbase}show_bug.cgi?id=$bug_1_id",
- assigned_to => 'nobody@mozilla.org',
+ assigned_to => Bugzilla->params->{'nobody_user'},
}
);
diff --git a/t/docker.t b/t/docker.t
index 3c8cd055b..c1f85088c 100644
--- a/t/docker.t
+++ b/t/docker.t
@@ -28,7 +28,7 @@ while (my $line = readline $dockerfile_fh) {
close $dockerfile_fh;
my ($image, $version) = split(/:/ms, $base, 2);
-is($image, 'mozillabteam/bmo-slim', "base image is mozillabteam/bmo-slim");
+is($image, 'bugzilla/harmony-slim', "base image is bugzilla/harmony-slim");
like($version, qr/\d{4}\d{2}\d{2}\.\d+/ms, "version is YYYYMMDD.x");
my $regex = qr{
@@ -49,4 +49,4 @@ while (my $line = readline $ci_config_fh) {
}
close $ci_config_fh;
-done_testing; \ No newline at end of file
+done_testing;
diff --git a/template/en/default/account/prefs/account.html.tmpl b/template/en/default/account/prefs/account.html.tmpl
index 1e7bc25db..61ce80011 100644
--- a/template/en/default/account/prefs/account.html.tmpl
+++ b/template/en/default/account/prefs/account.html.tmpl
@@ -138,7 +138,7 @@
<td></td>
<td>
<p>
- Your contributions on bugzilla.mozilla.org will still be visible;
+ Your contributions on [% terms.Bugzilla %] will still be visible;
however, your email address and name will be removed in most locations.
We are not able to remove your details that are part of comment text.
</p>
diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl
index 329e0ab49..7006448d3 100644
--- a/template/en/default/attachment/create.html.tmpl
+++ b/template/en/default/attachment/create.html.tmpl
@@ -83,14 +83,14 @@ TUI_hide_default('attachment_text_field');
<td>
<em>If you want to assign this [% terms.bug %] to yourself,
check the box below.</em><br>
- [% IF bug.assigned_to.login == "nobody@mozilla.org" || bug.assigned_to.login.search('.bugs$') %]
+ [% IF bug.assigned_to.login == Param('nobody_user') || bug.assigned_to.login.search('.bugs$') %]
[% take_if_patch = 1 %]
[% END %]
<input type="checkbox" id="takebug" name="takebug" value="1" [% IF take_if_patch %] data-take-if-patch="1" [% END %]>
<label for="takebug">take [% terms.bug %]</label>
[% bug_statuses = [] %]
[% FOREACH bug_status = bug.status.can_change_to %]
- [% NEXT IF bug_status.name == "UNCONFIRMED"
+ [% NEXT IF bug_status.name == "UNCONFIRMED"
&& !bug.product_obj.allows_unconfirmed %]
[% bug_statuses.push(bug_status) IF bug_status.is_open %]
[% END %]
diff --git a/template/en/default/bug/create/user-message.html.tmpl b/template/en/default/bug/create/user-message.html.tmpl
index fa42ace81..51e787870 100644
--- a/template/en/default/bug/create/user-message.html.tmpl
+++ b/template/en/default/bug/create/user-message.html.tmpl
@@ -30,7 +30,7 @@
[% PROCESS global/variables.none.tmpl %]
Before reporting [% terms.abug %], please read the
-<a href="https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines">
+<a href="[% terms.BugWritingGuidelinesURL %]">
[% terms.bug %] writing guidelines</a>, please look at the list of
<a href="duplicates.cgi">most frequently reported [% terms.bugs %]</a>, and please
<a href="query.cgi">search</a> for the [% terms.bug %].
diff --git a/template/en/default/bug/new_bug.html.tmpl b/template/en/default/bug/new_bug.html.tmpl
index ef5e361c0..9e0b2c1ab 100644
--- a/template/en/default/bug/new_bug.html.tmpl
+++ b/template/en/default/bug/new_bug.html.tmpl
@@ -27,10 +27,10 @@
<h2>Create New [% terms.Bug %]</h2>
<p>
Before reporting a [% terms.bug %], make sure you've read our
- <a href="https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines">
+ <a href="[% terms.BugWritingGuidelinesURL %]">
[% terms.bug %] writing guidelines</a> and double checked that your [% terms.bug %] hasn't already
- been reported. Consult our list of <a href="https://bugzilla.mozilla.org/duplicates.cgi">
- most frequently reported [% terms.bugs %]</a> and <a href="https://bugzilla.mozilla.org/query.cgi">
+ been reported. Consult our list of <a href="duplicates.cgi">
+ most frequently reported [% terms.bugs %]</a> and <a href="query.cgi">
search through descriptions</a> of previously reported [% terms.bugs %].
</p>
</div>
diff --git a/template/en/default/global/variables.none.tmpl b/template/en/default/global/variables.none.tmpl
index faf1a5427..93002efa3 100644
--- a/template/en/default/global/variables.none.tmpl
+++ b/template/en/default/global/variables.none.tmpl
@@ -37,7 +37,9 @@
"bugs" => "bugs",
"Bugs" => "Bugs",
"zeroSearchResults" => "Zarro Boogs found",
- "Bugzilla" => "Bugzilla"
+ "Bugzilla" => "Bugzilla",
+
+ "BugWritingGuidelinesURL" => "https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines",
}
%]
diff --git a/template/en/default/index.html.tmpl b/template/en/default/index.html.tmpl
index 97659e6a8..177025686 100644
--- a/template/en/default/index.html.tmpl
+++ b/template/en/default/index.html.tmpl
@@ -75,7 +75,7 @@
<a href="page.cgi?id=etiquette.html">[%- terms.Bugzilla %] Etiquette</a>
</li>
<li>
- | <a href="https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines">[%- terms.Bug %] Writing Guidelines</a>
+ | <a href="[% terms.BugWritingGuidelinesURL %]">[%- terms.Bug %] Writing Guidelines</a>
</li>
[% Hook.process('additional_links') %]
</ul>
diff --git a/template/en/default/list/edit-multiple.html.tmpl b/template/en/default/list/edit-multiple.html.tmpl
index eb989d15c..ead3ff54c 100644
--- a/template/en/default/list/edit-multiple.html.tmpl
+++ b/template/en/default/list/edit-multiple.html.tmpl
@@ -437,7 +437,6 @@
[% FOREACH r = resolutions %]
[% NEXT IF !r %]
[% NEXT IF r == "DUPLICATE" || r == "MOVED" %]
- [% NEXT IF r == "EXPIRED" AND user.login != "gerv@mozilla.org" %]
<option value="[% r FILTER html %]">[% display_value("resolution", r) FILTER html %]</option>
[% END %]
</select>
diff --git a/token.cgi b/token.cgi
index 51ed93977..990040050 100755
--- a/token.cgi
+++ b/token.cgi
@@ -23,7 +23,7 @@ use Date::Format;
use Date::Parse;
use JSON qw( decode_json );
-my $dbh = Bugzilla->dbh;
+local our $dbh = Bugzilla->dbh;
local our $cgi = Bugzilla->cgi;
local our $template = Bugzilla->template;
local our $vars = {};
diff --git a/userprefs.cgi b/userprefs.cgi
index e70b9780a..830c49eed 100755
--- a/userprefs.cgi
+++ b/userprefs.cgi
@@ -29,7 +29,7 @@ use DateTime;
use constant SESSION_MAX => 20;
-my $template = Bugzilla->template;
+local our $template = Bugzilla->template;
local our $vars = {};
###############################################################################
diff --git a/votes.cgi b/votes.cgi
index d9dba1541..7c1fff67a 100755
--- a/votes.cgi
+++ b/votes.cgi
@@ -30,8 +30,7 @@ use lib qw(. lib local/lib/perl5);
use Bugzilla;
use Bugzilla::Error;
-my $is_enabled = grep { $_->NAME eq 'Voting' } @{ Bugzilla->extensions };
-$is_enabled || ThrowCodeError('extension_disabled', { name => 'Voting' });
+Bugzilla->has_extension('Voting') || ThrowCodeError('extension_disabled', { name => 'Voting' });
my $cgi = Bugzilla->cgi;
my $action = $cgi->param('action') || 'show_user';