Bugzilla Security groups are periodically synced to Phabricator project membership

RESOLVED FIXED

Status

()

bugzilla.mozilla.org
Extensions: PhabBugz
RESOLVED FIXED
a year ago
11 months ago

People

(Reporter: dkl, Assigned: dkl)

Tracking

Production

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

a year ago
**AC**

- cli wrapper that executes the sync function once given a phabricator and bugzilla
- can run from demo
- code is in a docker or similar container that will be deployed later
- deployment not solved
(Assignee)

Updated

a year ago
Assignee: nobody → dkl
Status: NEW → ASSIGNED
(Assignee)

Comment 1

a year ago
Created attachment 8869455 [details] [diff] [review]
1361151_1.patch

This will be ran from a cron script in the BMO infrastructure periodically (maybe every 15mins?). It will be updating project members in Phabricator to match a defined list of security groups in BMO. 

dkl
Attachment #8869455 - Flags: review?(dylan)
Comment on attachment 8869455 [details] [diff] [review]
1361151_1.patch

Review of attachment 8869455 [details] [diff] [review]:
-----------------------------------------------------------------

r+ but fix on commit.

::: extensions/PhabBugz/bin/update_project_members.pl
@@ +48,5 @@
> +# 4. Set project members to exact list
> +# 5. Profit
> +
> +$phab_sync_groups = [ split('[,\s]+', $phab_sync_groups) ];
> +my $sync_groups = Bugzilla::Group->match({ name => $phab_sync_groups });

use regex quoting, and also I don't like reusing variables with different types in them. This can be an array
and passed by reference to match().

my @phab_sync_groups = split(/[,\s+]/, $phab_sync_groups);
my $sync_groups = Bugzilla::Group->match({ name => \@phab_sync_groups });

@@ +74,5 @@
> +    my ($group) = @_;
> +    my $group_obj = ref $group ? $group : Bugzilla::Group->check({ name => $group });
> +    my $members_all = $group_obj->members_complete();
> +    my %users;
> +    foreach my $name (sort keys %$members_all) {

sort is surely not required here?
Attachment #8869455 - Flags: review?(dylan) → review+
(Assignee)

Comment 3

a year ago
Thanks

To https://github.com/mozilla-bteam/bmo.git
   d7e7c68..44cef9c  master -> master

will file a new bug for all of the new breakage due to change to t/Support/Files.pm

dkl
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
(Assignee)

Updated

a year ago
Component: General → Extensions: PhabBugz
Product: Conduit → bugzilla.mozilla.org
Version: unspecified → Production
You need to log in before you can comment on or make changes to this bug.