Bug 789000 - Inconsistent bakbone and ajax urls
Summary: Inconsistent bakbone and ajax urls
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: CloudForms Cloud Engine
Classification: Retired
Component: aeolus-conductor
Version: 1.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
Assignee: Tzu-Mainn Chen
QA Contact: wes hayutin
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-09 14:46 UTC by Jan Provaznik
Modified: 2012-05-15 22:36 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-15 22:36:25 UTC


Attachments (Terms of Use)
url (256.31 KB, image/png)
2012-02-27 10:58 UTC, Shveta
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2012:0583 0 normal SHIPPED_LIVE new packages: aeolus-conductor 2012-05-15 22:31:59 UTC

Description Jan Provaznik 2012-02-09 14:46:10 UTC
On the root page (pools index), filter view:
when clicking on 'Deployments', 'Instances' or 'Pools' tabs, all these URLs points are served by Pools#index action. e.g. when I click on 'Deployments', AJAX requests fetches list of deployments from:
/pools?details_tab=deployments&only_tab=true&view=filter

but backbone is configured to fetch data from url:
/deployments

This is generally bad, because a user can potentially get 2 different lists of data (since requests are served by 2 different actions).

sql query used for backbone request is:
Deployment.includes(:owner).apply_filters(:preset_filter_id => params[:deployments_preset_filter], :search_filter => params[:deployments_search]). list_for_user(current_user, Privilege::VIEW).where('deployments.pool_id' => @pools).order(sort_column(Deployment, "deployments.name") +' '+ sort_direction).paginate(:page => params[:page] || 1)


Especially paginate at the end causes that only first 25 deployments will be returned when using backbone.


sql query used when clicking on tab:
@deployments = Deployment.apply_filters(:preset_filter_id => params[:deployments_preset_filter], :search_filter => params[:deployments_search]).              list_for_user(current_user, Privilege::VIEW).list(sort_column(Deployment), sort_direction)


Good news is that tabs + backbone are now only on pools index page.

Simpler hotfix solution:
- make sure that both deployments and pools controllers use same sql query when fetching data.

Cleaner solution:
- change backbone route for deployments/instances/pools so it will fetch deployments through the same url which is used when clicking on a tab.
this involves 2 steps:
- proper json response on pools#index action
- update some of our JS funcs which take care of passing URL params - from what I know from Jirka, URL params are not passed properly when doing backbone ajax request

Comment 1 Tzu-Mainn Chen 2012-02-10 06:50:10 UTC
Patch created; I opted for the "cleaner" solution:

https://fedorahosted.org/pipermail/aeolus-devel/2012-February/008776.html

Comment 2 Tzu-Mainn Chen 2012-02-10 14:31:37 UTC
Patch submitted to 1.0-staging:

commit 8c56c1889f7d2dd2ed9ed9631dffa9e33bac7aa3
BZ 789000 change PoolsIndex to always use Conductor.Models.Pools, allowing for more consist

commit 5d3f4b53f4274e147e450ce3b3c27c8a7484fb4a
BZ 789000 fix index to render proper json depending on tab

Comment 3 Steve Linabery 2012-02-14 15:41:37 UTC
5d3f4b5  8c56c18 in aeolus-conductor-0.8.0-26

Comment 4 wes hayutin 2012-02-24 04:33:37 UTC
need a testplan (how can qe verify this)

Comment 5 Tzu-Mainn Chen 2012-02-24 14:51:27 UTC
Here's one that should work:

a) create 30 or so deployments
b) go to the page that Jan describes above; wait for the refresh, and verify that all 30 can still be seen

Comment 6 Shveta 2012-02-27 10:58:11 UTC
All URLs in filter view : Application , Instances and Zones 
show :
 https://hostname/conductor/pools

Tested as per the test plan mentioned also .


verified in
rpm -qa|grep aeolus
aeolus-conductor-0.8.0-36.el6.noarch
rubygem-aeolus-cli-0.3.0-10.el6.noarch
aeolus-conductor-daemons-0.8.0-36.el6.noarch
aeolus-configure-2.5.0-15.el6.noarch
rubygem-aeolus-image-0.3.0-10.el6.noarch
aeolus-all-0.8.0-36.el6.noarch
aeolus-conductor-doc-0.8.0-36.el6.noarch

Comment 7 Shveta 2012-02-27 10:58:42 UTC
Created attachment 566011 [details]
url

Comment 8 errata-xmlrpc 2012-05-15 22:36:25 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.

http://rhn.redhat.com/errata/RHEA-2012-0583.html


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