summaryrefslogtreecommitdiffstats
path: root/extensions/PhabBugz/lib/Feed.pm
diff options
context:
space:
mode:
authordklawren <dklawren@users.noreply.github.com>2018-04-26 19:41:27 +0200
committerGitHub <noreply@github.com>2018-04-26 19:41:27 +0200
commitba5f2af68c6dd8639c6bd45d3e419741e1946134 (patch)
tree496e5ae7aca2239752bcdbca5a587a3504fea48d /extensions/PhabBugz/lib/Feed.pm
parent79dd60d845e426dcd243057cd1bca36be27076db (diff)
downloadbugzilla-ba5f2af68c6dd8639c6bd45d3e419741e1946134.tar.gz
bugzilla-ba5f2af68c6dd8639c6bd45d3e419741e1946134.tar.xz
Bug 1454647 - Mirror all BMO groups as Phabricator projects and keep them in sync
Diffstat (limited to 'extensions/PhabBugz/lib/Feed.pm')
-rw-r--r--extensions/PhabBugz/lib/Feed.pm20
1 files changed, 8 insertions, 12 deletions
diff --git a/extensions/PhabBugz/lib/Feed.pm b/extensions/PhabBugz/lib/Feed.pm
index 4c7fe54a5..c35eeba4d 100644
--- a/extensions/PhabBugz/lib/Feed.pm
+++ b/extensions/PhabBugz/lib/Feed.pm
@@ -16,8 +16,9 @@ use List::MoreUtils qw(any);
use Moo;
use Try::Tiny;
-use Bugzilla::Logging;
use Bugzilla::Constants;
+use Bugzilla::Field;
+use Bugzilla::Logging;
use Bugzilla::Search;
use Bugzilla::Util qw(diff_arrays with_writable_database with_readonly_database);
@@ -104,7 +105,7 @@ sub start {
sub feed_query {
my ($self) = @_;
- Bugzilla::Logging->fields->{type} = 'FEED';
+ local Bugzilla::Logging->fields->{type} = 'FEED';
# Ensure Phabricator syncing is enabled
if (!Bugzilla->params->{phabricator_enabled}) {
@@ -164,7 +165,7 @@ sub feed_query {
sub user_query {
my ( $self ) = @_;
- Bugzilla::Logging->fields->{type} = 'USERS';
+ local Bugzilla::Logging->fields->{type} = 'USERS';
# Ensure Phabricator syncing is enabled
if (!Bugzilla->params->{phabricator_enabled}) {
@@ -204,21 +205,17 @@ sub user_query {
sub group_query {
my ($self) = @_;
+ local Bugzilla::Logging->fields->{type} = 'GROUPS';
+
# Ensure Phabricator syncing is enabled
if ( !Bugzilla->params->{phabricator_enabled} ) {
WARN("PHABRICATOR SYNC DISABLED");
return;
}
- my $phab_sync_groups = Bugzilla->params->{phabricator_sync_groups};
- if ( !$phab_sync_groups ) {
- WARN('A comma delimited list of security groups was not provided.');
- return;
- }
-
# PROCESS SECURITY GROUPS
- INFO("GROUPS: Updating group memberships");
+ INFO("Updating group memberships");
# Loop through each group and perform the following:
#
@@ -228,8 +225,7 @@ sub group_query {
# 4. Set project members to exact list
# 5. Profit
- my $sync_groups = Bugzilla::Group->match(
- { name => [ split( '[,\s]+', $phab_sync_groups ) ] } );
+ my $sync_groups = Bugzilla::Group->match( { isactive => 1, isbuggroup => 1 } );
foreach my $group (@$sync_groups) {