[JIRA] (JENKINS-58862) Github Branch Source Plugin always references https://api.github.com

0 views
Skip to first unread message

w.gillaspy@gmail.com (JIRA)

unread,
Aug 8, 2019, 11:39:06 AM8/8/19
to jenkinsc...@googlegroups.com
William Gillaspy created an issue
 
Jenkins / Bug JENKINS-58862
Github Branch Source Plugin always references https://api.github.com
Issue Type: Bug Bug
Assignee: Unassigned
Components: github-branch-source-plugin
Created: 2019-08-08 15:38
Environment: Jenkins ver. 2.189, Github Branch Plugin ver. 2.5.5
Priority: Major Major
Reporter: William Gillaspy

Lost ability to choose self hosted github enterprise api URL (API endpoint field) in version 2.5.5.

Expect to be able to set "API endpoint" (apiURL in the config.xml) to company's git enterprise api url via the project setup.  In version 2.5.5 apiURL is always set to https://api.github.com

I'm able to work around this problem by cloning existing projects.   However, making a new project does not allow me to choose our locally host github enterprise server (the API endpoint field is gone in 2.5.5) so the project fails on repository scan since it's pointed to https://api.github.com by default instead of [https://git.company.com/api/v3

StartedStarted[Thu Aug 08 10:52:57 EDT 2019] Starting branch indexing...ERROR: [Thu Aug 08 10:52:57 EDT 2019] Could not update folder level actions from source 27a03b35-22a6-4d0c-a9f6-bc0dceb6e97bhudson.AbortException: Invalid scan credentials BUSINESS_USER/****** (BUSINESS_USER_PASS_AS_TOKEN) to connect to https://api.github.com, skipping at org.jenkinsci.plugins.github_branch_source.Connector.checkConnectionValidity(Connector.java:553) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieveActions(GitHubSCMSource.java:1874) at jenkins.scm.api.SCMSource.fetchActions(SCMSource.java:848) at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:592) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:164) at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1026) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)[Thu Aug 08 10:52:57 EDT 2019] Finished branch indexing. Indexing took 66 msFATAL: Invalid scan credentials BUSINESS_USER/****** (BUSINESS_USER_PASS_AS_TOKEN) to connect to https://api.github.com, skippingFinished: FAILURE|https://git.company.com/api/v3]

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

vivek.pandey@gmail.com (JIRA)

unread,
Aug 8, 2019, 10:19:03 PM8/8/19
to jenkinsc...@googlegroups.com
Vivek Pandey commented on Bug JENKINS-58862
 
Re: Github Branch Source Plugin always references https://api.github.com

William Gillaspy Can you describe the steps to reproduce this problem? Its not clear whether you are creating Multi-branch pipeline or GitHub org folder job using GitHub site for your GitHub enterprise server or thru some other means.

w.gillaspy@gmail.com (JIRA)

unread,
Aug 9, 2019, 8:35:02 AM8/9/19
to jenkinsc...@googlegroups.com

w.gillaspy@gmail.com (JIRA)

unread,
Aug 9, 2019, 8:35:02 AM8/9/19
to jenkinsc...@googlegroups.com

w.gillaspy@gmail.com (JIRA)

unread,
Aug 9, 2019, 8:37:02 AM8/9/19
to jenkinsc...@googlegroups.com
William Gillaspy commented on Bug JENKINS-58862
 
Re: Github Branch Source Plugin always references https://api.github.com

Hello Vivek Pandey.  Sorry about that.

Steps:

New Item > Multi-branch Pipeline > Branch Source > Add source > GitHub

2.5.4 -> Allows user to choose API Endpoint
2.5.5 -> API Endpoint field is missing, defaults to  https://api.github.com in the config.xml

I've added some images to illustrate the change.

Thanks! And please let me know if I need to clarify further.

 

dnusbaum@cloudbees.com (JIRA)

unread,
Aug 9, 2019, 9:23:02 AM8/9/19
to jenkinsc...@googlegroups.com

William Gillaspy If you enter something like https://git.company.com/owner/repo into the Repository HTTPS URL field, it is supposed to compute the API URI as https://git.company.com/api/v3/.

If that doesn't work, you should be able to select "Repository Scan - Deprecated Visualization", and that should have the same "API endpoint" dropdown as before. Is that not working for you either?

w.gillaspy@gmail.com (JIRA)

unread,
Aug 9, 2019, 9:49:03 AM8/9/19
to jenkinsc...@googlegroups.com

Devin Nusbaum I didn't put two and two together on the Repository Scan radio button.  That does work. 

Since that feature is deprecated, what is the recommendation for setting the API endpoint in the future?

Thank y'all for the assistance.

dnusbaum@cloudbees.com (JIRA)

unread,
Aug 9, 2019, 10:00:03 AM8/9/19
to jenkinsc...@googlegroups.com

William Gillaspy Like I mentioned, it's supposed to work automatically if you specify a non-GitHub repository URL, so if it doesn't that's a bug and we'll look into fixing it.

w.gillaspy@gmail.com (JIRA)

unread,
Aug 9, 2019, 10:16:04 AM8/9/19
to jenkinsc...@googlegroups.com

Devin Nusbaum Yes, it does not seem to be computing the API URI when the local github URL is put into the Repository HTTPS URL field.

The only other information I can think to add is that I am using credentials.  Which always fails since it's trying against https://api.github.com instead of https://git.company.com/api/v3/ even when the Repository HTTPS URL is set to https://git.company.com/owner/repo

kshultz@cloudbees.com (JIRA)

unread,
Aug 9, 2019, 10:56:02 AM8/9/19
to jenkinsc...@googlegroups.com

William Gillaspy - when you supply your remote repository URL via the new UI, are you giving it an API URL (e.g., https://api.your-ghe-server.com/api/v3/...) or the more typical URL that you'd get from the "Clone or download" button from the GitHub Enterprise UI?

There's definitely a problem here. Probably two. Just trying to narrow down the scope of it.

kshultz@cloudbees.com (JIRA)

unread,
Aug 9, 2019, 10:57:02 AM8/9/19
to jenkinsc...@googlegroups.com

w.gillaspy@gmail.com (JIRA)

unread,
Aug 9, 2019, 11:05:02 AM8/9/19
to jenkinsc...@googlegroups.com
William Gillaspy commented on Bug JENKINS-58862
 
Re: Github Branch Source Plugin always references https://api.github.com

Karl Shultz I'm using the "Clone or Download" button and copying the "Clone with HTTPS" url of the repository.

Example: https://git.company.com/TheOrg/TheProject.git

kshultz@cloudbees.com (JIRA)

unread,
Aug 9, 2019, 1:32:04 PM8/9/19
to jenkinsc...@googlegroups.com

Thanks, William Gillaspy. This is very helpful.

The credentials thing is something I noticed as well. That might be a distinct problem from what you originally reported. Both are legit and need to be addresed, so thank you for the detailed report. We'll keep you updated here on this ticket.

kshultz@cloudbees.com (JIRA)

unread,
Aug 12, 2019, 3:24:02 PM8/12/19
to jenkinsc...@googlegroups.com

William Gillaspy - I think that between me and Devin Nusbaum, we've got this figured out. Just know that the weird Invalid credentials red text that you see when you supply your (perfectly valid) credentials is still going to be there. The "Validate" button, however, will work fine. The Invalid credentials thing should probably be handled in a separate JIRA.

kshultz@cloudbees.com (JIRA)

unread,
Aug 12, 2019, 4:59:02 PM8/12/19
to jenkinsc...@googlegroups.com

kshultz@cloudbees.com (JIRA)

unread,
Aug 13, 2019, 6:25:04 PM8/13/19
to jenkinsc...@googlegroups.com
Karl Shultz started work on Bug JENKINS-58862
 
Change By: Karl Shultz
Status: Open In Progress

kshultz@cloudbees.com (JIRA)

unread,
Aug 13, 2019, 6:29:01 PM8/13/19
to jenkinsc...@googlegroups.com
 
Re: Github Branch Source Plugin always references https://api.github.com

There's a PR up now. William Gillaspy, the PR info includes some of the manual testing I've done to make sure things work okay with GitHub Enterprise. I tested both multibranch pipeline and organization folder style jobs, and both are configuring the apiUri field in each job's config.xml in the correct way.

Once the PR is through review, I'll move this to Done, and we'll follow the usual release process.

Thanks for reporting this!

kshultz@cloudbees.com (JIRA)

unread,
Aug 14, 2019, 12:07:04 PM8/14/19
to jenkinsc...@googlegroups.com

kshultz@cloudbees.com (JIRA)

unread,
Aug 15, 2019, 3:12:03 PM8/15/19
to jenkinsc...@googlegroups.com
 

The above mentioned pull request has been merged and released as GitHub Branch Source 2.5.6.

Change By: Karl Shultz
Status: In Review Closed
Resolution: Fixed
Released As: github-branch-source-2.5.6

w.gillaspy@gmail.com (JIRA)

unread,
Aug 15, 2019, 3:26:04 PM8/15/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages