Bug 1471883

Summary: [Embedded Ansible] URL is not validated while adding new Ansible Repository
Product: Red Hat CloudForms Management Engine Reporter: Kedar Kulkarni <kkulkarn>
Component: UI - OPSAssignee: Zita Nemeckova <znemecko>
Status: CLOSED CURRENTRELEASE QA Contact: luke couzens <lcouzens>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.8.0CC: hkataria, jhardy, kkulkarn, lcouzens, mpovolny, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.9.0Flags: kkulkarn: automate_bug-
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ansible_embed
Fixed In Version: 5.9.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1480001 (view as bug list) Environment:
Last Closed: 2018-03-06 15:50:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Ansible Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1480001    
Attachments:
Description Flags
Adding an Invalid Repo none

Description Kedar Kulkarni 2017-07-17 15:00:47 UTC
Created attachment 1299907 [details]
Adding an Invalid Repo

Description of problem:
When we are adding a new Ansible repository to CFME we do not have a check to validate if the user has entered URL or just a random word in the URL Field of the form. 

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

How reproducible:
100%

Steps to Reproduce:
1.Enable embedded Ansible Role on Appliance 
2.Go to Automate -> Ansible -> Repositories
3.Configuration-> Add new Repositories 
4.Add some random repository as shown in the Screenshot

Actual results:
Add button is clickable and there is no error displayed for incorrect URL Format.

Expected results:
If the URL entered by User is not in a valid Format, then user should see error about correcting the format of URL to making it a Valid URL. Also Add button should be disabled until user corrects all the required fields with appropriate info.


Additional info:

Comment 2 Zita Nemeckova 2017-08-07 09:29:26 UTC
Hi,

I cannot reproduce. Please send me your appliance.

Thanks, 
Zita

Comment 3 luke couzens 2017-08-07 10:13:02 UTC
Hi Zita,

I think this is a RFE bug, if you just try to add a repo with a non resolvable URL aka 'test' there is no validation check performed before enabling the add button.

We should have some validation to prevent this, although the repo add fails there is nothing in the ui which confirms its the url name that is at fault. Even evm.log only shows, [----] E, [2017-08-07T06:02:22.567834 #5821:917134] ERROR -- : AnsibleTowerClient::Middleware::RaiseTowerError Response Body:
{"scm_url"=>["SCM URL is required."]}

Technically we gave it a url it was just invalid.

Also if you give it something like https://test this is added successfully but status sits in 'Failed' as its still not resolvable. to save confusion we just need a validation button that checks the url is accessible and or has playbooks available prior to adding the repo.

Thanks,
Luke

Comment 4 Zita Nemeckova 2017-08-07 12:13:14 UTC
Hi Luke,

it seems that it really doesn't work on 5.8.x so I will look into it. It should only allow URL or SSH input.

Please open a RFE BZ for the validation button because its functionality goes beyond this BZ.

Thanks,
Zita

Comment 8 Kedar Kulkarni 2017-10-11 18:56:00 UTC
Verified in 5.9.0.1, URL field requires either http:// or https:// or valid SSH URL.