Bug 426374

Summary: 3.8.1: Ajax Optimizations for Bug Query Pages
Product: [Community] Bugzilla Reporter: David Lawrence <dkl>
Component: User InterfaceAssignee: David Lawrence <dkl>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: 3.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: 4 hours
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-28 03:48:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 406071, 406181    
Attachments:
Description Flags
Patch to optimize query.cgi using ajax to update component/version/milestone list
none
Patch to optimize query.cgi using ajax to update component/version/milestone list (v2) nelhawar: review+, dkl: review? (kbaker)

Description David Lawrence 2007-12-20 16:00:55 UTC
+++ This bug was initially created as a clone of Bug #406181 +++

Description:
On certain pages Ajax optimizations are used to speed up page loading time. Red
Hat has a high number of components for certain products. The component lists
cause a large amount of HTML having to be downloaded by the client browser. The
Ajax functions allow the UI to only show the components needed depending on
which products are selected.

Function Requirements:
When selecting products on query.cgi, the components, versions, milestones
fields are automatically updated.

Pretty much self contained on the backend in Bugzilla/Ajax.pm and ajax.cgi. A
lot of javascript though in js/*.js and the templates themselves.

Comment 1 David Lawrence 2007-12-20 19:00:31 UTC
LOC Estimation:

js/product_query.js: 86
templates: 139
selenium tests to verify proper operation of component/version/milestone
filtering: 4 hours

LOC Total: 225

Comment 2 David Lawrence 2008-04-04 19:36:19 UTC
Created attachment 301328 [details]
Patch to optimize query.cgi using ajax to update component/version/milestone list

Attaching a patch that optimizes the query.cgi page by filtering the
component/version/target_milestone lists using ajax instead of loading the
entire structure fresh with each page load. 

Note:

1. Added js/query.js and js/rpc-min.js to support the javascript call
updateQuerySelects() that redraws the proper select forms when products are
selected.
2. Using get_selection() and restoreSelection() in js/util.js provided by
upstream.
3. Updated query.cgi to only load the component/version/target_milestones for
selected products (if any are selected) which helps speed things up
considerably. Before even if you only wanted to see RHEL products, it would
still initially load all components from all products which included Fedora
(5000+ components).

I have installed this on bugdev.devel.redhat.com/bugzilla for testing.

Please review
Dave

Comment 3 Kevin Baker 2008-04-16 17:27:56 UTC
Comment on attachment 301328 [details]
Patch to optimize query.cgi using ajax to update component/version/milestone list

query.cgi 

your code fell outside your REDHAT comment terminator

Comment 4 Kevin Baker 2008-04-16 18:01:21 UTC
I jumped over to bugdev and took it for a test drive.

First Page load of query.cgi?format=advanced

No Classification, Product, Component, Version are selected however they are 
all filled with values. My expectation was that on the virgin load it would 
only have the Classification filled. If I clicked a classification then it 
would show the products for that classification. If I clicked a product then 
it would then fill the components and versions for that product. Until then 
they would be empty. If no classification is selected how does the UI 
determine what products to list? All products? Likewise if no product is 
selected what components are chosen? IMHO they should be empty and only the 
Classification box should have values. An empty list would indicate that you 
are not searching on that field and hence searching all.

Am I making sense?

Comment 5 David Lawrence 2008-04-17 04:01:59 UTC
Created attachment 302696 [details]
Patch to optimize query.cgi using ajax to update component/version/milestone list (v2)

Kevin, I had different versions running today and you may have hit bugdev at a
bad time. 

Attaching a new version of the query.cgi patch. Took a much different approach
and  tied in more closely with the upstream javascript instead of writing most
new from scratch. This makes the patch much smaller. Also this is better in
that any subsequent loads of the same product data will not get it again from
the server and caches the data.

Please review
Dave

Comment 6 Noura El hawary 2008-04-17 12:01:38 UTC
Comment on attachment 302696 [details]
Patch to optimize query.cgi using ajax to update component/version/milestone list (v2)

looks good to me Dave.

Comment 7 David Lawrence 2008-04-17 18:35:39 UTC
Checked in to CVS. Worked 8 hours. 

Created a new bug separately for query.cgi to be optimized to only load
components/versions/milestones if certain classifications/products are already
selected to cut down on HTML sent initially.

https://bugzilla.redhat.com/show_bug.cgi?id=442939

Dave