Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Gregory Anne
I can't make it work
if you can help please get in touch with me
I can’t seem to find [skip-ci] option so running my pipeline triggers my pipeline! (The pipeline updates versions as a first step) Anyone know where this is or have a work around?
Brice Copy

Hi, anyone with experience with using job DSL in jcasc to scan a gitlab group upon startup ?
I get this NPE with the latest Jenkins (2.281) and plugin versions, but I can reproduce it with various LTS installations too :

ERROR: [Wed Feb 24 17:41:31 CET 2021] Could not fetch sources from navigator io.jenkins.plugins.gitlabbranchsource.GitLabSCMNavigator@7e1b3efb
    at io.jenkins.plugins.gitlabbranchsource.GitLabHookCreator.isTokenEqual(GitLabHookCreator.java:229)
    at io.jenkins.plugins.gitlabbranchsource.GitLabHookCreator.createWebHookWhenMissing(GitLabHookCreator.java:220)
    at io.jenkins.plugins.gitlabbranchsource.GitLabSCMNavigator.visitSources(GitLabSCMNavigator.java:273)
    at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:1033)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)

If I go to MANAGE JENKINS, then press SAVE once, the Gitlab group scan works again.... any ideas ? :confused:

1 reply
Hello everyone!
Do not consider it rude or impatience..I'd like to know how often PRs a reviewing by maintainers with write access into repository?
Sverre Moe
If I want to create a Feature Request. Should I do it on GitHub Issues, or Jenkins JIRA under Component gitlab-branch-source-plugin?
Sverre Moe
Seems I don't have to. Others have reported a similar feature request
Lack of Stage name in GitLab pipelines.
GitLab Plugin reports them, but not GitLab Branch Source Plugin.
Denham Coote
Sadly, as is the way with many well-intentioned plugins, this seems to have been mothballed. Pity, looked like it had a lot of potential.
Liam Newman
@denhamcoote_gitlab @EugeneLesnov @DJViking It is not mothballed. It needs active contributors and maintainers. I'm happy to help in my spare time, but that is very limited.
Denham Coote
@bitwiseman That's encouraging. I'm an end user only, and appreciate that something like this takes effort. I look forward to future updates in that case.
Sverre Moe

If I have some spare time I might take a look, but it seem it might be a big job to implement JENKINS-58445.

This is my first try to join in with Element matrix.
Seems I got a new user account, not the one I used wirh gitter.

Sverre Moe
:point_up: Edit: If I have some spare time I might take a look, but it seem it might be a big job to implement JENKINS-58445.
Sverre Moe
This plugin is vital to fight against GitLab CI, and make Jenkins a competitive choice for CI/CD.
Most who use GitLab wants to consolidate everything into GitLab, including CI. I can't blame them. It sure makes it easier to use only one tool.
I also see the same tendencies in my own company where we just have moved to GitLab, but still use Jenkins for CI/CD.
1 reply
Famous Ketoma
Hey I have an issue with this plugin, I have a private gitlab server with url in the format http://<url>:<port>, after setting up my multibranch pipeline, all pipelines fail to build because the url which is used to checkout the repository strips out the port i.e. it clones from http://<url> rather than http://<url>:<port> and my nginx server is just routes it to some default route
1 reply
Giridhar S
Hi All we started to use gitlab branch source plugin in our projects .Folks who have admin access can use the plugin well in multibranch plugin..where as other users are getting Missing Job/build permission
1 reply
Amit Dar

Hi All we started to use gitlab branch source plugin in our projects .Folks who have admin access can use the plugin well in multibranch plugin..where as other users are getting Missing Job/build permission

I opened an issue regarding this matter a year ago. I think it is about time to start taking care of it... (I think a good start would be to vote for the issue so it will be prioritized....)


