summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Walsh <davidwalsh83@gmail.com>2017-08-02 22:16:10 +0200
committerdklawren <dklawren@users.noreply.github.com>2017-08-02 22:16:10 +0200
commite0acb9462b63fde56b5ed9f45b9cce7387f6e1ac (patch)
treed8e26249b9e888f5e9873671f18cef09752f4f58
parentb91128a6b902b610c9adceb2207c86422e3ea241 (diff)
downloadbugzilla-e0acb9462b63fde56b5ed9f45b9cce7387f6e1ac.tar.gz
bugzilla-e0acb9462b63fde56b5ed9f45b9cce7387f6e1ac.tar.xz
Fix #1386675 - Update user comparison in Phabricator push connector
-rw-r--r--extensions/Push/lib/Connector/Phabricator.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/extensions/Push/lib/Connector/Phabricator.pm b/extensions/Push/lib/Connector/Phabricator.pm
index 092d63dd3..d72009708 100644
--- a/extensions/Push/lib/Connector/Phabricator.pm
+++ b/extensions/Push/lib/Connector/Phabricator.pm
@@ -26,6 +26,7 @@ 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';
sub options {
return (
@@ -90,10 +91,13 @@ sub send {
: 'One revision was' )
. ' made private due to unknown Bugzilla groups.';
- my $user =
- Bugzilla->set_user(
- Bugzilla::User->new( { name => 'conduit@mozilla.bugs' } ) );
+ my $user = Bugzilla::User->new( { name => PHAB_BMO_USER_EMAIL } );
+ $user->{groups} = [ Bugzilla::Group->get_all ];
+ $user->{bless_groups} = [ Bugzilla::Group->get_all ];
+ Bugzilla->set_user($user);
+
$bug->add_comment( $bmo_error_message, { isprivate => 0 } );
+
my $bug_changes = $bug->update();
$bug->send_changes($bug_changes);
@@ -130,7 +134,7 @@ sub _get_attachment_revisions() {
my @attachments = grep {
$_->isobsolete == 0
&& $_->contenttype eq PHAB_CONTENT_TYPE
- && $_->attacher->login ne 'phab-bot@bmo.tld'
+ && $_->attacher->login eq PHAB_BMO_USER_EMAIL
} @{ $bug->attachments() };
if (@attachments) {