summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-04-01 16:52:36 +0200
committerDylan William Hardison <dylan@hardison.net>2018-04-01 16:52:36 +0200
commitab229b9a828b77f8a3b9ce215f0dfed4c84d4ae5 (patch)
tree483da9c8b66f4444bb8a410e3d599c7484ad721e /extensions
parentdaa2d6b1c40354ecce0e48e6c5ee686efe642c4b (diff)
parent2f8b999750cc700faf03c6aee1c53d1fc4df767f (diff)
downloadbugzilla-ab229b9a828b77f8a3b9ce215f0dfed4c84d4ae5.tar.gz
bugzilla-ab229b9a828b77f8a3b9ce215f0dfed4c84d4ae5.tar.xz
Merge branch 'master' into unstable
Diffstat (limited to 'extensions')
-rw-r--r--extensions/BMO/template/en/default/bug/create/comment-ipc.txt.tmpl47
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-ipc.html.tmpl259
-rw-r--r--extensions/BMO/template/en/default/pages/user_activity.html.tmpl1
-rw-r--r--extensions/BMO/web/images/ipc_form_buildscreen.pngbin102103 -> 0 bytes
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl2
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/navigate.html.tmpl4
-rw-r--r--extensions/InlineHistory/template/en/default/hook/bug/comments-aftercomments.html.tmpl1
-rw-r--r--extensions/OpenGraph/template/en/default/hook/global/header-start.html.tmpl7
-rw-r--r--extensions/PhabBugz/Extension.pm1
-rw-r--r--extensions/PhabBugz/lib/Daemon.pm5
-rw-r--r--extensions/PhabBugz/lib/Feed.pm98
-rw-r--r--extensions/PhabBugz/lib/Logger.pm37
-rw-r--r--extensions/PhabBugz/lib/Revision.pm2
-rw-r--r--extensions/PhabBugz/lib/Util.pm12
-rw-r--r--extensions/Push/lib/Logger.pm52
-rw-r--r--extensions/Review/Extension.pm2
-rw-r--r--extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl2
17 files changed, 98 insertions, 434 deletions
diff --git a/extensions/BMO/template/en/default/bug/create/comment-ipc.txt.tmpl b/extensions/BMO/template/en/default/bug/create/comment-ipc.txt.tmpl
deleted file mode 100644
index b644ee469..000000000
--- a/extensions/BMO/template/en/default/bug/create/comment-ipc.txt.tmpl
+++ /dev/null
@@ -1,47 +0,0 @@
-[%# 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 Bugzilla %]
-[% cgi = Bugzilla.cgi %]
-
->> What team are you are a part of?
-[%+ cgi.param("team_name") %]
-
->> Will your snippet need to appear in a language other than English?
-[%+ cgi.param("language").join(', ') %]
-
->> Does your snippet need to be targeted to a particular country?
-[%+ cgi.param("target_country") %]
-
->> Insert your tagged link here.
-[%+ cgi.param("tagged_link") %]
-
-[% IF cgi.param('start_run') %]
->> When would you like your snippet to start its run?
-[%+ cgi.param("start_run") %]
-
-[% END %]
-[% IF cgi.param('complete_run') %]
->> When would you like your snippet to complete its run?
-[%+ cgi.param("complete_run") %]
-
-[% END %]
->> Will you be able to provide the following assets for your snippet?
-[%+ cgi.param("snippet_assets").join(', ') %]
-
->> Your name?
-[%+ cgi.param("name") %]
-
->> E-mail?
-[%+ cgi.param("email") %]
-
->> Anything else you would like to add?
-[%+ cgi.param("else") %]
-
->> Who do you think is coolest?
-[%+ cgi.param("bonus") %]
diff --git a/extensions/BMO/template/en/default/bug/create/create-ipc.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-ipc.html.tmpl
deleted file mode 100644
index e32ba62dc..000000000
--- a/extensions/BMO/template/en/default/bug/create/create-ipc.html.tmpl
+++ /dev/null
@@ -1,259 +0,0 @@
-[%# 1.0@bugzilla.org %]
-[%# The contents of this file are subject to the Mozilla Public
- # License Version 1.1 (the "License"); you may not use this file
- # except in compliance with the License. You may obtain a copy of
- # the License at http://www.mozilla.org/MPL/
-
- #
- # Software distributed under the License is distributed on an "AS
- # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- # implied. See the License for the specific language governing
- # rights and limitations under the License.
- #
- # The Original Code is the Bugzilla Bug Tracking System.
- #
- # The Initial Developer of the Original Code is Mozilla Corporation.
- # Portions created by Mozilla are Copyright (C) 2008 Mozilla
- # Corporation. All Rights Reserved.
- #
- # Contributor(s): Sebastin Santy <sebastinssanty@gmail.com>
- #%]
-
-[% PROCESS global/variables.none.tmpl %]
-
-[% inline_style = BLOCK %]
-#heading {
- width: 98%;
- font-size: 2em;
- font-weight: bold;
- margin: 12px;
-}
-.required:before {
- content: "* ";
- color: red;
-}
-.required_star {
- color: red;
-}
-p {
- max-width: 40%;
-}
-.row {
- padding-bottom: 10px;
-}
-[% END %]
-
-[% inline_javascript = BLOCK %]
-$(document).ready(function() {
- $('.date_field').datetimepicker({
- format: 'Y-m-d',
- datepicker: true,
- timepicker: false,
- scrollInput: false,
- lazyInit: false,
- closeOnDateSelect: true
- });
- $('#langothers').on('focus', function(){
- document.getElementById("langothersradio").checked = true;
- });
- $('#assetothers').on('focus', function(){
- document.getElementById("assetothersradio").checked = true;
- });
- $('.date_field-img')
- .click(function(event) {
- var id = $(event.target).attr('id').replace(/-img$/, '');
- $('#' + id).datetimepicker('show');
- });
- $('#ipcForm').submit(function() {
- $('#short_desc').val($('#short_desc').val() + ': ' + $('#team_name').val());
- });
- $('#new_email_request').on('change', function() {
- if ($('#new_email_request').val() == 'Yes') {
- $('#email_cadence_row').show();
- $('input[name="email_cadence"]').each(function() {
- $(this).attr('required', true);
- });
- }
- else {
- $('#email_cadence_row').hide();
- $('input[name="email_cadence"]').each(function() {
- $(this).removeProp('required');
- });
- }
- });
-});
-[% END %]
-
-[% PROCESS global/header.html.tmpl
- title = "IPC Request"
- generate_api_token = 1
- style_urls = [ "skins/standard/attachment.css",
- "js/jquery/plugins/datetimepicker/datetimepicker.css" ]
- style = inline_style
- javascript = inline_javascript
- javascript_urls = [ "js/field.js", "js/util.js" ]
- jquery = [ "datetimepicker" ]
-%]
-
-<div id="heading">IPC Requests</div>
-<div>
- <p>You’ve decided to use the snippet channel to drive attention to one of your projects, awesome! The snippet channel drives hundreds of millions of impressions a month. It’s great tool to support your marketing efforts. Complete this form and we will follow up with you soon (maybe today, but definitely within 3 days).
- </p>
- <p>
- Tell us more:
- </p>
-
- <form method="post" action="post_bug.cgi" id="ipcForm">
- <input type="hidden" id="short_desc" name="short_desc" value="New IPC Request">
- <input type="hidden" name="product" value="Marketing">
- <input type="hidden" name="component" value="IPC">
- <input type="hidden" name="rep_platform" value="All">
- <input type="hidden" name="op_sys" value="Other">
- <input type="hidden" name="version" value="unspecified">
- <input type="hidden" name="priority" value="--">
- <input type="hidden" name="bug_severity" value="normal">
- <input type="hidden" name="format" value="ipc">
- <input type="hidden" name="token" value="[% token FILTER html %]">
- [% IF user.in_group('canconfirm') %]
- <input type="hidden" name="bug_status" value="NEW">
- [% END %]
-
- <div class="row">
- <div class="row_desc">
- <label class="required" for="team_name">
- <strong>What team are you a part of?</strong>
- </label>
- </div>
- <input required type="text" name="team_name" id="team_name" size="80">
- </div>
-
- <div class="row">
- <div class="row_desc">
- <label for="cf_user_story">
- <strong>What is the user story associated with your snippet?</strong>
- </label>
- </div>
- <textarea name="cf_user_story" id="cf_user_story" cols="80" rows="10"></textarea>
- </div>
-
- <div class="row">
- <div class="row_desc">
- <strong>Will your snippet need to appear in a language other than English? If so, please specify.</strong>
- </div>
- <input type="checkbox" name="language" id="spanish" value="Spanish">
- <label for="spanish">Spanish</label><br>
- <input type="checkbox" name="language" id="italian" value="Italian">
- <label for="italian">Italian</label><br>
- <input type="checkbox" name="language" id="german" value="German">
- <label for="german">German</label><br>
- <input type="checkbox" name="language" id="french" value="French">
- <label for="french">French</label><br>
- <input type="checkbox" name="language" id="russian" value="Russian">
- <label for="russian">Russian</label><br>
- <input type="checkbox" name="language" id="portuguese" value="Portuguese">
- <label for="portuguese">Portuguese</label><br>
- <input type="checkbox" name="language" id="langothersradio">
- <label for="langothers">Others: </label>
- <input type="text" name="language" id="langothers" size="30">
- </div>
-
- <div class="row">
- <div class="row_desc">
- <label for="target_country">
- <strong>Does your snippet need to be targeted to a particular country? If so, please specify.</strong>
- </label>
- </div>
- <input type="text" name="target_country" id="target_country" size="80">
- </div>
-
- <p>
- If you would like your snippet to include a link, please tag it by using the URL builder <a href="https://bit.ly/1JOgDr1">(https://bit.ly/1JOgDr1)</a> and following the steps below:
- </p>
- <img src="extensions/BMO/web/images/ipc_form_buildscreen.png" style = "width:50%"><br><br>
- <div class="row">
- <div class="row_desc">
- <label for="tagged_link">
- <strong>Insert your tagged link here.</strong>
- </label>
- </div>
- <input type="text" name="tagged_link" id="tagged_link" size="80">
- </div>
-
- <p>
- Please reference the Mozilla In-Product Messaging Calendar for available dates. <a href="https://bit.ly/2aZ3w9c"> https://bit.ly/2aZ3w9c</a>
- </p>
-
- <div class="row">
- <div class="row_desc">
- <label for="start_run">
- <strong>When would you like your snippet to start its run?</strong>
- </label>
- </div>
- <input class="date_field" name="start_run" id="start_run">
- <img class="date_field-img" id="start_run-img" src="extensions/BugModal/web/calendar.png" width="16" height="16">
- </div>
-
- <div class="row">
- <div class="row_desc">
- <label for="complete_run">
- <strong>When would you like your snippet to complete its run?</strong>
- </label>
- </div>
- <input class="date_field" name="complete_run" id="complete_run">
- <img class="date_field-img" id="complete_run-img" src="extensions/BugModal/web/calendar.png" width="16" height="16">
- </div>
-
- <div class="row">
- <div class="row_desc">
- <strong>Will you be able to provide the following assets for your snippet? Check all that apply.</strong><br>
- Feel free to look at our existing icon library:
- <a href="https://bit.ly/2efXaFo">https://bit.ly/2efXaFo</a>
- </div>
- <input type="checkbox" name="snippet_assets" id="copy" value="Copy">
- <label for="copy">Copy</label><br>
- <input type="checkbox" name="snippet_assets" id="icon" value="Icon">
- <label for="icon">Icon</label><br>
- <input type="checkbox" name="snippet_assets" id="special_format" value="Special Format">
- <label for="special_format">Special Format</label><br>
- <input type="checkbox" name="snippet_assets" id="assetothersradio">
- <label for="assetothers">Others: </label>
- <input type="text" name="snippet_assets" id="assetothers" size="30">
- </div>
-
- <input type="hidden" required name="name" id="name" value="[% user.name FILTER html %]" size="80">
-
- <input type="hidden" required name="email" id="email" value="[% user.email FILTER html %]" size="80">
-
- <div class="row">
- <div class="row_desc">
- <label for="else">
- <strong>Anything else you would like to add?</strong><br>
- </label>
- </div>
- <textarea name="else" id="else" cols="80" rows="10"></textarea>
- </div>
- <h3><strong>Bonus Question</strong></h3>
- <div class="row">
- <div class="row_desc">
- <strong>Who do you think is coolest?</strong>
- </div>
- <input type="radio" name="bonus" id="han_solo" value="Hans Solo">
- <label for="han_solo">Han Solo</label><br>
- <input type="radio" name="bonus" id="hermoine_granger" value="Hermoine Granger">
- <label for="hermoine_granger">Hermione Granger</label><br>
- <input type="radio" name="bonus" id="picard" value="Captain Jean-Luc Picard">
- <label for="picard">Captain Jean-Luc Picard</label><br>
- <input type="radio" name="bonus" id="everdeen" value="Katniss Everdeen">
- <label for="everdeen">Katniss Everdeen</label><br>
- </div>
-
- <p>Thanks for reaching out. Click submit and we will be back with you shortly.</p>
-
- <input type="submit" id="commit" value="Submit Request">
- <p>
- [ <span class="required_star">*</span> <span class="required_explanation">Required Field</span> ]
- </p>
- </form>
-</div>
-
-[% PROCESS global/footer.html.tmpl %] \ No newline at end of file
diff --git a/extensions/BMO/template/en/default/pages/user_activity.html.tmpl b/extensions/BMO/template/en/default/pages/user_activity.html.tmpl
index 075c8edf9..5603b943f 100644
--- a/extensions/BMO/template/en/default/pages/user_activity.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/user_activity.html.tmpl
@@ -199,6 +199,7 @@
change.fieldname == 'reporter' ||
change.fieldname == 'qa_contact' ||
change.fieldname == 'cc' ||
+ change.fieldname == 'bug_mentor' ||
change.fieldname == 'flagtypes.name' %]
[% display_value(change.fieldname, change_type) FILTER email FILTER html %]
[% ELSE %]
diff --git a/extensions/BMO/web/images/ipc_form_buildscreen.png b/extensions/BMO/web/images/ipc_form_buildscreen.png
deleted file mode 100644
index d98207d29..000000000
--- a/extensions/BMO/web/images/ipc_form_buildscreen.png
+++ /dev/null
Binary files differ
diff --git a/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl
index a8d55c137..51919ab27 100644
--- a/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl
@@ -365,7 +365,7 @@
", " UNLESS loop.last;
END;
- CASE [ 'assigned_to', 'reporter', 'qa_contact', 'cc', 'flagtypes.name' ];
+ CASE [ 'assigned_to', 'reporter', 'qa_contact', 'cc', 'bug_mentor', 'flagtypes.name' ];
value FILTER email;
CASE 'reporter_accessible';
diff --git a/extensions/BugModal/template/en/default/bug_modal/navigate.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/navigate.html.tmpl
index 05476fed4..06163a841 100644
--- a/extensions/BugModal/template/en/default/bug_modal/navigate.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/navigate.html.tmpl
@@ -29,14 +29,14 @@
[% INCLUDE nav_link text="Next &#10097;" bug_id="" %]
[% END %]
[% INCLUDE nav_link text="Last &#10097;&#10097;" bug_id=last_bug_list.last %]
- <a id="search-nav-reget" href="buglist.cgi?regetlastlist=[% my_search.id FILTER uri %]">Last search results</a>
+ <a id="search-nav-reget" href="buglist.cgi?regetlastlist=[% search.id FILTER uri %]">Last search results</a>
</div>
[% BLOCK nav_link %]
[% IF bug_id == "" %]
<span class="search-nav-disabled">[% text FILTER none %]</span>
[% ELSE %]
- <a class="search-nav-link" href="show_bug.cgi?id=[% bug_id FILTER uri %]&amp;list_id=[% my_search.id FILTER uri %]">
+ <a class="search-nav-link" href="show_bug.cgi?id=[% bug_id FILTER uri %]&amp;list_id=[% search.id FILTER uri %]">
[%~ text FILTER none ~%]
</a>
[% END %]
diff --git a/extensions/InlineHistory/template/en/default/hook/bug/comments-aftercomments.html.tmpl b/extensions/InlineHistory/template/en/default/hook/bug/comments-aftercomments.html.tmpl
index d0a3abb5b..32e6499cb 100644
--- a/extensions/InlineHistory/template/en/default/hook/bug/comments-aftercomments.html.tmpl
+++ b/extensions/InlineHistory/template/en/default/hook/bug/comments-aftercomments.html.tmpl
@@ -155,6 +155,7 @@
change.fieldname == 'reporter' ||
change.fieldname == 'qa_contact' ||
change.fieldname == 'cc' ||
+ change.fieldname == 'bug_mentor' ||
change.fieldname == 'flagtypes.name' %]
[% value FILTER email FILTER js %]
[% ELSIF change.fieldtype == constants.FIELD_TYPE_DATETIME %]
diff --git a/extensions/OpenGraph/template/en/default/hook/global/header-start.html.tmpl b/extensions/OpenGraph/template/en/default/hook/global/header-start.html.tmpl
index 9b8e0e0cc..2d7c3379f 100644
--- a/extensions/OpenGraph/template/en/default/hook/global/header-start.html.tmpl
+++ b/extensions/OpenGraph/template/en/default/hook/global/header-start.html.tmpl
@@ -8,6 +8,11 @@
[% USE Bugzilla %]
<meta property="og:type" content="website">
-<meta property="og:image" content="[% urlbase FILTER none %]extensions/OpenGraph/web/moz-social-bw-rgb-1200x1200.png">
<meta property="og:title" content="[% title FILTER none %]">
<meta property="og:url" content="[% Bugzilla.cgi.self_url FILTER html %]">
+[% IF bug %]
+<meta property="og:description"
+ content="[% bug.bug_status FILTER html %] ([% bug.assigned_to.login FILTER email FILTER html %]) in [% bug.product FILTER html %] - [% bug.component FILTER html %]. Last updated [% bug.delta_ts FILTER time('%Y-%m-%d') %].">
+[% ELSE %]
+<meta property="og:image" content="[% urlbase FILTER none %]extensions/OpenGraph/web/moz-social-bw-rgb-1200x1200.png">
+[% END %]
diff --git a/extensions/PhabBugz/Extension.pm b/extensions/PhabBugz/Extension.pm
index b3ad44819..ee96901a2 100644
--- a/extensions/PhabBugz/Extension.pm
+++ b/extensions/PhabBugz/Extension.pm
@@ -15,7 +15,6 @@ use parent qw(Bugzilla::Extension);
use Bugzilla::Constants;
use Bugzilla::Extension::PhabBugz::Feed;
-use Bugzilla::Extension::PhabBugz::Logger;
our $VERSION = '0.01';
diff --git a/extensions/PhabBugz/lib/Daemon.pm b/extensions/PhabBugz/lib/Daemon.pm
index c8b4f73af..ef4a00534 100644
--- a/extensions/PhabBugz/lib/Daemon.pm
+++ b/extensions/PhabBugz/lib/Daemon.pm
@@ -13,7 +13,6 @@ use warnings;
use Bugzilla::Constants;
use Bugzilla::Extension::PhabBugz::Feed;
-use Bugzilla::Extension::PhabBugz::Logger;
use Carp qw(confess);
use Daemon::Generic;
@@ -89,11 +88,9 @@ sub gd_setup_signals {
sub gd_run {
my $self = shift;
- $::SIG{__DIE__} = \&Carp::confess if $self->{debug};
+ $SIG{__DIE__} = \&Carp::confess if $self->{debug};
my $phabbugz = Bugzilla::Extension::PhabBugz::Feed->new();
$phabbugz->is_daemon(1);
- $phabbugz->logger(
- Bugzilla::Extension::PhabBugz::Logger->new(debugging => $self->{debug}));
$phabbugz->start();
}
diff --git a/extensions/PhabBugz/lib/Feed.pm b/extensions/PhabBugz/lib/Feed.pm
index 9904d5090..074ecc0f9 100644
--- a/extensions/PhabBugz/lib/Feed.pm
+++ b/extensions/PhabBugz/lib/Feed.pm
@@ -13,6 +13,7 @@ use List::Util qw(first);
use List::MoreUtils qw(any);
use Moo;
+use Bugzilla::Logging;
use Bugzilla::Constants;
use Bugzilla::Search;
use Bugzilla::Util qw(diff_arrays with_writable_database with_readonly_database);
@@ -36,7 +37,6 @@ use Bugzilla::Extension::PhabBugz::Util qw(
);
has 'is_daemon' => ( is => 'rw', default => 0 );
-has 'logger' => ( is => 'rw' );
sub start {
my ($self) = @_;
@@ -48,7 +48,7 @@ sub start {
}
1;
};
- $self->logger->error( $@ // "unknown exception" ) unless $ok;
+ ERROR( $@ // "unknown exception" ) unless $ok;
sleep(PHAB_POLL_SECONDS);
}
}
@@ -59,19 +59,19 @@ sub feed_query {
# Ensure Phabricator syncing is enabled
if (!Bugzilla->params->{phabricator_enabled}) {
- $self->logger->info("PHABRICATOR SYNC DISABLED");
+ INFO("PHABRICATOR SYNC DISABLED");
return;
}
# PROCESS NEW FEED TRANSACTIONS
- $self->logger->info("FEED: Fetching new transactions");
+ INFO("FEED: Fetching new transactions");
my $story_last_id = $self->get_last_id('feed');
# Check for new transctions (stories)
my $new_stories = $self->new_stories($story_last_id);
- $self->logger->info("FEED: No new stories") unless @$new_stories;
+ INFO("FEED: No new stories") unless @$new_stories;
# Process each story
foreach my $story_data (@$new_stories) {
@@ -81,15 +81,15 @@ sub feed_query {
my $object_phid = $story_data->{objectPHID};
my $story_text = $story_data->{text};
- $self->logger->debug("STORY ID: $story_id");
- $self->logger->debug("STORY PHID: $story_phid");
- $self->logger->debug("AUTHOR PHID: $author_phid");
- $self->logger->debug("OBJECT PHID: $object_phid");
- $self->logger->info("STORY TEXT: $story_text");
+ DEBUG("STORY ID: $story_id");
+ DEBUG("STORY PHID: $story_phid");
+ DEBUG("AUTHOR PHID: $author_phid");
+ DEBUG("OBJECT PHID: $object_phid");
+ INFO("STORY TEXT: $story_text");
# Only interested in changes to revisions for now.
if ($object_phid !~ /^PHID-DREV/) {
- $self->logger->debug("SKIPPING: Not a revision change");
+ DEBUG("SKIPPING: Not a revision change");
$self->save_last_id($story_id, 'feed');
next;
}
@@ -99,7 +99,7 @@ sub feed_query {
if (@$phab_users) {
my $user = Bugzilla::User->new({ id => $phab_users->[0]->{id}, cache => 1 });
if ($user->login eq PHAB_AUTOMATION_USER) {
- $self->logger->debug("SKIPPING: Change made by phabricator user");
+ DEBUG("SKIPPING: Change made by phabricator user");
$self->save_last_id($story_id, 'feed');
next;
}
@@ -113,13 +113,13 @@ sub feed_query {
# PROCESS NEW USERS
- $self->logger->info("FEED: Fetching new users");
+ INFO("FEED: Fetching new users");
my $user_last_id = $self->get_last_id('user');
# Check for new users
my $new_users = $self->new_users($user_last_id);
- $self->logger->info("FEED: No new users") unless @$new_users;
+ INFO("FEED: No new users") unless @$new_users;
# Process each new user
foreach my $user_data (@$new_users) {
@@ -128,10 +128,10 @@ sub feed_query {
my $user_realname = $user_data->{fields}{realName};
my $object_phid = $user_data->{phid};
- $self->logger->debug("USER ID: $user_id");
- $self->logger->debug("USER LOGIN: $user_login");
- $self->logger->debug("USER REALNAME: $user_realname");
- $self->logger->debug("OBJECT PHID: $object_phid");
+ DEBUG("USER ID: $user_id");
+ DEBUG("USER LOGIN: $user_login");
+ DEBUG("USER REALNAME: $user_realname");
+ DEBUG("OBJECT PHID: $object_phid");
with_readonly_database {
$self->process_new_user($user_data);
@@ -151,15 +151,15 @@ sub process_revision_change {
if (!$revision->bug_id) {
if ($story_text =~ /\s+created\s+D\d+/) {
# If new revision and bug id was omitted, make revision public
- $self->logger->debug("No bug associated with new revision. Marking public.");
+ DEBUG("No bug associated with new revision. Marking public.");
$revision->set_policy('view', 'public');
$revision->set_policy('edit', 'users');
$revision->update();
- $self->logger->info("SUCCESS");
+ INFO("SUCCESS");
return;
}
else {
- $self->logger->debug("SKIPPING: No bug associated with revision change");
+ DEBUG("SKIPPING: No bug associated with revision change");
return;
}
}
@@ -170,7 +170,7 @@ sub process_revision_change {
$revision->title,
$revision->bug_id,
$story_text);
- $self->logger->info($log_message);
+ INFO($log_message);
# Pre setup before making changes
my $old_user = set_phab_user();
@@ -180,7 +180,7 @@ sub process_revision_change {
# If bug is public then remove privacy policy
if (!@{ $bug->groups_in }) {
- $self->logger->debug('Bug is public so setting view/edit public');
+ DEBUG('Bug is public so setting view/edit public');
$revision->set_policy('view', 'public');
$revision->set_policy('edit', 'users');
my $secure_project_phid = get_project_phid('secure-revision');
@@ -193,7 +193,7 @@ sub process_revision_change {
# If bug privacy groups do not have any matching synchronized groups,
# then leave revision private and it will have be dealt with manually.
if (!@set_groups) {
- $self->logger->debug('No matching groups. Adding comments to bug and revision');
+ DEBUG('No matching groups. Adding comments to bug and revision');
add_security_sync_comments([$revision], $bug);
}
# Otherwise, we create a new custom policy containing the project
@@ -205,23 +205,23 @@ sub process_revision_change {
# we leave the current policy alone.
my $current_policy;
if ($revision->view_policy =~ /^PHID-PLCY/) {
- $self->logger->debug("Loading current policy: " . $revision->view_policy);
+ DEBUG("Loading current policy: " . $revision->view_policy);
$current_policy
= Bugzilla::Extension::PhabBugz::Policy->new_from_query({ phids => [ $revision->view_policy ]});
my $current_projects = $current_policy->rule_projects;
- $self->logger->debug("Current policy projects: " . join(", ", @$current_projects));
+ DEBUG("Current policy projects: " . join(", ", @$current_projects));
my ($added, $removed) = diff_arrays($current_projects, \@set_projects);
if (@$added || @$removed) {
- $self->logger->debug('Project groups do not match. Need new custom policy');
+ DEBUG('Project groups do not match. Need new custom policy');
$current_policy= undef;
}
else {
- $self->logger->debug('Project groups match. Leaving current policy as-is');
+ DEBUG('Project groups match. Leaving current policy as-is');
}
}
if (!$current_policy) {
- $self->logger->debug("Creating new custom policy: " . join(", ", @set_projects));
+ DEBUG("Creating new custom policy: " . join(", ", @set_projects));
my $new_policy = Bugzilla::Extension::PhabBugz::Policy->create(\@set_projects);
$revision->set_policy('view', $new_policy->phid);
$revision->set_policy('edit', $new_policy->phid);
@@ -229,15 +229,17 @@ sub process_revision_change {
my $secure_project_phid = get_project_phid('secure-revision');
$revision->add_project($secure_project_phid);
-
- my $subscribers = get_bug_role_phids($bug);
- $revision->set_subscribers($subscribers);
}
+
+ # Subscriber list of the private revision should always match
+ # the bug roles such as assignee, qa contact, and cc members.
+ my $subscribers = get_bug_role_phids($bug);
+ $revision->set_subscribers($subscribers);
}
my ($timestamp) = Bugzilla->dbh->selectrow_array("SELECT NOW()");
- my $attachment = create_revision_attachment($bug, $revision->id, $revision->title, $timestamp);
+ my $attachment = create_revision_attachment($bug, $revision, $timestamp);
# ATTACHMENT OBSOLETES
@@ -250,11 +252,11 @@ sub process_revision_change {
next if $attach_revision_id != $revision->id;
my $make_obsolete = $revision->status eq 'abandoned' ? 1 : 0;
- $self->logger->debug('Updating obsolete status on attachmment ' . $attachment->id);
+ DEBUG('Updating obsolete status on attachmment ' . $attachment->id);
$attachment->set_is_obsolete($make_obsolete);
if ($revision->title ne $attachment->description) {
- $self->logger->debug('Updating description on attachment ' . $attachment->id);
+ DEBUG('Updating description on attachment ' . $attachment->id);
$attachment->set_description($revision->title);
}
@@ -270,7 +272,7 @@ sub process_revision_change {
});
foreach my $attachment (@$other_attachments) {
$other_bugs{$attachment->bug_id}++;
- $self->logger->debug('Updating obsolete status on attachment ' .
+ DEBUG('Updating obsolete status on attachment ' .
$attachment->id . " for bug " . $attachment->bug_id);
$attachment->set_is_obsolete(1);
$attachment->update($timestamp);
@@ -291,6 +293,8 @@ sub process_revision_change {
$phab_users = get_phab_bmo_ids({ phids => \@denied_phids });
@denied_user_ids = map { $_->{id} } @$phab_users;
+ my %reviewers_hash = map { $_->name => 1 } @{ $revision->reviewers };
+
foreach my $attachment (@attachments) {
my ($attach_revision_id) = ($attachment->filename =~ PHAB_ATTACHMENT_PATTERN);
next if $revision->id != $attach_revision_id;
@@ -331,7 +335,11 @@ sub process_revision_change {
$comment .= $flag_data->{setter}->name . " has requested changes to the revision.\n";
}
foreach my $flag_data (@removed_flags) {
- $comment .= $flag_data->{setter}->name . " has been removed from the revision.\n";
+ if ( exists $reviewers_hash{$flag_data->{setter}->name} ) {
+ $comment .= "Flag set by " . $flag_data->{setter}->name . " is no longer active.\n";
+ } else {
+ $comment .= $flag_data->{setter}->name . " has been removed from the revision.\n";
+ }
}
if ($comment) {
@@ -362,7 +370,7 @@ sub process_revision_change {
Bugzilla->set_user($old_user);
- $self->logger->info('SUCCESS: Revision D' . $revision->id . ' processed');
+ INFO('SUCCESS: Revision D' . $revision->id . ' processed');
}
sub process_new_user {
@@ -372,7 +380,7 @@ sub process_new_user {
my $phab_user = Bugzilla::Extension::PhabBugz::User->new($user_data);
if (!$phab_user->bugzilla_id) {
- $self->logger->debug("SKIPPING: No bugzilla id associated with user");
+ DEBUG("SKIPPING: No bugzilla id associated with user");
return;
}
@@ -425,7 +433,7 @@ sub process_new_user {
my @bug_ids = map { shift @$_ } @$data;
foreach my $bug_id (@bug_ids) {
- $self->logger->debug("Processing bug $bug_id");
+ DEBUG("Processing bug $bug_id");
my $bug = Bugzilla::Bug->new({ id => $bug_id, cache => 1 });
@@ -434,7 +442,7 @@ sub process_new_user {
foreach my $attachment (@attachments) {
my ($revision_id) = ($attachment->filename =~ PHAB_ATTACHMENT_PATTERN);
- $self->logger->debug("Processing revision D$revision_id");
+ DEBUG("Processing revision D$revision_id");
my $revision = Bugzilla::Extension::PhabBugz::Revision->new_from_query(
{ ids => [ int($revision_id) ] });
@@ -442,13 +450,13 @@ sub process_new_user {
$revision->add_subscriber($phab_user->phid);
$revision->update();
- $self->logger->debug("Revision $revision_id updated");
+ DEBUG("Revision $revision_id updated");
}
}
Bugzilla->set_user($old_user);
- $self->logger->info('SUCCESS: User ' . $phab_user->id . ' processed');
+ INFO('SUCCESS: User ' . $phab_user->id . ' processed');
}
##################
@@ -496,7 +504,7 @@ sub get_last_id {
my $last_id = Bugzilla->dbh->selectrow_array( "
SELECT value FROM phabbugz WHERE name = ?", undef, $type_full );
$last_id ||= 0;
- $self->logger->debug( "QUERY " . uc($type_full) . ": $last_id" );
+ DEBUG( "QUERY " . uc($type_full) . ": $last_id" );
return $last_id;
}
@@ -505,7 +513,7 @@ sub save_last_id {
# Store the largest last key so we can start from there in the next session
my $type_full = $type . "_last_id";
- $self->logger->debug( "UPDATING " . uc($type_full) . ": $last_id" );
+ DEBUG( "UPDATING " . uc($type_full) . ": $last_id" );
Bugzilla->dbh->do( "REPLACE INTO phabbugz (name, value) VALUES (?, ?)",
undef, $type_full, $last_id );
}
diff --git a/extensions/PhabBugz/lib/Logger.pm b/extensions/PhabBugz/lib/Logger.pm
deleted file mode 100644
index 3127b66db..000000000
--- a/extensions/PhabBugz/lib/Logger.pm
+++ /dev/null
@@ -1,37 +0,0 @@
-# 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::Extension::PhabBugz::Logger;
-
-use 5.10.1;
-
-use Moo;
-
-use Bugzilla::Extension::PhabBugz::Constants;
-
-has 'debugging' => ( is => 'ro' );
-
-sub info { shift->_log_it('INFO', @_) }
-sub error { shift->_log_it('ERROR', @_) }
-sub debug { shift->_log_it('DEBUG', @_) }
-
-sub _log_it {
- my ($self, $method, $message) = @_;
-
- return if $method eq 'DEBUG' && !$self->debugging;
- chomp $message;
- if ($ENV{MOD_PERL}) {
- require Apache2::Log;
- Apache2::ServerRec::warn("FEED $method: $message");
- } elsif ($ENV{SCRIPT_FILENAME}) {
- print STDERR "FEED $method: $message\n";
- } else {
- print STDERR '[' . localtime(time) ."] $method: $message\n";
- }
-}
-
-1;
diff --git a/extensions/PhabBugz/lib/Revision.pm b/extensions/PhabBugz/lib/Revision.pm
index c114de78c..98c3196c2 100644
--- a/extensions/PhabBugz/lib/Revision.pm
+++ b/extensions/PhabBugz/lib/Revision.pm
@@ -29,6 +29,7 @@ use Bugzilla::Extension::PhabBugz::Util qw(
has id => ( is => 'ro', isa => Int );
has phid => ( is => 'ro', isa => Str );
has title => ( is => 'ro', isa => Str );
+has summary => ( is => 'ro', isa => Str );
has status => ( is => 'ro', isa => Str );
has creation_ts => ( is => 'ro', isa => Str );
has modification_ts => ( is => 'ro', isa => Str );
@@ -93,6 +94,7 @@ sub BUILDARGS {
my ( $class, $params ) = @_;
$params->{title} = $params->{fields}->{title};
+ $params->{summary} = $params->{fields}->{summary};
$params->{status} = $params->{fields}->{status}->{value};
$params->{creation_ts} = $params->{fields}->{dateCreated};
$params->{modification_ts} = $params->{fields}->{dateModified};
diff --git a/extensions/PhabBugz/lib/Util.pm b/extensions/PhabBugz/lib/Util.pm
index 8085828f9..844d8c0b5 100644
--- a/extensions/PhabBugz/lib/Util.pm
+++ b/extensions/PhabBugz/lib/Util.pm
@@ -77,12 +77,12 @@ sub _get_revisions {
}
sub create_revision_attachment {
- my ( $bug, $revision_id, $revision_title, $timestamp ) = @_;
+ my ( $bug, $revision, $timestamp ) = @_;
my $phab_base_uri = Bugzilla->params->{phabricator_base_uri};
ThrowUserError('invalid_phabricator_uri') unless $phab_base_uri;
- my $revision_uri = $phab_base_uri . "D" . $revision_id;
+ my $revision_uri = $phab_base_uri . "D" . $revision->id;
# Check for previous attachment with same revision id.
# If one matches then return it instead. This is fine as
@@ -102,8 +102,8 @@ sub create_revision_attachment {
bug => $bug,
creation_ts => $timestamp,
data => $revision_uri,
- description => $revision_title,
- filename => 'phabricator-D' . $revision_id . '-url.txt',
+ description => $revision->title,
+ filename => 'phabricator-D' . $revision->id . '-url.txt',
ispatch => 0,
isprivate => 0,
mimetype => PHAB_CONTENT_TYPE,
@@ -111,8 +111,8 @@ sub create_revision_attachment {
);
# Insert a comment about the new attachment into the database.
- $bug->add_comment('', { type => CMT_ATTACHMENT_CREATED,
- extra_data => $attachment->id });
+ $bug->add_comment($revision->summary, { type => CMT_ATTACHMENT_CREATED,
+ extra_data => $attachment->id });
return $attachment;
}
diff --git a/extensions/Push/lib/Logger.pm b/extensions/Push/lib/Logger.pm
index 7ae96b58a..5d92010ee 100644
--- a/extensions/Push/lib/Logger.pm
+++ b/extensions/Push/lib/Logger.pm
@@ -8,53 +8,43 @@
package Bugzilla::Extension::Push::Logger;
use 5.10.1;
-use strict;
-use warnings;
+use Moo;
+use Bugzilla::Logging;
+use Log::Log4perl;
use Bugzilla::Extension::Push::Constants;
use Bugzilla::Extension::Push::LogEntry;
-sub new {
- my ($class) = @_;
- my $self = {};
- bless($self, $class);
- return $self;
-}
+# If Log4perl then finds that it's being called from a registered wrapper, it
+# will automatically step up to the next call frame.
+Log::Log4perl->wrapper_register(__PACKAGE__);
-sub info { shift->_log_it('INFO', @_) }
-sub error { shift->_log_it('ERROR', @_) }
-sub debug { shift->_log_it('DEBUG', @_) }
+sub info {
+ my ($this, $message) = @_;
+ INFO($message);
+}
-sub debugging {
- my ($self) = @_;
- return $self->{debug};
+sub error {
+ my ($this, $message) = @_;
+ ERROR($message);
}
-sub _log_it {
- my ($self, $method, $message) = @_;
- return if $method eq 'DEBUG' && !$self->debugging;
- chomp $message;
- if ($ENV{MOD_PERL}) {
- require Apache2::Log;
- Apache2::ServerRec::warn("Push $method: $message");
- } elsif ($ENV{SCRIPT_FILENAME}) {
- print STDERR "Push $method: $message\n";
- } else {
- print STDERR '[' . localtime(time) ."] $method: $message\n";
- }
+sub debug {
+ my ($this, $message) = @_;
+ DEBUG($message);
}
sub result {
my ($self, $connector, $message, $result, $data) = @_;
$data ||= '';
- $self->info(sprintf(
- "%s: Message #%s: %s %s",
+ my $log_msg = sprintf
+ '%s: Message #%s: %s %s',
$connector->name,
$message->message_id,
push_result_to_string($result),
- $data
- ));
+ $data;
+ $self->info($log_msg);
Bugzilla::Extension::Push::LogEntry->create({
message_id => $message->message_id,
@@ -68,4 +58,6 @@ sub result {
});
}
+sub _build_logger { Log::Log4perl->get_logger(__PACKAGE__); }
+
1;
diff --git a/extensions/Review/Extension.pm b/extensions/Review/Extension.pm
index db2b475a1..f05f2ba8b 100644
--- a/extensions/Review/Extension.pm
+++ b/extensions/Review/Extension.pm
@@ -93,6 +93,8 @@ sub _reviewers_objs {
sub _user_is_active {
my ($self) = @_;
+ # never consider .bugs or .tld addresses as inactive.
+ return 1 if $self->login =~ /bugs$/ || $self->login =~ /\.tld$/;
return 1 unless Bugzilla->params->{max_reviewer_last_seen};
return 0 if !defined($self->last_seen_date);
diff --git a/extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl b/extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl
index 27cb825ed..bea0d16d7 100644
--- a/extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl
+++ b/extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl
@@ -27,7 +27,7 @@
<td>&nbsp;</td>
<th>Search</th>
<td colspan="2">
- <form action="user_profile">
+ <form action="[% urlbase FILTER html %]user_profile">
[% INCLUDE global/userselect.html.tmpl
id => "login"
name => "login"