From e3fb2fbabb83a12117ca8db405dacd1781c028cd Mon Sep 17 00:00:00 2001 From: Kohei Yoshino Date: Wed, 3 Oct 2018 22:39:57 -0400 Subject: Bug 1489120 - Add a rest API to get triage owners for each product/component pair (#797) --- Bugzilla/WebService/Product.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Bugzilla/WebService/Product.pm') diff --git a/Bugzilla/WebService/Product.pm b/Bugzilla/WebService/Product.pm index 6ca3fee90..0b58c6e1c 100644 --- a/Bugzilla/WebService/Product.pm +++ b/Bugzilla/WebService/Product.pm @@ -215,6 +215,8 @@ sub _component_to_hash { $self->type('email', $component->default_assignee->login), default_qa_contact => $self->type('email', $component->default_qa_contact->login), + triage_owner => + $self->type('email', $component->triage_owner->login), sort_key => # sort_key is returned to match Bug.fields 0, is_active => @@ -548,6 +550,11 @@ default. C The login name of the user who will be set as the QA Contact for new bugs by default. +=item C + +C The login name of the user who is named as the Triage Owner of the +component. + =item C C Components, when displayed in a list, are sorted first by this integer -- cgit v1.2.3-24-g4f1b From 5f5d1a83c44a7521622686e8e0a88a744e92c335 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Sat, 13 Oct 2018 00:33:18 -0400 Subject: Bug 1495741 - memory issues: disable etag generation for /rest/product --- Bugzilla/WebService/Product.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Bugzilla/WebService/Product.pm') diff --git a/Bugzilla/WebService/Product.pm b/Bugzilla/WebService/Product.pm index 0b58c6e1c..8ee6ff43f 100644 --- a/Bugzilla/WebService/Product.pm +++ b/Bugzilla/WebService/Product.pm @@ -68,6 +68,8 @@ sub get { my ($self, $params) = validate(@_, 'ids', 'names', 'type'); my $user = Bugzilla->user; + Bugzilla->request_cache->{bz_etag_disable} = 1; + defined $params->{ids} || defined $params->{names} || defined $params->{type} || ThrowCodeError("params_required", { function => "Product.get", params => ['ids', 'names', 'type'] }); -- cgit v1.2.3-24-g4f1b From 6657fa9f5210d5b5a9b14c0cba6882bd56232054 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Sat, 13 Oct 2018 00:33:48 -0400 Subject: Bug 1495741 - memory issues: use local flag cache --- Bugzilla/WebService/Product.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Bugzilla/WebService/Product.pm') diff --git a/Bugzilla/WebService/Product.pm b/Bugzilla/WebService/Product.pm index 8ee6ff43f..cdd8a0a92 100644 --- a/Bugzilla/WebService/Product.pm +++ b/Bugzilla/WebService/Product.pm @@ -64,6 +64,7 @@ sub get_accessible_products { } # Get a list of actual products, based on list of ids or names +our %FLAG_CACHE; sub get { my ($self, $params) = validate(@_, 'ids', 'names', 'type'); my $user = Bugzilla->user; @@ -136,6 +137,7 @@ sub get { } # Now create a result entry for each. + local %FLAG_CACHE = (); my @products = map { $self->_product_to_hash($params, $_) } @requested_products; return { products => \@products }; @@ -229,11 +231,11 @@ sub _component_to_hash { $field_data->{flag_types} = { bug => [map { - $self->_flag_type_to_hash($_) + $FLAG_CACHE{ $_->id } //= $self->_flag_type_to_hash($_) } @{$component->flag_types->{'bug'}}], attachment => [map { - $self->_flag_type_to_hash($_) + $FLAG_CACHE{ $_->id } //= $self->_flag_type_to_hash($_) } @{$component->flag_types->{'attachment'}}], }; } @@ -242,8 +244,8 @@ sub _component_to_hash { } sub _flag_type_to_hash { - my ($self, $flag_type, $params) = @_; - return filter $params, { + my ($self, $flag_type) = @_; + return { id => $self->type('int', $flag_type->id), name => @@ -266,7 +268,7 @@ sub _flag_type_to_hash { $self->type('int', $flag_type->grant_group_id), request_group => $self->type('int', $flag_type->request_group_id), - }, undef, 'flag_types'; + }; } sub _version_to_hash { -- cgit v1.2.3-24-g4f1b