Bug 1321048 - 1B: Can modify Environment Path label such that creation fails
Summary: 1B: Can modify Environment Path label such that creation fails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Quickstart Cloud Installer
Classification: Red Hat
Component: WebUI
Version: 1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ga
: 1.0
Assignee: jmagen@redhat.com
QA Contact: Tasos Papaioannou
URL:
Whiteboard:
Depends On:
Blocks: qci-sprint-17
TreeView+ depends on / blocked
 
Reported: 2016-03-24 14:32 UTC by Matt Reid
Modified: 2016-09-13 16:27 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-13 16:27:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Error message when label prevents the creation of a new environment path (38.11 KB, image/png)
2016-03-24 14:33 UTC, Matt Reid
no flags Details
After the error, the bad Label persists when you reopen the New Environment Path dialog (48.22 KB, image/png)
2016-03-24 14:34 UTC, Matt Reid
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:1862 0 normal SHIPPED_LIVE Red Hat Quickstart Installer 1.0 2016-09-13 20:18:48 UTC

Description Matt Reid 2016-03-24 14:32:25 UTC
Description of problem:
If you navigate to 1B Configure Lifecycle Environment, and create a New Environment Path, while we replace invalid characters in name when we automatically create the label (based on what they name it), we don't appear to do any checking of characters that are added to Label by the user directly. You can freely edit the Label field, and put those special characters back in. This causes issues when you go to save, throwing an error in Satellite: "error saving environmentError: The adapter rejected the commit because it was invalid". If you try to create a New Environment Path again, the name field will be blank, but the label field will be whatever that failed commit contained.

We should be preventing invalid characters from being entered there, or at least prevent submission of the dialog while there are invalid characters, so we can avoid this error case.

Version-Release number of selected component (if applicable):
TP3

How reproducible:
100%

Steps to Reproduce:
1. create new deployment
2. proceed to 1b Configure Lifecycle Environment
3. Select After manually publishing them
4. Click New Environment Path
5. Enter something for name, and then edit Label to include a special character, such as !, try to save

Actual results:
Error message thrown, environment path not created

Expected results:
For dialog to catch invalid characters and not let the user submit that dialog with bad data in it, so we can avoid this error

Additional info:

Comment 1 Matt Reid 2016-03-24 14:33:28 UTC
Created attachment 1139999 [details]
Error message when label prevents the creation of a new environment path

Comment 2 Matt Reid 2016-03-24 14:34:51 UTC
Created attachment 1140000 [details]
After the error, the bad Label persists when you reopen the New Environment Path dialog

Comment 3 Erik Nelson 2016-06-22 16:09:36 UTC
Already fixed, label field has been disabled.

Comment 4 Tasos Papaioannou 2016-06-28 19:01:12 UTC
The logic for lifecycle environment names and labels on 1B. Update Availability is inconsistent with the logic used under the Satellite's Content > Lifecycle Environments tab.

1.) If I create a new environment under Content > Lifecycle Environments > New Environment Path, I can use spaces and punctuation marks. The label replaces them with underscores. For example:

Name: Fusor<space>environment<space>1,<space>for<space>fun!
Label: Fusor_environment_1__for_fun_

If I try to create the same name under 1B. Update Availability > After manually publishing them > New Environment Path, I get the warning message after typing the first 'e':

Name: Fusor<space>e
-> 
This field must contain only 'A-Z', 'a-z', '0-9', '_' or '-' characters.

2.) If I create an environment under Content > Lifecycle Environments, any leading or trailing spaces I enter in the name are trimmed from the name and label. They get trimmed from the name, but not from the label, when creating the environment in 1B. Update Availability. For example, entering a name of "<space>test<space>" generates a label of "test" in Content > Lifecycle Environments, and a label of "_test_" in 1B. Update Availability.

3.) 1B. Update Availability generates a label with all letters lowercased, but Content > Lifecycle Environments. E.g., an environment name of "Test" gets a label of "test" in the former, but "Test" in the latter.

Comment 5 jmagen@redhat.com 2016-07-14 09:58:02 UTC
Fixed https://github.com/fusor/fusor/pull/1036

Comment 6 John Matthews 2016-07-18 21:12:50 UTC
QCI-1.2-RHEL-7-20160718.t.0

Comment 7 Tasos Papaioannou 2016-07-20 15:14:15 UTC
None of the issues in https://bugzilla.redhat.com/show_bug.cgi?id=1321048#c4 have been fixed in QCI-1.2-RHEL-7-20160718.t.0.

Comment 13 jmagen@redhat.com 2016-07-21 20:08:50 UTC
Tasos, try again please. Maybe you were on a system where the commit was not merged. I just tried again and it seems fixed on my system.

Comment 15 Tasos Papaioannou 2016-07-22 13:47:35 UTC
The fixes are in QCI-1.2-RHEL-7-20160720.t.0. Marking as verified.

Comment 17 errata-xmlrpc 2016-09-13 16:27:28 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.

https://access.redhat.com/errata/RHEA-2016:1862


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