1 reply
Iaroslav Pleten
Could someone confirm if "orphaned item strategy" works with Gitlab plugin please? For me it seems broken until I press "Scan gitlab project" or invoke .doReload() on project
1 reply
Hi Everyone. Does anybody have suggestions on how to use the gitlab-source-branch plugin in a way that builds are triggered when a MR is approved ignoring open/close/merged events? thank you
1 reply
Christoph Obexer
Does anyone here have an idea where / how to implement better display names for Merge/Pull Request Jobs? jenkinsci/gitlab-branch-source-plugin#141
4 replies
I'm trying to write a jobdsl for an org using this plugin. I'm stuck at creating a "property strategy" of "named branches get different properties," and setting master to "suppress SCM". Does anyone know of or have a small example of doing this, either with jobdsl proper or a configure block?
1 reply
k. thanks for that
Julian Xhokaxhiu
Hi, I'm having a small issue with the plugin not being able to create webhooks upon discovering a repository with a Jenkinsfile in it
Most of the time I do get this from the logs Cannot set web hook: Forbidden, although those repos have no Jenkinsfile so I could expect is because of that
But on the repos that do have that file, and are correctly detects and jobs do run on top successfully, I get this other reply: Cannot set web hook: Unprocessable Entity
The users Personal Access token is working successfully to discovery groups and much more on the Gitlab instance, it has the api scope set, and the user is currently set as Maintainer
Am I missing something in the whole setup? The group organization scan works fine too and the repo can be detected, so I'm not getting what is wrong with the webhook setup
Plugin version: 1.5.7
GitLab Community Edition 13.6.7
Julian Xhokaxhiu
Some updates: I managed to fix the Forbidden error now, but for every repo now I get Cannot set web hook: Unprocessable Entity what does this error means?
11 replies
Shabab Qaisar
Hi, I'm having hard time configuring job using dsl (groovy script). I want to create single multibranch pipeline with gitlab and manage it as configuration as code using Jenkins Job DSL plugin. I can't find any code snippet for single job although I've found one for organizationFolder in the plugin docs. Does anyone have blog link or code snippet that can help me create single multibranch pipeline with gitlab? Or is that even possible using DSL script?
2 replies
Hi, I am facing an issue with code checkout continuously failing after upgrading to v1.5.1 and upwards of the gitlab branch source plugin in a multibranch pipeline with the below error:
2 replies

Querying the current revision of branch master...

[Pipeline] }

[Pipeline] // stage

[Pipeline] }

[Pipeline] // node

[Pipeline] End of Pipeline

java.lang.ClassCastException: Cannot cast org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory

