CompareCoverageAction incorrectly handles some types of SSH URL.
For example, valid ssh URLs come in 2 flavors:
user@domain:path (This is the format that the Github website provides when you click on the "clone" button)
ssh://user@domain/path (This one is not provided by the Github website, but is absolutely valid for accessing github repos. For example, try running git clone ssh://git@github.com/jenkinsci/ghprb-plugin.git and see that it works perfectly)
Anyway, when passing the git URL as an argument to CompareCoverageAction, the URL argument eventually makes its way to GitUtils.getUserRepo. This function uses one of 2 regex patterns: HTTP_GITHUB_USER_REPO_PATTERN or SSH_GITHUB_USER_REPO_PATTERN.
SSH_GITHUB_USER_REPO_PATTERN only accounts for the 1st flavor of ssh URL.
This is a problem, and GitUtils.getUserRepo should be able to handle urls in the ssh://user@domain/path format.
If this cannot be fixed, please at least document it.
Caused: java.io.IOException: Could not retrieve GitHub repository named //git@github.myCompany.com/Organization/Repo (Do you have properly set 'GitHub project' field in job configuration?)
Expected result:
The plugin correctly gets the repo and completes the code coverage
CompareCoverageAction
incorrectly handles some types of SSH URL.For example, valid ssh URLs come in 2 flavors:
user@domain:path
(This is the format that the Github website provides when you click on the "clone" button)ssh://user@domain/path
(This one is not provided by the Github website, but is absolutely valid for accessing github repos. For example, try runninggit clone ssh://git@github.com/jenkinsci/ghprb-plugin.git
and see that it works perfectly)Anyway, when passing the git URL as an argument to
CompareCoverageAction
, the URL argument eventually makes its way toGitUtils.getUserRepo
. This function uses one of 2 regex patterns:HTTP_GITHUB_USER_REPO_PATTERN
orSSH_GITHUB_USER_REPO_PATTERN
.SSH_GITHUB_USER_REPO_PATTERN
only accounts for the 1st flavor of ssh URL.This is a problem, and
GitUtils.getUserRepo
should be able to handle urls in thessh://user@domain/path
format.If this cannot be fixed, please at least document it.
Here is my repro case:
Actual result:
Expected result: The plugin correctly gets the repo and completes the code coverage