Bug 1826664

Summary: Even though Git Repo is not reachable, user can create the build
Product: OpenShift Container Platform Reporter: Debsmita Santra <dsantra>
Component: Dev ConsoleAssignee: Debsmita Santra <dsantra>
Status: CLOSED ERRATA QA Contact: Gajanan More <gamore>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.5CC: aos-bugs, cvogt, malonso, nmukherj, sgarciam, tommi.tuura
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-13 17:30:08 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:
Attachments:
Description Flags
console screenshot validating a repository none

Description Debsmita Santra 2020-04-22 09:25:26 UTC
Description of problem:
User is able to create an application even when the git repo url is unreachable

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

How reproducible:
Always

Steps to Reproduce:
1. Go to +Add page
2. Click on From Git
3. Enter URL: 'https://github.com/gajanan194' and do not add any repo at the end and click outside and you will observe that it is showing error message as 'Git repository is not reachable.'
4. Enter all the required details and you will see that it has created the build even though it is not reachable.

Actual results:
Submit button is enabled. user can click on it and create an application

Expected results:
Submit button should be disabled if Git url is unreachable

Additional info:

Comment 3 Gajanan More 2020-05-12 06:01:59 UTC
I have validated the bugzilla
Build: 4.5.0-0.ci-2020-05-11-234936
Browser: Google Chrome Version 81.0.4044.129
Marking this as verified.

Comment 6 Debsmita Santra 2020-05-29 15:27:43 UTC
When the URL is unreachable, we don't have the capability to decide whether it's invalid or a private one because in both cases it will show the same error.

Comment 7 Sergio G. 2020-05-29 15:32:57 UTC
So the only test done is reaching the URL? Can you point me to the code which makes the validation so I can make some test?

Comment 8 Sergio G. 2020-05-29 15:38:34 UTC
Please find attached the screenshot which makes some connections to api.github.com as I type my repository. It seems that it makes something more than just reaching the URL. If the validation is going to fail for some reason and the button is going to be disable the validation should be clarified in the documentation so users are aware of them.

Comment 9 Sergio G. 2020-05-29 15:39:07 UTC
Created attachment 1693417 [details]
console screenshot validating a repository

Comment 10 Debsmita Santra 2020-05-29 17:51:54 UTC
https://github.com/openshift/console/blob/e9536bd6d58ecaeacde5b52ceb07daa0dd776362/frontend/packages/dev-console/src/components/import/git/GitSection.tsx#L45 this is the service that we call to check if the repo is reachable. The git service that we are using doesn't help us distinguish between the scenarios: the git URL is unreachable because it's a private repo and the git URL is unreachable because the repo doesn't exist. So as part of this bug fix, we have tried to ensure that the builder image is not set if the user never manually touched the field. The form will always wait for validation of the URL and auto/manual selection of the builder image.

I understand that the error message is misleading and for that, there is an action item in our backlog where the UX is going to help us with a better message having an instruction to create the source secret.

Comment 14 errata-xmlrpc 2020-07-13 17:30:08 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/RHBA-2020:2409