Bug 1471883 - [Embedded Ansible] URL is not validated while adding new Ansible Repository
Summary: [Embedded Ansible] URL is not validated while adding new Ansible Repository
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.9.0
Assignee: Zita Nemeckova
QA Contact: luke couzens
URL:
Whiteboard: ansible_embed
Depends On:
Blocks: 1480001
TreeView+ depends on / blocked
 
Reported: 2017-07-17 15:00 UTC by Kedar Kulkarni
Modified: 2018-03-06 15:50 UTC (History)
7 users (show)

Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1480001 (view as bug list)
Environment:
Last Closed: 2018-03-06 15:50:56 UTC
Category: Bug
Cloudforms Team: Ansible
Target Upstream Version:
Embargoed:
kkulkarn: automate_bug-


Attachments (Terms of Use)
Adding an Invalid Repo (49.66 KB, image/png)
2017-07-17 15:00 UTC, Kedar Kulkarni
no flags Details

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.


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