Bug 2038244 - Import from git ignore the given servername and could not validate On-Premises GitHub and BitBucket installations
Summary: Import from git ignore the given servername and could not validate On-Premise...
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Dev Console
Version: 4.8
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.11.0
Assignee: Mohammed Saud
QA Contact: spathak@redhat.com
Olivia Payne
Depends On:
Blocks: 2114833
TreeView+ depends on / blocked
Reported: 2022-01-07 15:49 UTC by Christoph Jerolimov
Modified: 2022-08-10 10:42 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: For selfhosted GitHub & Bitbucket instances, the git detection feature used the managed instance APIs to get repository info. Consequence: Detection for repositories from selfhosted GitHub & Bitbucket instances did not work. Fix: Switch to using the selfhosted instance's API for fetching repository information. Result: Detection for selfhosted GitHub & Bitbucket instance repositories works as expected.
Clone Of:
Last Closed: 2022-08-10 10:41:42 UTC
Target Upstream Version:

Attachments (Terms of Use)
4.8-github-wrong-api.png (46.63 KB, image/png)
2022-01-07 15:51 UTC, Christoph Jerolimov
no flags Details
4.8-gitlab-right-api.png (46.87 KB, image/png)
2022-01-07 15:51 UTC, Christoph Jerolimov
no flags Details
4.8-bitbucket-wrong-api.png (45.89 KB, image/png)
2022-01-07 15:52 UTC, Christoph Jerolimov
no flags Details

System ID Private Priority Status Summary Last Updated
Github openshift console pull 10827 0 None open Bug 2038244: Use hostname from provided git url when making git api calls 2022-01-12 16:10:11 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 10:42:09 UTC

Description Christoph Jerolimov 2022-01-07 15:49:51 UTC
Description of problem:
When using a custom git servername the "Import from git"-flow tries to validate the git repository and if possible make a build strategy suggestion.

If the URL doesn't contain an indicator if the git provider is one of the supported providers (at the moment GitHub, GitLab, or BitBucket) it shows a dropdown so that the user can select the git provider.

If the user selects this git provider, it ignores the given servername and fetches data from the 'official public API' instead. With this, the user doesn't have the option to use an On-Premises GitLab and BitBucket installation.

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

Verified on 4.8, 4.9 and 4.10 (master branch, tested with fbbf49d71c73ab56d23180de9b4eb6ca3e40a94c)
Don't tested older versions yet

How reproducible:

Steps to Reproduce:
1. Switch to developer perspective
2. Navigate to Add > Import from Git
3. Open the browser network inspector
4. Enter a Git URL like https://git.mycompany.com/
5. Switch between the Git providers, if needed change the git URL to trigger a new API call

Actual results:
- When selecting GitHub and BitBucket the network calls always go to api.github.com and api.bitbucket.org (both wrong)
- When selecting GitLab the network inspector shows an API call to git.mycompany.com (correct)

Expected results:
- For each provider the URL should change, but the actual request should always go to the given servername.

Additional info:

Comment 1 Christoph Jerolimov 2022-01-07 15:51:23 UTC
Created attachment 1849484 [details]

Comment 2 Christoph Jerolimov 2022-01-07 15:51:39 UTC
Created attachment 1849485 [details]

Comment 3 Christoph Jerolimov 2022-01-07 15:52:04 UTC
Created attachment 1849486 [details]

Comment 7 Christoph Jerolimov 2022-04-25 08:56:54 UTC
Verified on 4.11.0-0.nightly-2022-04-24-135651

Re-tested some of the URLs from https://github.com/openshift/console/pull/10827#issuecomment-1090130677

Comment 10 errata-xmlrpc 2022-08-10 10:41:42 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 (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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