Skip to content

Commit 6568b65

Browse files
committed
Merge branch 'master' into development
* master: Bug 1960099 - When a revision has enters the needs-review state with a reviewer group assigned, query Phab for list of group users and update the reviewer Bumped version to 202500722.2 Bug 1978644 - With the removal of circleci config in bug 1977941, the t/docker.t test is failing as it looks for those files Bumped version to 202500722.1
2 parents c7a7499 + f84bf54 commit 6568b65

File tree

5 files changed

+206
-148
lines changed

5 files changed

+206
-148
lines changed

Bugzilla.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use warnings;
1313

1414
use Bugzilla::Logging;
1515

16-
our $VERSION = '20250708.1';
16+
our $VERSION = '20250722.2';
1717

1818
use Bugzilla::Auth;
1919
use Bugzilla::Auth::Persist::Cookie;

Bugzilla/Util.pm

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,16 +1023,13 @@ sub fetch_product_versions {
10231023
}
10241024

10251025
sub mojo_user_agent {
1026-
my ($params) = @_;
1027-
my $request_timeout = $params->{request_timeout} // 30;
1028-
my $connect_timeout = $params->{connect_timeout} // 5;
1029-
my $inactivity_timeout = $params->{inactivity_timeout} // 30;
1030-
1031-
my $ua = Mojo::UserAgent->new(
1032-
request_timeout => $request_timeout,
1033-
connect_timeout => $connect_timeout,
1034-
inactivity_timeout => $inactivity_timeout,
1035-
);
1026+
my ($params) = @_;
1027+
1028+
state $ua = Mojo::UserAgent->new;
1029+
1030+
$ua->request_timeout($params->{request_timeout} // 30);
1031+
$ua->connect_timeout($params->{connect_timeout} // 5);
1032+
$ua->inactivity_timeout($params->{inactivity_timeout} // 30);
10361033

10371034
if (my $proxy = Bugzilla->params->{proxy_url}) {
10381035
$ua->proxy->http($proxy)->https($proxy);

extensions/PhabBugz/lib/Revision.pm

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use Types::Standard -all;
1616
use Type::Utils;
1717

1818
use Bugzilla::Bug;
19+
use Bugzilla::Logging;
1920
use Bugzilla::Types qw(JSONBool);
2021
use Bugzilla::Error;
2122
use Bugzilla::Util qw(trim);
@@ -96,7 +97,7 @@ has reviewers_extra_raw => (
9697
Dict [reviewerPHID => Str, voidedPHID => Maybe [Str], diffPHID => Maybe [Str]]
9798
]
9899
);
99-
has stack_graph => (is => 'lazy', isa => Tuple[ArrayRef, ArrayRef]);
100+
has stack_graph => (is => 'lazy');
100101

101102
sub new_from_query {
102103
my ($class, $params) = @_;
@@ -337,6 +338,7 @@ sub _build_reviews {
337338

338339
my @reviewers;
339340
foreach my $raw (@{$self->reviewers_raw}) {
341+
<<<<<<< HEAD
340342
my $reviewer_data = {
341343
is_blocking => ($raw->{isBlocking} ? 1 : 0),
342344
is_project => 0,
@@ -352,6 +354,26 @@ sub _build_reviews {
352354
$reviewer_data->{user} = Bugzilla::Extension::PhabBugz::User->new_from_query({phids => [$reviewer_phid]});
353355
}
354356
357+
# Only interests in user or project objects (would there ever be something else?)
358+
my $reviewer_phid = $raw->{reviewerPHID};
359+
next if $reviewer_phid !~ /^PHID-(?:PROJ|USER)/;
360+
361+
my $reviewer_data = {
362+
is_blocking => ($raw->{isBlocking} ? 1 : 0),
363+
is_project => 0,
364+
status => $raw->{status},
365+
};
366+
367+
if ($reviewer_phid =~ /^PHID-PROJ/) {
368+
$reviewer_data->{user} = Bugzilla::Extension::PhabBugz::Project->new_from_query({phids => [$reviewer_phid]});
369+
$reviewer_data->{is_project} = 1;
370+
}
371+
elsif ($reviewer_phid =~ /^PHID-USER/) {
372+
$reviewer_data->{user} = Bugzilla::Extension::PhabBugz::User->new_from_query({phids => [$reviewer_phid]});
373+
}
374+
375+
next if !$reviewer_data->{user}; # Skip if user or project was not found.
376+
355377
# Set to accepted-prior if the diffs reviewer are different and the reviewer status is accepted
356378
foreach my $reviewer_extra (@{$self->reviewers_extra_raw}) {
357379
if ($reviewer_extra->{reviewerPHID} eq $reviewer_phid) {
@@ -436,7 +458,7 @@ sub _build_stack_graph {
436458
}
437459
}
438460
439-
return (\@phids, \@edges);
461+
return {phids => \@phids, edges => \@edges};
440462
}
441463
442464
#########################

0 commit comments

Comments
 (0)