Last Comment Bug 859534 - "Find product" field at BMO/describecomponents.cgi?full=1 can't find "bugzilla.mozilla.org :: User Interface"
: "Find product" field at BMO/describecomponents.cgi?full=1 can't find "bugzill...
Status: RESOLVED FIXED
:
Product: bugzilla.mozilla.org
Classification: Other
Component: User Interface (show other bugs)
: Production
: x86 Mac OS X
: -- normal (vote)
: ---
Assigned To: Byron Jones ‹:glob›
:
Mentors:
: 864288 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-08 15:35 PDT by Richard Soderberg [:atoll]
Modified: 2013-04-23 21:31 PDT (History)
5 users (show)
See Also:
Due Date:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch v1 (6.82 KB, patch)
2013-04-10 01:16 PDT, Byron Jones ‹:glob›
dkl: review+
Details | Diff | Splinter Review

Description Richard Soderberg [:atoll] 2013-04-08 15:35:22 PDT
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.
Comment 1 Liz Henry (:lizzard) (needinfo? me) 2013-04-08 21:25:46 PDT
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.
Comment 2 Byron Jones ‹:glob› 2013-04-08 22:07:18 PDT
(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).
Comment 3 Liz Henry (:lizzard) (needinfo? me) 2013-04-08 22:20:06 PDT
Aha! But should the search keep trying to match across the "::" part of the product::component description?
Comment 4 Byron Jones ‹:glob› 2013-04-09 00:20:13 PDT
(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.
Comment 5 David Lawrence [:dkl] 2013-04-09 08:45:50 PDT
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
Comment 6 Richard Soderberg [:atoll] 2013-04-09 09:45:11 PDT
(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").
Comment 7 Byron Jones ‹:glob› 2013-04-10 01:16:07 PDT
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.
Comment 8 Byron Jones ‹:glob› 2013-04-22 06:45:17 PDT
*** Bug 864288 has been marked as a duplicate of this bug. ***
Comment 9 David Lawrence [:dkl] 2013-04-23 11:56:14 PDT
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.
Comment 10 Byron Jones ‹:glob› 2013-04-23 21:31:49 PDT
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.

Note You need to log in before you can comment on or make changes to this bug.