Julian Xhokaxhiu
Hi, I'm having an issue with the plugin that is not able to auto-trigger job builds on a tag push. In the README it is stated that you need to install the basic-branch-build-plugin ( which I think it's a typo and you probably mean this one https://plugins.jenkins.io/basic-branch-build-strategies/ ). So nevertheless I installed it and I am able to configure the buildStrategy for tags on organization folders via JCasC but I'm not able to propagate that to each multibranch repo being created by the gitlab plugin.
How can we therefore configure the buildStrategy for those and/or propagate the tag behavior on each repo?
I think the README needs a bit more information about this behavior because it's too simplified and an OOB solution would be expected somehow... ( see https://github.com/jenkinsci/gitlab-branch-source-plugin#additional-traits )
For the sake of the context: I can see my tag once I push, I can see the strategy being applied to the OrganizationFolder, but I can't see this one being applied to each multibranch job type
Julian Xhokaxhiu
Nvm I finally figured it out...for everyone interested:
configure {
      // Start configuring build strategies
      def buildStrategies = it / sources / data / 'jenkins.branch.BranchSource' / buildStrategies
      buildStrategies << 'jenkins.branch.buildstrategies.basic.TagBuildStrategyImpl' {
        // The number of days since the tag was created before it is eligible for automatic building.
        // The number of days since the tag was created after which it is no longer eligible for automatic building.
Webert Lima
Hello, how can I batch change one configuration from all my jenkins jobs that use the gitlab branch source plugin?
8 replies
Felix Schlüter
Hi all, I am new to jenkins and this plugin and have some problems setting up jenkins with an existing (formally svn-hosted) multi-pipeline project. I hope you understand my problem and can help me. I apologize up front if I screw up some naming convention or so.
After quite some try&error I reached a point were I can trigger on changes to the master and also to a MR. What happen first is that the Jenkinsfiles is executed which creates the pipelines via jobDSL. My issue right now is that the pipeline-status for the MR on GitLab shows the result of running the Jenkinsfile rather than running the pipeline it creates.
Can that be fix?
What information may I provide (sorry I have no clue at this point)?
PS: I am using the Plugin in version 1.5.9 and jenkins in 2.278
11 replies

Hi all,
I'm trying to use this plugin (organizationFolder mode) in use case scenario that needs Jenkinsfile to be loaded from external source and not from repository. For this purpose I'm trying to use Pipeline Multibranch with Defaults plugin (https://github.com/jenkinsci/pipeline-multibranch-defaults-plugin) and configure it to use global Jenkinsfile stored in config-file provider plugin. The problem arises at the "checkout scm" step - it throws following exception: java.io.IOException: Failed to retrieve the SCM revision for master. I'm using GIT. Full build log available here: https://pastebin.com/HuhxS6v5

Example Jenkinsfile:

node {
    stage('Checkout scm') {
        checkout scm

I've also tried following code to do checkout step without success:

         $class: 'GitSCM',
         branches: scm.branches,
         doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations,
         extensions: scm.extensions,
         userRemoteConfigs: scm.userRemoteConfigs

Same Jenkinsfile works without any problem when loaded directly from repository (without use of Pipeline: Multibranch with defaults plugin). It looks like there is no data in scm variable when Jenkinsfile is loaded from pipeline-multibranch-defaults plugin. I don't have any idea how to debug it further. Does anybody have any idea where the problem could be and how to fix it?
My versions are: Jenkins: 2.289.3, gitlab-branch-source-plugin: 1.5.9, pipeline-multibranch-defaults: 2.1.

Also I've tried to replace pipeline-multibranch-defaults plugin with inline-pipeline plugin only to see the same problem.

4 replies
Sverre Moe
Is this plugin still under active development?
I was hoping something could be done with https://issues.jenkins.io/browse/JENKINS-58445
2 replies
Francois Marot
I'm battling with the configuration of the gitlab-branch-source plugin. By default, when I configure my multibranch pipeline in Jenkins with only gitlab-branch-source, the commits or changes on Gitlab side are not detected and do not trigger any build on Jenkins side.
I have to add the classic/basic git plugin in Jenkins to make Jenkins react to notifications and start the builds. Like in the provided screenshot:
5 replies
does anyone know if this is the explected behavior ? I would expect the gitlab-branch-source to be able to trigger the builds by itself, not needing another plugin.
Francois Marot
Update: responding to my previous comment
In fact, the gitlab-branch-source plugin seems to work perfectly well if I create in Jenkins a job of type "gitlab group" that acts as an umbrella for all the project/repositories under a given group in gitlab. If configured like this, all projects are detected, all branches are detected and notifications from gitlab to jenkins automatically trigger the matching job in jenkins. I think this plugin may be designed to work like this but I find the documentation lacking: it should be made explicit that configuring jobs manually may not be the best way.
If the plugn author is interested, I may help to provide a PR for the doc.
Francois Marot

Hello again,
I'm wondering if this is normal that the job names contain the html encode slash as '%2F' instead of a real slash when configured by this plugin (see the above capture).
The problem is that when I want to trigger another job in the Jenkinsfile, this works:

build job: '/aaa/sherlock%2Fdata-pipeline/master'

but this does not:

build job: '/aaa/sherlock/data-pipeline/master'

Which is not very convenient !