On Tuesday, January 9, 2024 at 3:22:29 AM UTC-7 Torsten wrote:

Hi, 

my Jenkins Multibranch jobs are currently based on Bitbucket, using the " 
cloudbees-bitbucket-branch-source" plugin. I was using a configuration with 
- Discover branches
- *Discover pull requests from origin* 
resulting in multiple tab views to run builds for Branches and PR´s.

Now we need to migrate the git repositories to Github and I´m running into 
2 issues:

1.) Github plugin seems to only support User/pwd authentication - but I´m 
restricted to use ssh-key(s) only.


That is a serious limitation that your organization has placed on you.  It 
will limit many uses of GitHub in Jenkins and elsewhere.  The GItHub API is 
only accessible over HTTP.  The HTTP authentication requires username / 
password authentication with a GitHub personal access token or other form 
of token.  The HTTP authentication does not accept private keys as far as I 
know.

Without access to the GitHub API, you're severely limited on the types of 
operations that can be performed.  The GitHub branch source plugin and the 
GitHub organization folder plugin use the GitHub API to perform many of 
their operations.  The GitHub API is what makes those plugins such an 
improvement over the Git plugin.  The same is true for the Bitbucket branch 
source plugin.

I assume that you were allowing HTTP authenticated requests with 
Bitbucket.  Similar requests are needed for GitHub.  The best choice is to 
persuade your organization that they need to allow token based 
authentication with GitHub.
 

2.) Git plugin supports ssh-key(s) for authentication, but seems not to 
support "Discover pull-requests from origin".
(https://www.jenkins.io/doc/book/pipeline/multibranch/)

The Git plugin only supports "*Discover other refs*"

Is there a way to handle the PR´s in any way with the Git plugin ?


The git plugin uses command line git or JGit and limits itself to the 
concepts that are available from command line git.  Command line git does 
not have the concept of a pull request.  Command line git understands refs 
and branches.

If you can find the refspec that GitHub uses to store pull requests, you 
might be able to detect those pull request branches and create jobs for 
those pull request branches.  However, that is a much worse experience than 
the experience you'll have if you use the GitHub branch source plugin and 
the GitHub organization folder plugin and let them manage the creation and 
deletion of branches 

Mark Waite
 

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/228e2f47-1ce3-4cec-ab07-0b382d6358c8n%40googlegroups.com.

Reply via email to