Description of problem: Firebug says the initial GET of https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora takes 57 seconds. Compared to ?product=Bugzilla, which is more like 1.6 seconds, so it's likely to be something linearly related to the number of components in a product, and being computed afresh on the server every time. Firebug, for reference, is a firefox debugging plugin that allows you to interactively inspect web page performance and correctness. It can be had from here: https://addons.mozilla.org/firefox/addon/1843 Note that network debugging is disabled by default, so you'll need to turn it on.
We have disabled the javascript helper code in the enter_bug.cgi page that displays the summary and pre-fills the default assigned to value. Since Fedora has 6000+ components, this page was not originally designed to handle that many components. It should display quicker for you now. We will have to visit this issue soon and maybe come up with a different solution to replace the help code that is disabled. Maybe ajax for displaying the component description, assigned_to, etc. Dave
*** Bug 460286 has been marked as a duplicate of this bug. ***
The enter_bug.cgi page and several others are still slower in 3.2 due to the large number of components. We really need to fix the issue with large component lists to enhance the user experience.
Created attachment 329427 [details] new patch for using ajax to load component flags to enter_bug.cgi Hey Dave, Here is another patch that will fix the error you were getting with firebug when the page first loads, regarding making a separate function to return the component flags, i actually thought about this solution but then I found that the return value from that separate function will be pretty much identical with what we have in Component.get we will still need to return component name/id and product info as well so we can relate component to flags so i thought i would just add it to the Component.get , also you said it will be good to have the component description returned to display it at bug entry time, so only difference will be in the assignee/qa contact/ cc list , if we still want to limit the return to not have those extra user information then we can pass the return_flags_only param. I will login later to discuss some more with you. Thanks, Noura
Created attachment 329774 [details] process component desc and flags to enter bug using ajax
Created attachment 329777 [details] process component desc and flags to enter bug using ajax (dkl) Hey Noura. I moved the code that does the comp description and flag fields changes to the "success" part of the ajax callback. This basically does all of the work when the data is successfully returned from the call to Component.get(). But it basically works now. You could clean it up by making a separate function that does the actual form field updating so that it can be called from within the sucess part of the ajax call back or in other parts of the code. For example the js code in create.html.tmpl could first check to see if the flags[index] is already populated before calling get_component_flags() so we are not making ajax calls for components that have already been selected before. Let me know if you have any questions. Dave
Created attachment 329786 [details] using ajax for component flags and description in enterbug Thanks for your help Dave, attached is a last version with the cleanup you suggested so now we only make one xmlrpc call perl for selected component, the patch is applied to bz-web2 and seems to be working nicely, also the loaded data now for fedora enterbug page is 72KB which is much better than before and the bug reporter works nicely no script errors and it doesn't hang. Noura
Comment on attachment 329786 [details] using ajax for component flags and description in enterbug >Index: Bugzilla/WebService/Component.pm > default_qa_contact => > type('string')->value( $_->default_qa_contact->{login_name} ), > default_cc => [ map $_->login, @{ $_->initial_cc } ], >+ flags => _get_component_flags($_), > } > } @$accessible_components; > } >@@ -287,6 +288,23 @@ sub _get_accessible_components { > return \@accessible_components; > } > >+sub _get_component_flags { >+ my $comp_obj = $_; >+ >+ my @flag_list; >+ >+ foreach my $f (@{$comp_obj->flag_types->{bug}}) { >+ next unless $f->is_active; >+ push @flag_list, $f->id; >+ } >+ foreach my $f (@{$comp_obj->flag_types->{attachment}}) { >+ next unless $f->is_active; >+ push @flag_list, $f->id; >+ } >+ >+ return \@flag_list; >+} >Index: js/enterbug.js Nit-pick: Please rename to js/enter_bug.js to match the cgi script name. Similar to the current js/show_bug.js. >Index: template/en/default/bug/create/create.html.tmpl > var components = new Array([% product.components.size %]); I don't see where this variable is used anywhere so we can remove it if that is true. >+ else { >+ var component_name = form.component.value; >+ get_component_flags(product_name, component_name, index); Nit-picks: 1. vars component_name and product_name are not really needed. Just pass in the values directly. else { get_component_flags('[% product.name FILTER js %]', form.component.value, index); Also you need to add the 'FILTER js' part to product.name as t/008filter.t complains if it is missing. But other than those, the code works as expected. Dave
Thanks for the review Dave, committed to cvs with your suggested fixes. Noura
*** Bug 254010 has been marked as a duplicate of this bug. ***