diff options
author | dklawren <dklawren@users.noreply.github.com> | 2018-05-08 16:15:20 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-05-08 16:15:20 +0200 |
commit | 2eea01b5c298e24127d26ba1e99bf01772579f2a (patch) | |
tree | 85fd62c2ec982c67128de472ac1cc3d3904578d9 /extensions/PhabBugz | |
parent | e56ef7547dd9c078d172a0e40a4a420cf8e5b1fe (diff) | |
download | bugzilla-2eea01b5c298e24127d26ba1e99bf01772579f2a.tar.gz bugzilla-2eea01b5c298e24127d26ba1e99bf01772579f2a.tar.xz |
Bug 1459336 - feed daemon skips setting r+ for accepted revision if the same user already has a flag set even if flag is status of ?
Diffstat (limited to 'extensions/PhabBugz')
-rw-r--r-- | extensions/PhabBugz/lib/Feed.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/extensions/PhabBugz/lib/Feed.pm b/extensions/PhabBugz/lib/Feed.pm index 3517d44fd..821ec6527 100644 --- a/extensions/PhabBugz/lib/Feed.pm +++ b/extensions/PhabBugz/lib/Feed.pm @@ -430,19 +430,22 @@ sub process_revision_change { my ($attach_revision_id) = ($attachment->filename =~ PHAB_ATTACHMENT_PATTERN); next if $revision->id != $attach_revision_id; - # Clear old flags if no longer accepted + # Clear old accepted review flags if no longer accepted my (@denied_flags, @new_flags, @removed_flags, %accepted_done, $flag_type); foreach my $flag (@{ $attachment->flags }) { next if $flag->type->name ne 'review'; $flag_type = $flag->type if $flag->type->is_active; + next if $flag->status ne '+'; if (any { $flag->setter->id == $_ } @denied_user_ids) { + INFO('Denying review flag set by ' . $flag->setter->name); push(@denied_flags, { id => $flag->id, setter => $flag->setter, status => 'X' }); } if (any { $flag->setter->id == $_ } @accepted_user_ids) { + INFO('Skipping as review+ already set by ' . $flag->setter->name); $accepted_done{$flag->setter->id}++; } - if ($flag->status eq '+' - && !any { $flag->setter->id == $_ } (@accepted_user_ids, @denied_user_ids)) { + if (!any { $flag->setter->id == $_ } (@accepted_user_ids, @denied_user_ids)) { + INFO('Clearing review+ flag set by ' . $flag->setter->name); push(@removed_flags, { id => $flag->id, setter => $flag->setter, status => 'X' }); } } @@ -453,6 +456,7 @@ sub process_revision_change { foreach my $user_id (@accepted_user_ids) { next if $accepted_done{$user_id}; my $user = Bugzilla::User->check({ id => $user_id, cache => 1 }); + INFO('Setting new review+ flag for ' . $user->name); push(@new_flags, { type_id => $flag_type->id, setter => $user, status => '+' }); } |