Bug 1258927

Summary: UI: Reports explorer rebuilds trees on every transaction after Queue Report button is pressed once in UI.
Product: Red Hat CloudForms Management Engine Reporter: Harpreet Kataria <hkataria>
Component: UI - OPSAssignee: Harpreet Kataria <hkataria>
Status: CLOSED ERRATA QA Contact: Pete Savage <psavage>
Severity: high Docs Contact:
Priority: high    
Version: 5.4.0CC: cpelland, dclarizi, hkataria, jhardy, mfeifer, mpovolny, obarenbo
Target Milestone: GAKeywords: ZStream
Target Release: 5.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.5.0.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1258933 (view as bug list) Environment:
Last Closed: 2015-12-08 13:29:08 UTC Type: Bug
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: 1258933    

Description Harpreet Kataria 2015-09-01 14:25:44 UTC
Description of problem: Reports explorer rebuilds trees on every transaction after Queue Report button is pressed once in UI.


Version-Release number of selected component (if applicable):


How reproducible: 100%


Steps to Reproduce:
1. Go to Reports Explorer
2. Press "Queue" button to run a report
3. After that Reports explorer rebuilds trees in Reports explorer on each transaction. 

Actual results: Trees are being rebuilt on each transaction


Expected results: Trees should only be rebuilt when there is a new report result record in the database that was created after the trees were built last time.


Additional info: This can be verified by the time each transaction took before/after the fix.

Comment 2 CFME Bot 2015-09-02 14:20:19 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/1137496321b6cf4d1c77c3d332e690609a7498ad

commit 1137496321b6cf4d1c77c3d332e690609a7498ad
Author:     Harpreet Kataria <hkataria>
AuthorDate: Tue Sep 1 11:05:19 2015 -0400
Commit:     Harpreet Kataria <hkataria>
CommitDate: Tue Sep 1 13:37:34 2015 -0400

    Fixed code to not rebuild trees on each transaction in reports explorer
    
    - Fixed code that was rebuilding reports trees on every transaction after user pressed Queue report to run button once in UI, code was not setting rep_tree_build_time correctly in some of the places, removed setting of rep_tree_build_time from other places in code and moved it into rebuild_trees method.
    - added spec tests around rebuild_trees method and replace_right_cell method to verify changes.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1258927
    https://bugzilla.redhat.com/show_bug.cgi?id=1258933

 app/controllers/report_controller.rb               |   8 +-
 app/controllers/report_controller/menus.rb         |   1 -
 app/controllers/report_controller/reports.rb       |   2 -
 .../report_controller/reports/editor.rb            |   1 -
 app/controllers/report_controller/saved_reports.rb |   1 -
 spec/controllers/report_controller_spec.rb         | 100 +++++++++++++++++++++
 6 files changed, 105 insertions(+), 8 deletions(-)

Comment 3 CFME Bot 2015-09-03 19:29:24 UTC
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=ae9fd1fd0104d0f87bc9d4b47e675c14c714d1ee

commit ae9fd1fd0104d0f87bc9d4b47e675c14c714d1ee
Author:     Harpreet Kataria <hkataria>
AuthorDate: Wed Sep 2 12:51:57 2015 -0400
Commit:     Harpreet Kataria <hkataria>
CommitDate: Thu Sep 3 14:19:52 2015 -0400

    Fixed code to not rebuild trees on each transaction in reports explorer
    
    - Fixed code that was rebuilding reports trees on every transaction after user pressed Queue report to run button once in UI, code was not setting rep_tree_build_time correctly in some of the places, removed setting of rep_tree_build_time from other places in code and moved it into rebuild_trees method.
    - added spec tests around rebuild_trees method and replace_right_cell method to verify changes.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1258927
    https://bugzilla.redhat.com/show_bug.cgi?id=1258933

 vmdb/app/controllers/report_controller.rb          |   8 +-
 vmdb/app/controllers/report_controller/menus.rb    |   1 -
 vmdb/app/controllers/report_controller/reports.rb  |   2 -
 .../report_controller/reports/editor.rb            |   1 -
 .../controllers/report_controller/saved_reports.rb |   1 -
 vmdb/spec/controllers/report_controller_spec.rb    | 100 +++++++++++++++++++++
 6 files changed, 105 insertions(+), 8 deletions(-)

Comment 4 CFME Bot 2015-09-03 19:29:30 UTC
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=ad38ad1a150c9fb4b2f89bce48571883a33c3212

commit ad38ad1a150c9fb4b2f89bce48571883a33c3212
Merge: 43eda55 ae9fd1f
Author:     Dan Clarizio <dclarizi>
AuthorDate: Thu Sep 3 15:26:27 2015 -0400
Commit:     Dan Clarizio <dclarizi>
CommitDate: Thu Sep 3 15:26:27 2015 -0400

    Merge branch '54z_bz_1258933' into '5.4.z'
    
    Fixed code to not rebuild trees on each transaction in reports explorer
    
    - Fixed code that was rebuilding reports trees on every transaction after user pressed Queue report to run button once in UI, code was not setting rep_tree_build_time correctly in some of the places, removed setting of rep_tree_build_time from other places in code and moved it into rebuild_trees method.
    - added spec tests around rebuild_trees method and replace_right_cell method to verify changes.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1258927
    https://bugzilla.redhat.com/show_bug.cgi?id=1258933
    
    @dclarizio please review, clean patch was applied.
    Original PR: https://github.com/ManageIQ/manageiq/pull/4149
    
    See merge request !242

 vmdb/app/controllers/report_controller.rb          |   8 +-
 vmdb/app/controllers/report_controller/menus.rb    |   1 -
 vmdb/app/controllers/report_controller/reports.rb  |   2 -
 .../report_controller/reports/editor.rb            |   1 -
 .../controllers/report_controller/saved_reports.rb |   1 -
 vmdb/spec/controllers/report_controller_spec.rb    | 100 +++++++++++++++++++++
 6 files changed, 105 insertions(+), 8 deletions(-)

Comment 6 CFME Bot 2015-09-08 22:02:26 UTC
Detected commit referencing this ticket while ticket status is POST.

Comment 8 CFME Bot 2015-09-08 22:03:56 UTC
Detected commit referencing this ticket while ticket status is POST.

Comment 10 CFME Bot 2015-09-08 22:04:52 UTC
Detected commit referencing this ticket while ticket status is POST.

Comment 11 Pete Savage 2015-10-05 15:00:34 UTC
Can you please give information on how we can verify that the tree is/is not being rebuilt. Do we have click on the reload/refresh button?

Comment 12 Harpreet Kataria 2015-10-19 15:47:57 UTC
Pete,

This is more of a performance fix, you will not see any visible UI changes. In Order to recreate: Create a Report then Queue the report to run. After this step you can go to Reports editor and change tabs, then in log verify before/after times should differ. Before it was building tree on each transaction and now it only rebuilds the tree when it needs to.

After Queuing a report you should see each click in Reports explorer will take longer time to load the screen before the fix. Let me know if you have more questions.

Thanks,
~Harpreet

Comment 13 Pete Savage 2015-10-26 21:13:22 UTC
I believe this is fixed in 5.5.0.7

Comment 15 errata-xmlrpc 2015-12-08 13:29:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:2551