Bug 1273825 - Template sorting by version is broken
Template sorting by version is broken
Product: ovirt-engine
Classification: oVirt
Component: Frontend.WebAdmin (Show other bugs)
Unspecified Unspecified
unspecified Severity medium (vote)
: ovirt-4.1.1
: 4.1.1
Assigned To: jniederm
Lucie Leistnerova
Depends On: 1284973
  Show dependency treegraph
Reported: 2015-10-21 06:50 EDT by jniederm
Modified: 2017-04-21 05:35 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-04-21 05:35:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: Virt
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑4.1+
rule-engine: planning_ack+
rule-engine: devel_ack+
lsvaty: testing_ack+

Attachments (Terms of Use)
screenshot (10.60 KB, image/png)
2015-10-21 06:50 EDT, jniederm
no flags Details
bad_order (20.83 KB, image/png)
2016-12-15 10:54 EST, Lucie Leistnerova
no flags Details
bad_order_2 (15.22 KB, image/png)
2017-01-16 09:56 EST, Lucie Leistnerova
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 60469 master MERGED ui: Template version sort not working properly. 2016-07-11 10:12 EDT
oVirt gerrit 69221 master MERGED core: set blank template version 2016-12-28 04:09 EST
oVirt gerrit 69225 ovirt-engine-4.1 MERGED core: set blank template version 2016-12-28 05:15 EST
oVirt gerrit 70895 master MERGED core: Template sorting improved 2017-02-01 03:42 EST
oVirt gerrit 70901 master MERGED core: Sorting by multiple db columns 2017-02-01 03:07 EST
oVirt gerrit 71512 ovirt-engine-4.1 MERGED core: Sorting by multiple db columns 2017-02-06 06:46 EST
oVirt gerrit 71513 ovirt-engine-4.1 MERGED core: Template sorting improved 2017-02-06 06:46 EST

  None (edit)
Description jniederm 2015-10-21 06:50:06 EDT
Created attachment 1085083 [details]

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:

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 10:46:39 EDT
pushed out due to capacity reasons
Comment 2 Sandro Bonazzola 2016-12-12 08:58:27 EST
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 10:53:48 EST
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 10:54 EST
Created attachment 1232239 [details]
Comment 5 Lucie Leistnerova 2017-01-16 09:55:58 EST
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

centos_7.3    (3)
centos_7.3    (5)
centos_7.3    aaa (4)
centos_7.3    bbb (2)

centos_7.3    bbb (2)
centos_7.3    aaa (4)
centos_7.3    (5)
centos_7.3    (3)
Comment 6 Lucie Leistnerova 2017-01-16 09:56 EST
Created attachment 1241256 [details]
Comment 7 jniederm 2017-01-20 13:17:45 EST
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 03:32:54 EST
Thank you for the explanation.

So it should be:

centos_7.3    bbb (2)
centos_7.3    (3)
centos_7.3    aaa (4)
centos_7.3    (5)

centos_7.3    (5)
centos_7.3    aaa (4)
centos_7.3    (3)
centos_7.3    bbb (2)
Comment 9 Arik 2017-01-25 10:42:05 EST
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 11:12:58 EST
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 09:48:14 EST
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 11:02:15 EST
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 08:49:15 EST
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

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