From 8feb55f32ccd688d2b51105f4d56985abf0baa93 Mon Sep 17 00:00:00 2001 From: David Walsh Date: Thu, 7 Sep 2017 08:40:04 -0500 Subject: Bug 1396042 - Implement logging for the BMO push connector --- extensions/Push/lib/Connector/Phabricator.pm | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/extensions/Push/lib/Connector/Phabricator.pm b/extensions/Push/lib/Connector/Phabricator.pm index c92df3173..8a307ea72 100644 --- a/extensions/Push/lib/Connector/Phabricator.pm +++ b/extensions/Push/lib/Connector/Phabricator.pm @@ -21,8 +21,8 @@ use Bugzilla::User; use Bugzilla::Extension::PhabBugz::Constants; use Bugzilla::Extension::PhabBugz::Util qw( add_comment_to_revision create_private_revision_policy - edit_revision_policy get_attachment_revisions get_bug_role_phids - get_revisions_by_ids intersect is_attachment_phab_revision + edit_revision_policy get_attachment_revisions 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); @@ -79,6 +79,12 @@ sub send { my @revisions = get_attachment_revisions($bug); foreach my $revision (@revisions) { + Bugzilla->audit(sprintf( + 'Making revision %s for bug %s private due to unkown Bugzilla groups: %s', + $revision->{id}, + $bug->id, + join(', ', @set_groups) + )); add_comment_to_revision( $revision->{phid}, $phab_error_message ); make_revision_private( $revision->{phid} ); } @@ -115,9 +121,19 @@ sub send { my $revision_phid = $revision->{phid}; if ($is_public) { + Bugzilla->audit(sprintf( + 'Making revision %s public for bug %s', + $revision->{id}, + $bug->id + )); make_revision_public($revision_phid); } else { + Bugzilla->audit(sprintf( + 'Giving revision %s a custom policy for bug %s', + $revision->{id}, + $bug->id + )); edit_revision_policy( $revision_phid, $policy_phid, $subscribers ); } } -- cgit v1.2.3-24-g4f1b