Skip to content

Commit 06bb2f6

Browse files
committed
Bug 1965553 - Uplift approval set in bugzilla without relman approval
1 parent ecb81f4 commit 06bb2f6

File tree

3 files changed

+13
-320
lines changed

3 files changed

+13
-320
lines changed

extensions/PhabBugz/lib/Feed.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ sub process_revision_change {
651651
# set the approval flags. This ensures that users who create revisions will
652652
# set the flag to `?`, and only approvals from `mozilla-next-drivers` group
653653
# members will set the flag to `+` or `-`.
654-
set_attachment_approval_flags($attachment, $revision, $changer);
654+
set_attachment_approval_flags($attachment, $revision, $changer, $is_new);
655655
}
656656

657657
$attachment->update($timestamp);

extensions/PhabBugz/lib/Util.pm

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,18 @@ sub set_attachment_approval_flags {
6969
# Find the current review status of the revision changer
7070
my $status = undef;
7171
my $reviewer_status = undef;
72-
foreach my $reviewer (@{$revision->reviews}) {
73-
if ($reviewer->{user}->id == $phab_user->id) {
74-
$reviewer_status = $reviewer->{status};
75-
$status = $revision_status_flag_map->{$reviewer_status};
72+
73+
if ($is_new) {
74+
$reviewer_status = $revision->status;
75+
$status = $revision_status_flag_map->{$reviewer_status};
76+
}
77+
else {
78+
foreach my $reviewer (@{$revision->reviews}) {
79+
if ($reviewer->{user}->id == $phab_user->id) {
80+
$reviewer_status = $reviewer->{status};
81+
$status = $revision_status_flag_map->{$reviewer_status};
82+
last;
83+
}
7684
}
7785
}
7886

extensions/PhabBugz/lib/Util.pm.orig

Lines changed: 0 additions & 315 deletions
This file was deleted.

0 commit comments

Comments
 (0)