Bug 990349

Summary: Group name length is not validated correctly
Product: [Retired] Beaker Reporter: wangjing <jingwang>
Component: generalAssignee: Amit Saha <asaha>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 0.13CC: aigao, asaha, dcallagh, ebaak, llim, qwan, rmancy
Target Milestone: 0.15   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-03 02:27:27 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:

Description wangjing 2013-07-31 03:17:42 UTC
Description of problem:
now group name is limited to 16 characters, but there is no message to indicate, and via CLI, the message need to be corrected.

Version-Release number of selected component (if applicable):
Version - 0.14.0 beaker-devel env

How reproducible:
always

Steps to Reproduce:
1). via CLI, run:
#  bkr group-create --display-name=wjgroup wjgroupnamemorethan16

2). via web UI, add a group which has group name 'wjgroupnamemorethan16'.

Actual results:
1). via CLI, it returned message:'Group created: wjgroupnamemorethan16.'
but actually 'wjgroupnamemoret' is created.

2). via web UI, no message and group name is cut off automatically.

Expected results:
1). via CLI, it should return message: 'Group created: wjgroupnamemoret.' or it's better to return 'Group name limit 16 characters' for indicating.

2). via web UI, we could add a text behind the group name box indicating the limit.

Additional info:

Comment 2 Dan Callaghan 2013-07-31 03:59:30 UTC
Beaker needs to validate the group name length instead of letting MySQL silently truncate it.

Comment 3 Dan Callaghan 2013-07-31 03:59:40 UTC
*** Bug 990351 has been marked as a duplicate of this bug. ***

Comment 4 Amit Saha 2013-08-01 03:55:48 UTC
On Gerrit: http://gerrit.beaker-project.org/#/c/2140/1

Comment 5 Amit Saha 2013-08-02 06:06:58 UTC
As it turns out, we already had Group name validation in place for the Web UI, but it was wrongly setup to allow 255 characters, whereas the database allowed only 16. The patch increases the group length name in the tg_group table to 255 characters. Validation did not exist for the XML-RPC interface and has been added.

Comment 9 wangjing 2013-08-06 06:05:52 UTC
verify on beaker-devel(20130806)-->pass
steps:
1. via CLI:

bkr group-modify --group-name=<morethan255charactersname> groupname
bkr group-create <morethan255characters-group name>


bkr group-modify --group-name=<255characterslongname> groupname
bkr group-create <255characterslong-group name>


2. via webUI:

1)add a new group with a group name more than 255 characters.
2)modify a group name to more than 255 characters.

3)add a new group with a group name which is 255 characters long.
4)modify a group name to a name which is 255 characters long.

results:
return proper warning text and limit to 255 characters.

Comment 10 Nick Coghlan 2013-10-03 02:27:27 UTC
Beaker 0.15 has been released.

Comment 11 Dan Callaghan 2014-03-26 00:53:33 UTC
*** Bug 962646 has been marked as a duplicate of this bug. ***