"Find product" field at BMO/describecomponents.cgi?full=1 can't find "bugzilla.mozilla.org :: User Interface"

RESOLVED FIXED

Status

()

bugzilla.mozilla.org
User Interface
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: atoll, Assigned: glob)

Tracking

Production
x86
Mac OS X

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
The "find product" field says "Search by product and component keywords", but is unable to find matches for searches formatted in the same manner as its results, "product :: component".

Steps to reproduce:

0. Go to https://bugzilla.mozilla.org/describecomponents.cgi?full=1
1. Enter "bugzilla.mozilla.org" into the field. The expected result, a list of BMO components, is shown.
2. Enter "bugzilla.mozilla.org ::" into the field. Unexpectedly, all but one components are hidden.
3. Enter "mozilla.org :: Server" into the field. Unexpectedly, no components are shown.

Expected behavior:

2. Enter "bugzilla.mozilla.org ::" into the field. The expected result, a list of components of all products that match the phrase "bugzilla.mozilla.org", is shown.
3. Enter "mozilla.org :: Server" into the field. The expected result, a list of components matching the phrase "Server" in products matching the phrase "mozilla.org", is shown.
When I enter "bugzilla.mozilla.org::" into the field I get "No components found" in red next to the field and nothing shows.  

And I also don't see all the components  in the dropdown list of all the bugzilla.mozilla.org components, on this page and on https://bugzilla.mozilla.org/enter_bug.cgi . General is the last one on the list. So UI and Server are missing. 

While I'm picking at this, one of the Extension component starts with a lower case "e", Extensions::ProdCompSearch.  Not a big deal since that doesn't seem to affect how it sorts.
(Assignee)

Comment 2

4 years ago
(In reply to Liz Henry :lizzard from comment #1)
> And I also don't see all the components  in the dropdown list of all the
> bugzilla.mozilla.org components

we only show 25 results, so some will be missing if your query matches more (which is the case here).
Aha! But should the search keep trying to match across the "::" part of the product::component description?
(Assignee)

Comment 4

4 years ago
(In reply to Liz Henry :lizzard from comment #3)
> Aha! But should the search keep trying to match across the "::" part of the
> product::component description?

yes, i agree with the reporter -- searching for "bugzilla.mozilla.org ::" should restrict the query to components in the bugzilla.mozilla.org product.

the current behavour is to treat :: as a literal string to search on.
Originally we never intended for people to use :: in any form in the search field and is merely printed in the drop down to delimit product and component. 

We could either strip it out before doing the literal string search we are doing now or add logic to limit the results to the specific product (ie. "bugzilla.mozilla.org ::") or specific component (ie. ":: General"). Glob mentions this in comment 4. 

The old ProdCompSearch functionality before it was updated to YUI3 would leave what the user types in the text field alone and if the user refocused the text field with their old search string, it would do the search again with the same results. So if you entered "Bugzilla" it would just leave "Bugzilla" in the search field.

In the new version running under YUI3 I could not figure out an easy way to mimic the old behavior as we ran out of time for the upgrade. glob made a change that would put the selected line from the drop down into the text field. So if you selected "Bugzilla :: General", it would then populate the text field with "Bugzilla :: General". Which if you were to enter in the text field manually or refocus the field later, it will not find anything as that is not a valid search string the way the SQL is constructed.

Ideally, I would prefer the pre-YUI3 behavior instead of worrying about dealing with '::' and all it entails. This way people will still just use the old search string when regenerating the list and the "Bugzilla :: General" notation will only be visible in the drop down and user's will not think to enter it later.

dkl
(Reporter)

Comment 6

4 years ago
(In reply to David Lawrence [:dkl] from comment #5)
> Originally we never intended for people to use :: in any form in the search
> field and is merely printed in the drop down to delimit product and
> component. 

I tried to use :: in the search field specifically because it was shown in the drop down result.

> The old ProdCompSearch functionality before it was updated to YUI3 would
> leave what the user types in the text field alone and if the user refocused
> the text field with their old search string, it would do the search again
> with the same results. So if you entered "Bugzilla" it would just leave
> "Bugzilla" in the search field.

I discovered this when I intentionally typed "mozilla.org :: Server Operations" into the field to try and filter to products matching mozilla.org && components matching Server Operations, since typing "mozilla.org" is useless alone in the product field.

> In the new version running under YUI3 I could not figure out an easy way to
> mimic the old behavior as we ran out of time for the upgrade. glob made a
> change that would put the selected line from the drop down into the text
> field. So if you selected "Bugzilla :: General", it would then populate the
> text field with "Bugzilla :: General". Which if you were to enter in the
> text field manually or refocus the field later, it will not find anything as
> that is not a valid search string the way the SQL is constructed.

This bug report does not depend on that behavior, as I was not selecting anything from the dropdown at any point.

> Ideally, I would prefer the pre-YUI3 behavior instead of worrying about
> dealing with '::' and all it entails. This way people will still just use
> the old search string when regenerating the list and the "Bugzilla ::
> General" notation will only be visible in the drop down and user's will not
> think to enter it later.

I chose to enter this search notation precisely as shown in the dropdown because were absent entirely from the dropdown list (due to the sheer volume of components matching "mozilla.org").
(Assignee)

Updated

4 years ago
Assignee: nobody → glob
(Assignee)

Comment 7

4 years ago
Created attachment 735630 [details] [diff] [review]
patch v1

this patch makes searches like 'bugzilla :: general' search just the product name and description for 'bugzilla', and just the component name and description for 'general'.

it also changes the sorting so exact name matches for either the product or component are sorted first (something i've been meaning to do for ages), and adds 'an error occurred' notice.
Attachment #735630 - Flags: review?(dkl)
(Assignee)

Updated

4 years ago
Duplicate of this bug: 864288
Comment on attachment 735630 [details] [diff] [review]
patch v1

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

Looks good. r=dkl

::: extensions/ProdCompSearch/lib/WebService.pm
@@ +95,2 @@
>                 AND products.id IN (" . join(",", @$enterable_ids) . ")
> +      ORDER BY " . join(",", @order) . " $limit",

nit (extra space): join(", ", ...

@@ +100,5 @@
>  }
>  
> +sub _build_terms {
> +    my ($query, $product, $component) = @_;
> +    my $dbh = Bugzilla->switch_to_shadow_db();

No need to do this again here.
Attachment #735630 - Flags: review?(dkl) → review+
(Assignee)

Comment 10

4 years ago
Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bmo/4.2/
modified extensions/ProdCompSearch/lib/WebService.pm
modified extensions/ProdCompSearch/template/en/default/prodcompsearch/form.html.tmpl
modified extensions/ProdCompSearch/web/js/prod_comp_search.js
modified extensions/ProdCompSearch/web/styles/prod_comp_search.css
Committed revision 8755.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.