gitlab-branch-source-plugin
gitlab-branch-source-plugin copied to clipboard
Private Repos are not listed in Projects Combobox in Multibranch Config
Create a private repo in GitLab named "Test1" for User X. Create a GitLab access token for User X. Create a new multibranch Pipeline in Jenkins. Source is of type GitLab Project. Add the credentials for X:Access Token. Add the Owner (X) in the owner field. The form ponders the input and intead of -None- in the field nothing is displayed. Hit Save.
Log from the subsequent Scan:
Cannot deserialize instance of `org.gitlab4j.api.models.Project` out of START_ARRAY token.
If a public repo is added in GitLab and the process is repeated, the public repo is listed in the Projects selection combobox, but still not the private repo.
Plugin Version: 1.5.1 GitLab CE Version: 13.3.6 Jenkins Version: 2.235.5
Have the same problem. Added the credentials of the user that does have access to the project, but nothing apart from public or internal projects is visible in the combobox.
@aleksa2808 Hello,
Did you manage to solve this issue? I cannot see my private gitlab Repositories in the projects tab.
@amin224 no, the "hotfix" of making all projects using this plugin "internal" is still in effect.
Gitlab personal access tokens start with the prefix glpat- and the general format of personal access tokens is: glpat-abc..... The actual significant section is 20 characters long. That's why gitlab-branch-source-plugin enforces 20 characters without prefix but we have checked the incoming HTTP request to GitLab server contains a private-token header with the actual value coming from credentials and without glpat- prefix. It causes 401 error.
As a workaround, we will try to bypass form validation using Jenkins Configuration as Code.
For the actual fix, we can either add a prefix to the HTTP header value or we can increase the token maximum length criteria to 26 characters.
FWIW, I cannot reproduce this issue with current software versions:
- GitLab CE 15.10.1
- Jenkins 2.397
- GitLab Branch Source ~~1703.vd5a_2b_29c6cdc~~ 647.vdee7766b_cfa_e
- Created a PAT with read_api & read_repository permission.
- Configured a GitLab connection with this PAT
- Create a multibranch pipeline job
- Select GitLab Project
- Enter Username into "Owner"
- Projects dropdown is filled with private, internal and public repositories
Hey @TobiX, I tried to reproduce your non reproduction but GitLab Branch Source plugin does not exist in version 1703.vd5a_2b_29c6cdc
@xaviou Sorry, copy & paste error. Ment to write 647.vdee7766b_cfa_e, which was released ~2 weeks ago (https://github.com/jenkinsci/gitlab-branch-source-plugin/releases)