Bug 561864

Summary: sorting groups by description fails for compatible groups (detected by automation)
Product: [Other] RHQ Project Reporter: John Sefler <jsefler>
Component: No ComponentAssignee: Joseph Marques <jmarques>
Status: CLOSED CURRENTRELEASE QA Contact: Corey Welton <cwelton>
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: cwelton, whayutin
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-12 16:49:49 UTC Type: ---
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: 562594    
Attachments:
Description Flags
Compatible groups sorted by Description^1 ... then why aren't the blank descriptions together? none

Description John Sefler 2010-02-04 14:55:09 UTC
Created attachment 388809 [details]
Compatible groups sorted by Description^1 ...  then why aren't the blank descriptions together?

Description of problem:
Clicking on the column heading (Description) to sort compatible groups does not always sort the table rows in the expected 1st ascending nor descending order.


Version-Release number of selected component (if applicable):
This bug has been observed since I started looking at JON 22, 23, iManage...


How reproducible:
This bug was detected by an automated GUI test script... SortTableByColumnTests.java


Steps to Reproduce:
See the attached screenshot to see the types of compatible groups that are being sorted by Description.  Note that some rows have blank Descriptions.  These rows are not getting sorted together as one would expect.

Comment 1 Joseph Marques 2010-02-09 04:10:30 UTC
Sorting on description is no longer allowed in the new inventory browser.  More useful will be the ability to search the contents of the description.

Comment 2 John Sefler 2010-02-15 13:43:37 UTC
The same sort by Description defects in Comment #1 have been observed for Mixed Groups.

Comment 3 Joseph Marques 2010-02-15 16:19:34 UTC
I notice that the ones on top are manual groups, while the bottom guys are dynagroups.  This phenomenon might be due to one set having a null description, while another has an empty string (or string entirely of whitespace).

Comment 4 Joseph Marques 2010-02-15 16:38:33 UTC
Used your reproduction steps and then confirmed my suspicions by executing:

"select rg.name, rg.description from rhq_resource_group rg"

Using the "/admin/test/sql.jsp" page, which is only accessible as the admin user.

Comment 5 Joseph Marques 2010-02-15 17:44:47 UTC
This is fixed in the search branch ( f6e7d87f6cb8b2a3129b51d83781433abbcfa41d ) and in master ( 0e6f01cbdd137691a4292fe99f0e78ea8c8bf4b5 ).

-----

normalize resource group descriptions:
* add dbupgrade step to convert empty-string descriptions for existing groups into null descriptions
* add hibernate @PrePersist/@PreUpdate hooks to force empty-string descriptions to be persisted as null

note: by converting empty string descriptions to null descriptions, it gives consistent sorting between
databases that treat empty-string and null as distinct entities (e.g. postgres) and those that interpret
empty-string and null as being equivalent (oracle)

Comment 6 Joseph Marques 2010-02-15 17:46:20 UTC
Note: this does not fix the problem immediately.  You must run dbupgrade to fix the rows that are already bad in the database.  Any new rows that are created with empty-string descriptions will automatically be persisted with null instead.

Comment 7 Corey Welton 2010-03-29 17:32:30 UTC
Mass-move to ON_QA

Comment 8 Corey Welton 2010-04-21 14:04:46 UTC
QA Verified -- we seem to be in good shape with these fields following upgrades.

Comment 9 Corey Welton 2010-08-12 16:49:49 UTC
Mass-closure of verified bugs against JON.