Bug 1273825

Summary: Template sorting by version is broken
Product: [oVirt] ovirt-engine Reporter: jniederm
Component: Frontend.WebAdminAssignee: jniederm
Status: CLOSED CURRENTRELEASE QA Contact: Lucie Leistnerova <lleistne>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.0.0CC: ahadas, bugs, jniederm, lleistne, lsvaty, michal.skrivanek, tjelinek
Target Milestone: ovirt-4.1.1Flags: rule-engine: ovirt-4.1+
rule-engine: planning_ack+
rule-engine: devel_ack+
lsvaty: testing_ack+
Target Release: 4.1.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-21 09:35:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1284973    
Bug Blocks:    
Attachments:
Description Flags
screenshot
none
bad_order
none
bad_order_2 none

Description jniederm 2015-10-21 10:50:06 UTC
Created attachment 1085083 [details]
screenshot

Description of problem:
Templates main tab > sorting by version columns is broken

Version-Release number of selected component (if applicable):
4.0 master, commit 0614c05

How reproducible:
100%

Steps to Reproduce:
1. Create multiple sub-versions of one template
2. Sort templates by version column

Actual results:
(see screenshot), version are not sorted, the order remains same for both asc and desc

Expected results:
proper sorting

Comment 1 Michal Skrivanek 2016-04-22 14:46:39 UTC
pushed out due to capacity reasons

Comment 2 Sandro Bonazzola 2016-12-12 13:58:27 UTC
The fix for this issue should be included in oVirt 4.1.0 beta 1 released on December 1st. If not included please move back to modified.

Comment 3 Lucie Leistnerova 2016-12-15 15:53:48 UTC
Order changes, but it doesn't seem logical.

In DESC order template 'test' without version stays first. 
If there are template subversions with name then 'Blank' template goes between 'test' templates in ASC order.
See attachment.

tested in ovirt-engine-4.1.0-0.2.master.20161215130926.git1e1810e.el7.centos.noarch

Comment 4 Lucie Leistnerova 2016-12-15 15:54:33 UTC
Created attachment 1232239 [details]
bad_order

Comment 5 Lucie Leistnerova 2017-01-16 14:55:58 UTC
The behaviour is still not logical.

tested in ovirt-engine-webadmin-portal-4.1.0-0.4.master.20170115141203.git30e806b.el7.centos.noarch

Blank stays always first.
Template centos_7.3 is mixed with no subversion and subversions with Sub version names, last stays subversions with no Sub version names. And test_template is somewhere between.
It changes order of only the two last subversions with no Sub version name. 
See attachment.

There could by 2 ways of ordering: only by version or name + version. I prefer the second one.

So the order in my case should be

up:
Blank
centos_7.3
centos_7.3    (3)
centos_7.3    (5)
centos_7.3    aaa (4)
centos_7.3    bbb (2)
test_template

down:
test_template
centos_7.3    bbb (2)
centos_7.3    aaa (4)
centos_7.3    (5)
centos_7.3    (3)
centos_7.3
Blank

Comment 6 Lucie Leistnerova 2017-01-16 14:56:37 UTC
Created attachment 1241256 [details]
bad_order_2

Comment 7 jniederm 2017-01-20 18:17:45 UTC
Intended behavior:
* when 'Name' column is clicked, rows are sorted by base template name, then by version name, then by version number.
* when 'Version' column is clicked, rows are sorted by base template name, then by version number

Comment 8 Lucie Leistnerova 2017-01-23 08:32:54 UTC
Thank you for the explanation.

So it should be:

up:
Blank
centos_7.3
centos_7.3    bbb (2)
centos_7.3    (3)
centos_7.3    aaa (4)
centos_7.3    (5)
test_template

down:
test_template
centos_7.3    (5)
centos_7.3    aaa (4)
centos_7.3    (3)
centos_7.3    bbb (2)
centos_7.3
Blank

Comment 9 Arik 2017-01-25 15:42:05 UTC
Jakub, I discussed this with Eldan and it doesn't make much sense to make the version column sortable. In reality we don't expect people to have more than 5-10 versions (how many sub-version are relevant for a specific template? when you reach 10 versions, the older versions could probably be removed). Maybe a better solution would be to simply prevent sorting by the template's version?

Comment 10 jniederm 2017-01-25 16:12:58 UTC
I swapped the second sorting criterion so currently the patch is like this:
[Name] -> base name, version number
[Version] -> base name, version name, version number

I agree that sorting by version name may not be useful that often but based on discussion with QE I suggest to keep that functionally. Especially when it's basically done and so effortless.

Comment 11 jniederm 2017-01-31 14:48:14 UTC
Based on conversation with Eldan the solution should be:
* Version column won't be sortable to not confuse users
* Name column will sort by base version name, then version name (and since there may be two subversions of the same name then even by version number).

Comment 12 Sandro Bonazzola 2017-02-01 16:02:15 UTC
oVirt 4.1.0 GA has been released, re-targeting to 4.1.1.
Please check if this issue is correctly targeted or already included in 4.1.0.

Comment 13 Lucie Leistnerova 2017-02-13 13:49:15 UTC
Can't order by Version.
Order by Name changes the order as expected.

verified in ovirt-engine-webadmin-portal-4.1.1-0.1.el7.noarch