summaryrefslogtreecommitdiffstats
path: root/extensions/Push
diff options
context:
space:
mode:
authordklawren <dklawren@users.noreply.github.com>2017-08-11 22:02:16 +0200
committerDylan William Hardison <dylan@hardison.net>2017-08-11 22:02:16 +0200
commite5ee36ba43a80554aceb04d6b6c4504c6d21e3fb (patch)
treeb05066bc0905b74d4d37e661ccccf2c5038c9d9e /extensions/Push
parent63dd3061a164345095847e502bb5395bb5570c3a (diff)
downloadbugzilla-e5ee36ba43a80554aceb04d6b6c4504c6d21e3fb.tar.gz
bugzilla-e5ee36ba43a80554aceb04d6b6c4504c6d21e3fb.tar.xz
Bug 1382225 - Missing code from PhabBugz extension such as http basic auth support and other minor improvements
Diffstat (limited to 'extensions/Push')
-rw-r--r--extensions/Push/lib/Connector/Phabricator.pm26
1 files changed, 11 insertions, 15 deletions
diff --git a/extensions/Push/lib/Connector/Phabricator.pm b/extensions/Push/lib/Connector/Phabricator.pm
index d72009708..2571c6d37 100644
--- a/extensions/Push/lib/Connector/Phabricator.pm
+++ b/extensions/Push/lib/Connector/Phabricator.pm
@@ -16,17 +16,16 @@ use base 'Bugzilla::Extension::Push::Connector::Base';
use Bugzilla::Bug;
use Bugzilla::Constants;
use Bugzilla::Error;
-use Bugzilla::Extension::PhabBugz::Util qw(add_comment_to_revision
- create_private_revision_policy edit_revision_policy get_bug_role_phids
- get_revisions_by_ids intersect make_revision_public make_revision_private);
-use Bugzilla::Extension::Push::Constants;
-use Bugzilla::Extension::Push::Util qw(is_public);
use Bugzilla::User;
-use List::Util qw(any);
-use constant PHAB_CONTENT_TYPE => 'text/x-phabricator-request';
-use constant PHAB_ATTACHMENT_PATTERN => qr/^phabricator-D(\d+)/;
-use constant PHAB_BMO_USER_EMAIL => 'phab-bot@bmo.tld';
+use Bugzilla::Extension::PhabBugz::Constants;
+use Bugzilla::Extension::PhabBugz::Util qw(
+ add_comment_to_revision create_private_revision_policy
+ edit_revision_policy get_bug_role_phids get_revisions_by_ids
+ intersect is_attachment_phab_revision make_revision_public
+ make_revision_private);
+use Bugzilla::Extension::Push::Constants;
+use Bugzilla::Extension::Push::Util qw(is_public);
sub options {
return (
@@ -91,7 +90,7 @@ sub send {
: 'One revision was' )
. ' made private due to unknown Bugzilla groups.';
- my $user = Bugzilla::User->new( { name => PHAB_BMO_USER_EMAIL } );
+ my $user = Bugzilla::User->new( { name => PHAB_AUTOMATION_USER } );
$user->{groups} = [ Bugzilla::Group->get_all ];
$user->{bless_groups} = [ Bugzilla::Group->get_all ];
Bugzilla->set_user($user);
@@ -131,11 +130,8 @@ sub _get_attachment_revisions() {
my @revisions;
- my @attachments = grep {
- $_->isobsolete == 0
- && $_->contenttype eq PHAB_CONTENT_TYPE
- && $_->attacher->login eq PHAB_BMO_USER_EMAIL
- } @{ $bug->attachments() };
+ my @attachments =
+ grep { is_attachment_phab_revision($_) } @{ $bug->attachments() };
if (@attachments) {
my @revision_ids;