Giter Club home page Giter Club logo

gitlab-branch-source-plugin's Introduction

Gitpod ready-to-code Build Status GitHub release Gitter Jenkins Plugin Installs

GitLab Branch Source Plugin

To be fully able to run a Jenkins Continuous Integration on a GitLab repository or project, you require the following plugins:

  • GitLab API Plugin - Wraps GitLab Java API.

  • GitLab Branch Source Plugin - Contains two packages:

    • io.jenkins.plugins.gitlabserverconfig - Manages server configuration and web hooks management. Ideally should reside inside another plugin with name GitLab Plugin. In future, this package will be moved into a new plugin.

    • io.jenkins.plugins.gitlabbranchsource - Adds GitLab Branch Source for Multi-branch Pipeline Jobs (including Merge Requests) and Folder organization.

Getting Started

Getting Started with Jenkins:

Jenkins is an open source, self hosting automation server for continuous integration and continuous delivery. The source code of the core Jenkins and its plugins are written in Java. There have been developments on a modern Jenkins Server (see: Blueocean Plugin) using React and other modern front end tools to provide rich user experience.

For more Jenkins related information, see documentation.

Extending Jenkins

Jenkins has more than a 1000 plugins so a vast set of functionality has already been implemented and this can be used to leverage new plugins. Jenkins has an extensibility feature that allows plugin to use other plugins or core features simply by extending their classes. To define or create an extension in Jenkins,we use the @Extension annotation type. This annotation is picked up by Jenkins, and the new extension will be added to an ExtensionList object, where the extension can then be found via ExtensionFinder.

Running Jenkins server:

Here are a few ways to setup your own Jenkins server:

  1. Using a Jenkins docker:

    i. Download docker image from here.

    ii. Open up a terminal/command prompt window to the download directory.

    iii. Run command:

    docker run \
      -u root \
      --rm \
      -d \
      -p 8080:8080 \
      -p 50000:50000 \
      -v jenkins-data:/var/jenkins_home \
      -v /var/run/docker.sock:/var/run/docker.sock \
      --name jenkins \
      jenkinsci/blueocean

    iv. Browse to http://localhost:8080.

    If you need more information about docker commands, see here.

  2. Using a Jenkins Web application Archive (WAR):

    i. Download latest stable Jenkins WAR file.

    ii. Open up a terminal/command prompt window to the download directory.

    iii. Run command:

    java -jar jenkins.war

    iv. Browse to http://localhost:8080/jenkins.

  3. Using a Azure Jenkins solution:

    Refer to Azure docs.

  4. Using a Bitnami Jenkins Stack:

    Refer to Bitnami docs.

  5. Using Jenkins CLI run it for development:

    Run it via: jcli plugin run

Configuring Jenkins instance:

  1. Unlock your Jenkins instance:

    i. From the Jenkins console log output, copy the automatically-generated alphanumeric password.

    ii. On the Unlock Jenkins page, paste this password into the Administrator password field and click Continue.

  2. Customizing Jenkins with plugins. Choose one option:

    i. Install suggested plugins - to install the recommended set of plugins, which are based on most common use cases.

    ii. Select plugins to install - to choose which set of plugins to initially install. When you first access the plugin selection page, the suggested plugins are selected by default.

  3. Create an admin user:

    i. When the Create First Admin User page appears, specify the details for your administrator user in the respective fields and click Save and Finish.

    ii. When the Jenkins is ready page appears, click Start using Jenkins.

    iii. If required, log in to Jenkins with the credentials of the user you just created and you are ready to start using Jenkins!

Minimum Requirements

  1. Jenkins - 2.176.2 LTS or above
  2. GitLab - 11.0 or above

Installing plugin

You can use any one of these ways:

  1. Install from Jenkins Update Center. Go to Jenkins > Configure > Manage Plugins > Available and search for gitlab branch source plugin then select Install.

  2. Using Plugin Management Tool

    java -jar plugin-management-tool.jar
        -p gitlab-branch-source
        -d <path-to-default-jenkins-plugins-directory>
        -w <path-to-jenkins-war>
  3. From Source:

    i. Checkout out source code to your local machine:

    git clone https://github.com/jenkinsci/gitlab-branch-source-plugin.git
    cd gitlab-branch-source-plugin
    

    ii. Install the plugin:

    mvn clean install
        or
    mvn clean install -DskipTests # to skip tests
    

    iii. Run the Plugin:

    mvn hpi:run # runs a Jenkins instance at localhost:8080
        or
    mvn hpi:run -Djetty.port={port} # to run on your desired port number
    

    iv. Now the *.hpi generated can be manually installed on your Jenkins instance:

    1. Select `Manage Jenkins`
    
    2. Select `Manage Plugins`
    
    3. Select `Advanced` tab
    
    3. In `Upload Plugin` section, select `Choose file`
    
    4. Select `${root_dir}/target/gitlab-branch-source.hpi`
    
    5. Select `Upload`
    
    6. Select `Install without restart`
    
  4. Download latest release from here and manually install.

Initial Setup

After installing the plugin on your Jenkins instance, you need configure your GitLab Server settings.

Setting up GitLab Server Configuration on Jenkins

  1. On jenkins, select Manage Jenkins.

  2. Select Configure System.

  3. Scroll down to find the GitLab section.

    gitlab-section

  4. Select Add GitLab Server | Select GitLab Server.

  5. Now you will now see the GitLab Server Configuration options

    gitlab-server

    There are 4 fields that needs to be configured:

    i. Name - Plugin automatically generates an unique server name for you. User may want to configure this field to suit their needs but should make sure it is sufficiently unique. We recommend to keep it as it is.

    ii. Server URL - Contains the URL to your GitLab Server. By default it is set to "https://gitlab.com". User can modify it to enter their GitLab Server URL e.g. https://gitlab.gnome.org/, http://gitlab.example.com:7990. etc.

    iii. Credentials - Contains a list of credentials entries that are of type GitLab Personal Access Token or any String Credentials. When no credential has been added it shows "-none-". User can add a credential by clicking "Add" button.

    iv. Mange Web Hook - If you want the plugin to setup web hook on your GitLab project(s) to get push/mr/tag/note events then check this box.

    iv. Mange System Hook - If you want the plugin to setup system hook on your GitLab project(s) to detect if a project is removed then check this box. Remember plugin can only setup system hook on your server if supplied access token has Admin access.

    v. Secret Token - The secret token is required to authenticate the webhook payloads received from GitLab Server. Use generate secret token from Advanced options or use your own. If you are a old plugin user and did not set a secret token previously and want secret token to applied to the hooks of your existing jobs, you can add the secret token and rescan your jobs. Existing hooks with new secret token will be applied.

    vi. Root URL for hooks - By default Root URL for hooks created by this plugin is your Jenkins instance url. You can modify the root URL in by adding your custom root URL. Leave empty if you want Jenkins URL to be your custom hook url. A path is added to your hook ROOT URL /gitlab-webhook/post for webhooks and /gitlab-systemhook/post for system hooks.

  6. Adding a Personal Access Token Credentials:

    This is a manual setup. To automatically generate Personal Access Token see next section.

    i. User is required to add a GitLab Personal Access Token or any String Credential type credentials entry to securely persist the token inside Jenkins.

    ii. Generate a Personal Access Token on your GitLab Server

    a. Select profile dropdown menu from top-right corner
    
    b. Select `Settings`
    
    c. Select `Access Token` from left column
    
    d. Enter a name | Set Scope to `api` (If admin also give `sudo` which required for systemhooks and mr comment trigger)
    
    e. Select `Create Personal Access Token`
    
    f. Copy the token generated
    

    iii. Return to Jenkins | Select Add in Credentials field | Select Jenkins.

    iv. Set Kind to GitLab Personal Access Token.

    v. Enter Token.

    vi. Enter a unique id in ID.

    vii. Enter a human readable description.

    gitlab-credentials

    viii. Select Add.

  7. Testing connection:

    i. Select your desired token in the Credentials dropdown.

    ii. Select Test Connection.

    iii. It should return something like Credentials verified for user {username}.

  8. Select Apply (at the bottom).

  9. GitLab Server is now setup on Jenkins.

Creating Personal Access Token within Jenkins

Alternatively, users can generate a GitLab Personal Access Token within Jenkins itself and automatically add the GitLab Personal Access Token credentials to Jenkins server credentials.

  1. Select Advanced at the bottom of GitLab Section.

  2. Select Manage Additional GitLab Actions.

  3. Select Convert login and password to token.

  4. Set the GitLab Server URL.

  5. There are 2 options to generate token:

    i. From credentials - To select an already persisting Username Password Credentials or add an Username Password credential to persist it.

    ii. From login and password - If this is a one time thing then you can directly enter you credentials to the text boxes and the username/password credential is not persisted.

  6. After setting your username/password credential, select Create token credentials.

  7. The token creator will create a Personal Access Token in your GitLab Server for the given user with the required scope and also create a credentials for the same inside Jenkins server. You can go back to the GitLab Server Configuration to select the new credentials generated (select "-none-" first then new credentials will appear). For security reasons this token is not revealed as plain text rather returns an id. It is a 128-bit long UUID-4 string (36 characters).

    gitlab-token-creator

Manually create hooks on GitLab Server

Use the following end points for web hooks and system hooks setup on your GitLab Server. The Jenkins Url needs to be a fully qualified domain name (FQDN) so cannot be localhost.

WebHook

<jenkins_url>/gitlab-webhook/post

with push, tag, merge request and note events.

SystemHook

<jenkins_url>/gitlab-systemhook/post

with repository update event.

Configuration as Code

There is an easier way to setup GitLab Server configuration on your Jenkins server. No need for messing around in the UI. Jenkins Configuration as Code (JCasC) or simply Configuration as Code Plugin allows you to configure Jenkins via a yaml file. If you are a first time user, you can learn more about JCasC here.

Prerequisite:

Install Configuration as Code Plugin on your Jenkins instance.

Refer to Installing a new plugin in Jenkins.

Add configuration YAML:

There are multiple ways to load JCasC yaml file to configure Jenkins:

  • JCasC by default searches for a file with the name jenkins.yaml in $JENKINS_ROOT.

  • The JCasC looks for an environment variable CASC_JENKINS_CONFIG which contains the path for the configuration yaml file.

    • A path to a folder containing a set of config files e.g. /var/jenkins_home/casc_configs.

    • A full path to a single file e.g. /var/jenkins_home/casc_configs/jenkins.yaml.

    • A URL pointing to a file served on the web e.g. https://<your-domain>/jenkins.yaml.

  • You can also set the configuration yaml path in the UI. Go to <your-jenkins-domain>/configuration-as-code. Enter path or URL to jenkins.yaml and select Apply New Configuration.

To configure your GitLab Server in Jenkins add the following to jenkins.yaml:

credentials:
  system:
    domainCredentials:
      - credentials:
          - gitlabPersonalAccessToken:
              scope: SYSTEM
              id: "i<3GitLab"
              token: "glpat-XfsqZvVtAx5YCph5bq3r" # gitlab personal access token

unclassified:
  gitLabServers:
    servers:
      - credentialsId: "i<3GitLab" # same as id specified for gitlab personal access token credentials
        manageWebHooks: true
        manageSystemHooks: true # access token should have admin access to set system hooks
        name: "gitlab-3214"
        serverUrl: "https://gitlab.com"
        hooksRootUrl: ""
        secretToken: ""

See handling secrets section in JCasC documentation for better security.

Jobs Setup

GitLab Branch Source Plugin allows you to create 2 type of jobs:

  • Multibranch Pipeline Jobs - For single project.
  • Folder Organization - For multiple projects inside a owner (user/group/subgroup).

Multibranch Pipeline Jobs

The Multibranch Pipeline job type enables you to implement different Jenkinsfiles for different branches of the same project. In a Multibranch Pipeline job, Jenkins automatically discovers, manages and executes Pipelines for Branches/Merge Requests/Tags which contain a Jenkinsfile in source control. This eliminates the need for manual Pipeline creation and management.

To create a Multibranch Pipeline Job:

  1. Select New Item on Jenkins home page.

  2. Enter a name for your job, select Multibranch Pipeline | select Ok.

  3. In Branch Sources sections, select Add source | select GitLab Project.

  4. Now you need to configure your jobs.

    branch-source

    i. Select Server configured in the initial server setup.

    ii. [Optional] Add Checkout Credentials (SSHPrivateKey or Username/Password) if there is any private projects that will be built by the plugin.

    iii. Add path to the owner where the project you want to build exists. If user, enter username. If group, enter group name. If subgroup, enter subgroup path with namespace.

    iv. Based on the owner provided. All the projects are discovered in the path and added to the Projects listbox. You can now choose the project you want to build.

    v. Behaviours (a.k.a. SCM Traits) allow different configurations option to your build. More about it in the SCM Trait APIs section.

  5. Now you can go ahead and save the job.

For more info see this.

After saving, a new web hook is created in your GitLab Server if a GitLab Access Token is specified in the server configuration. Then the branch indexing starts based on what options behaviours you selected. As the indexing proceeds new jobs are started and queued for each branches with a Jenkinsfile in their root directory.

The Job results are notified to the GitLab Server as Pipeline Status for the HEAD commit of each branches built. The build for forked MR cannot be notified to GitLab Server as GitLab doesn't provide Pipeline status for Merge Requests from forks for security concerns. See this.

We have a workaround for this. Jenkins will build the MRs from forked projects if the MR author is a trusted owner i.e. has Developer/Maintainer/Owner access level. More about it in the SCM Trait APIs section.

As the web hook is now setup on your Jenkins CI by the GitLab server. Any push-events or merge-request events or tag events trigger the concerned build in Jenkins.

Folder Organization

Folders Organization enable Jenkins to monitor an entire GitLab User/Group/Subgroup and automatically create new Multibranch Pipelines for projects which contain branches/merge requests/tags containing a Jenkinsfile. In our plugin this type of job is called GitLab Group.

To create a GitLab Group Job:

  1. Select New Item on Jenkins home page.

  2. Enter a name for your job.

  3. Select Organization Folder as the job type and press the Ok button.

  4. In Configuration, under Projects, select GitLab Group as the Repository Sources.

  5. Now you need to configure your jobs.

    i. Select Server configured in the initial server setup.

    ii. [Optional] Add Checkout Credentials (SSHPrivateKey or Username/Password) only if there are any private projects required to be built.

    iii. Add path to the owner whose projects you want to build. If user, enter username. If group, enter group name. If subgroup, enter subgroup path with namespace.

    v. Behaviours (a.k.a. SCM Traits) are allow different configuration option to your build. More about it in the SCM Trait APIs section.

The indexing in this group job type only needs to discover one branch withJenkinsfile and thus it only shows the partial indexing log. You need to visit individual projects to see their full indexing.

SCM Trait APIs

The following behaviours apply to both Multibranch Pipeline Jobs and Folder Organization (unless otherwise stated).

Default Traits:

  • Discover branches - To discover branches.

    • Only Branches that are not also filed as MRs - If you are discovering origin merge requests, it may not make sense to discover the same changes both as a merge request and as a branch.
    • Only Branches that are filed as MRs - This option exists to preserve legacy behaviour when upgrading from older versions of the plugin. NOTE: If you have an actual use case for this option please file a merge request against this text.
    • All Branches - Ignores whether the branch is also filed as a merge request and instead discovers all branches on the origin project.
  • Discover merge requests from origin - To discover merge requests made from origin branches.

    • Merging the merge request merged with current target revision - Discover each merge request once with the discovered revision corresponding to the result of merging with the current revision of the target branch.
    • The current merge request revision - Discover each merge request once with the discovered revision corresponding to the merge request head revision without merging.
    • Both current mr revision and the mr merged with current target revision - Discover each merge request twice. The first discovered revision corresponds to the result of merging with the current revision of the target branch in each scan. The second parallel discovered revision corresponds to the merge request head revision without merging.
  • Discover merge requests from forks - To discover merge requests made from forked project branches.

    • Strategy:

      • Merging the merge request merged with current target revision - Discover each merge request once with the discovered revision corresponding to the result of merging with the current revision of the target branch.
      • The current merge request revision - Discover each merge request once with the discovered revision corresponding to the merge request head revision without merging.
      • Both current mr revision and the mr merged with current target revision - Discover each merge request twice. The first discovered revision corresponds to the result of merging with the current revision of the target branch in each scan. The second parallel discovered revision corresponds to the merge request head revision without merging.
    • Trust

      • Members - Discover MRs from Forked Projects whose author is a member of the origin project.
      • Trusted Members - [Recommended] Discover MRs from Forked Projects whose author is has Developer/Maintainer/Owner accesslevel in the origin project.
      • Everyone - Discover MRs from Forked Projects filed by anybody. For security reasons you should never use this option. It may be used to reveal your Pipeline secrets environment variables.
      • Nobody - Discover no MRs from Forked Projects at all. Equivalent to removing the trait altogether.

    If Members or Trusted Members is selected, then plugin will build the target branch of MRs from non/untrusted members.

Additional Traits:

These traits can be selected by selecting Add in the Behaviours section.

  • Tag discovery - Discover tags in the project. To automatically build tags install basic-branch-build-plugin.

  • Discover group/subgroup projects - Discover subgroup projects inside a group/subgroup. Only applicable to GitLab Group Job type whose owner is a Group/Subgroup but not User.

  • Discover shared projects - Discover projects that are shared with the configured owner group from another group. Up until version 684 of the plugin this used to be the default behavior but is now a separate trait that is not added by default due to potential security concerns.

  • Log build status as comment on GitLab - Enable logging build status as comment on GitLab. A comment is logged on the commit or merge request once the build is completed. You can decide if you want to log success builds or not. You can also use sudo user to comment the build status as commment e.g. jenkinsadmin or something similar.

  • Trigger build on merge request comment - Enable trigger a rebuild of a merge request by comment with your desired comment body (default: jenkins rebuild). The job can only be triggered by trusted members of the project i.e. users with Developer/Maintainer/Owner accesslevel (also includes inherited from ancestor groups). By default only trusted members of project can trigger MR. You may want to disable this option because trusted members do not include members inherited from shared group (there is no way to get it from GitLabApi as of GitLab 13.0.0). If disabled, MR comment trigger can be done by any user having access to your project.

  • Disable GitLab project avatar - Disable avatars of GitLab project(s). It is not possible to fetch avatars when API has no token authentication or project is private. So you may use this option as a workaround. We will fix this issue in a later release.

  • Project Naming Strategy - Choose whether you want project name, the full project path (with namespace), contextual project path (partial namespace, or simple project path (no namespace) as job names of each project. Due to legacy reasons, we have project path (with namespace) as default naming scheme. Note if a job is already created and the naming strategy is changed it will cause projects and build logs to be destroyed.

  • Filter by name (with regex) - Filter the type of items you want to discover in your project based on the regular expression specified. For example, to discover only master branch, develop branch and all Merge Requests add (master|develop|MR-.*).

  • Filter by name (with wildcards) - Filter the type of items you want to discover in your project based on the wildcards specified. For example, to discover only master branch, develop branch and all Merge Requests add development master MR-*.

  • Skip pipeline status notifications - Disable notifying GitLab server about the pipeline status.

  • Override hook management modes - Override default hook management mode of web hook and system hook. ITEM credentials for webhook is currently not supported.

  • Checkout over SSH - [Not Recommended] Use this mode to checkout over SSH. Use Checkout Credentials instead.

  • Webhook Listener Conditions - Set conditions based on the webhook content on when a build should be triggered.

Environment Variables

By default Multibranch Jobs have the following environment variables (provided by Branch API Plugin):

Branch - BRANCH_NAME

Merge Request - BRANCH_NAME, CHANGE_ID, CHANGE_TARGET, CHANGE_BRANCH, CHANGE_FORK, CHANGE_URL, CHANGE_AUTHOR, CHANGE_TITLE. CHANGE_AUTHOR_DISPLAY_NAME

Tag - BRANCH_NAME, TAG_NAME, TAG_TIMESTAMP, TAG_DATE, TAG_UNIXTIME

This plugin adds a few more environment variables to Builds (WorkflowRun type only) which is the payload received as WebHook) See https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#events.

A few points to note:

If no response is recorded for any field in the Web Hook Payload, it returns an empty String. To add more variables see package io.jenkins.plugins.gitlabbranchsource.Cause.

GITLAB_OBJECT_KIND - This environment variable should be used to check the event type before accessing the environment variables. Possible values are none, push, tag_push and merge_request.

Any variables ending with # indicates the index of the list of the payload starting from 1.

Environment Variables are available from Push Event, Tag Push Event and Merge Request Event.

Push Event:

See https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#push-events

Expand โ„๏ธ
GITLAB_OBJECT_KIND
GITLAB_AFTER
GITLAB_BEFORE
GITLAB_REF
GITLAB_CHECKOUT_SHA
GITLAB_USER_ID
GITLAB_USER_NAME
GITLAB_USER_USERNAME
GITLAB_USER_EMAIL
GITLAB_PROJECT_ID
GITLAB_PROJECT_ID_2
GITLAB_PROJECT_NAME
GITLAB_PROJECT_DESCRIPTION
GITLAB_PROJECT_WEB_URL
GITLAB_PROJECT_AVATAR_URL
GITLAB_PROJECT_GIT_SSH_URL
GITLAB_PROJECT_GIT_HTTP_URL
GITLAB_PROJECT_NAMESPACE
GITLAB_PROJECT_VISIBILITY_LEVEL
GITLAB_PROJECT_PATH_NAMESPACE
GITLAB_PROJECT_CI_CONFIG_PATH
GITLAB_PROJECT_DEFAULT_BRANCH
GITLAB_PROJECT_HOMEPAGE
GITLAB_PROJECT_URL
GITLAB_PROJECT_SSH_URL
GITLAB_PROJECT_HTTP_URL
GITLAB_REPO_NAME
GITLAB_REPO_URL
GITLAB_REPO_DESCRIPTION
GITLAB_REPO_HOMEPAGE
GITLAB_REPO_GIT_SSH_URL
GITLAB_REPO_GIT_HTTP_URL
GITLAB_REPO_VISIBILITY_LEVEL
GITLAB_COMMIT_COUNT
GITLAB_REQUEST_URL
GITLAB_REQUEST_STRING
GITLAB_REQUEST_TOKEN
GITLAB_REFS_HEAD

Tag Event:

Note:

Jenkins by default refrains from automatically building Tags on push (See reason). You need to install Branch Build Strategy Plugin to solve this.

See Guide: https://github.com/jenkinsci/basic-branch-build-strategies-plugin/blob/master/docs/user.adoc

Do remember if you are using Basic Branch Build for tag builds you also need to add strategies for branch and pull request (change request) else they would not be automatically built (See GIF below).

branch-build-strategy

See https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#tag-events

Expand โ˜€๏ธ
GITLAB_OBJECT_KIND
GITLAB_AFTER
GITLAB_BEFORE
GITLAB_REF
GITLAB_CHECKOUT_SHA
GITLAB_USER_ID
GITLAB_USER_NAME
GITLAB_USER_USERNAME
GITLAB_USER_EMAIL
GITLAB_PROJECT_ID
GITLAB_PROJECT_ID_2
GITLAB_PROJECT_NAME
GITLAB_PROJECT_DESCRIPTION
GITLAB_PROJECT_WEB_URL
GITLAB_PROJECT_AVATAR_URL
GITLAB_PROJECT_GIT_SSH_URL
GITLAB_PROJECT_GIT_HTTP_URL
GITLAB_PROJECT_NAMESPACE
GITLAB_PROJECT_VISIBILITY_LEVEL
GITLAB_PROJECT_PATH_NAMESPACE
GITLAB_PROJECT_CI_CONFIG_PATH
GITLAB_PROJECT_DEFAULT_BRANCH
GITLAB_PROJECT_HOMEPAGE
GITLAB_PROJECT_URL
GITLAB_PROJECT_SSH_URL
GITLAB_PROJECT_HTTP_URL
GITLAB_REPO_NAME
GITLAB_REPO_URL
GITLAB_REPO_DESCRIPTION
GITLAB_REPO_HOMEPAGE
GITLAB_REPO_GIT_SSH_URL
GITLAB_REPO_GIT_HTTP_URL
GITLAB_REPO_VISIBILITY_LEVEL
GITLAB_COMMIT_COUNT
GITLAB_REQUEST_URL
GITLAB_REQUEST_STRING
GITLAB_REQUEST_TOKEN
GITLAB_REFS_HEAD

Merge Request Event:

See https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#merge-request-events

Expand โšก
GITLAB_OBJECT_KIND
GITLAB_USER_NAME
GITLAB_USER_USERNAME
GITLAB_USER_AVATAR_URL
GITLAB_PROJECT_ID
GITLAB_PROJECT_NAME
GITLAB_PROJECT_DESCRIPTION
GITLAB_PROJECT_WEB_URL
GITLAB_PROJECT_AVATAR_URL
GITLAB_PROJECT_GIT_SSH_URL
GITLAB_PROJECT_GIT_HTTP_URL
GITLAB_PROJECT_NAMESPACE
GITLAB_PROJECT_VISIBILITY_LEVEL
GITLAB_PROJECT_PATH_NAMESPACE
GITLAB_PROJECT_CI_CONFIG_PATH
GITLAB_PROJECT_DEFAULT_BRANCH
GITLAB_PROJECT_HOMEPAGE
GITLAB_PROJECT_URL
GITLAB_PROJECT_SSH_URL
GITLAB_PROJECT_HTTP_URL
GITLAB_REPO_NAME
GITLAB_REPO_URL
GITLAB_REPO_DESCRIPTION
GITLAB_REPO_HOMEPAGE
GITLAB_REPO_GIT_SSH_URL
GITLAB_REPO_GIT_HTTP_URL
GITLAB_REPO_VISIBILITY_LEVEL
GITLAB_OA_ID
GITLAB_OA_TARGET_BRANCH
GITLAB_OA_SOURCE_BRANCH
GITLAB_OA_SOURCE_PROJECT_ID
GITLAB_OA_AUTHOR_ID
GITLAB_OA_ASSIGNEE_ID
GITLAB_OA_TITLE
GITLAB_OA_CREATED_AT
GITLAB_OA_UPDATED_AT
GITLAB_OA_MILESTONE_ID
GITLAB_OA_STATE
GITLAB_OA_MERGE_STATUS
GITLAB_OA_TARGET_PROJECT_ID
GITLAB_OA_IID
GITLAB_OA_DESCRIPTION
GITLAB_OA_SOURCE_NAME
GITLAB_OA_SOURCE_DESCRIPTION
GITLAB_OA_SOURCE_WEB_URL
GITLAB_OA_SOURCE_AVATAR_URL
GITLAB_OA_SOURCE_GIT_SSH_URL
GITLAB_OA_SOURCE_GIT_HTTP_URL
GITLAB_OA_SOURCE_NAMESPACE
GITLAB_OA_SOURCE_VISIBILITY_LEVEL
GITLAB_OA_SOURCE_PATH_WITH_NAMESPACE
GITLAB_OA_SOURCE_DEFAULT_BRANCH
GITLAB_OA_SOURCE_HOMEPAGE
GITLAB_OA_SOURCE_URL
GITLAB_OA_SOURCE_SSH_URL
GITLAB_OA_SOURCE_HTTP_URL
GITLAB_OA_TARGET_NAME
GITLAB_OA_TARGET_DESCRIPTION
GITLAB_OA_TARGET_WEB_URL
GITLAB_OA_TARGET_AVATAR_URL
GITLAB_OA_TARGET_GIT_SSH_URL
GITLAB_OA_TARGET_GIT_HTTP_URL
GITLAB_OA_TARGET_NAMESPACE
GITLAB_OA_TARGET_VISIBILITY_LEVEL
GITLAB_OA_TARGET_PATH_WITH_NAMESPACE
GITLAB_OA_TARGET_DEFAULT_BRANCH
GITLAB_OA_TARGET_HOMEPAGE
GITLAB_OA_TARGE_URL
GITLAB_OA_TARGET_SSH_URL
GITLAB_OA_TARGET_HTTP_URL
GITLAB_OA_LAST_COMMIT_ID
GITLAB_OA_LAST_COMMIT_MESSAGE
GITLAB_OA_LAST_COMMIT_TIMESTAMP
GITLAB_OA_LAST_COMMIT_URL
GITLAB_OA_LAST_COMMIT_AUTHOR_NAME
GITLAB_OA_LAST_COMMIT_AUTHOR_EMAIL
GITLAB_OA_WIP
GITLAB_OA_URL
GITLAB_OA_ACTION
GITLAB_OA_ASSIGNEE_NAME
GITLAB_OA_ASSIGNEE_USERNAME
GITLAB_OA_ASSIGNEE_AVATAR_URL
GITLAB_LABELS_COUNT
GITLAB_LABEL_ID_#
GITLAB_LABEL_TITLE_#
GITLAB_LABEL_COLOR_#
GITLAB_LABEL_PROJECT_ID_#
GITLAB_LABEL_CREATED_AT_#
GITLAB_LABEL_UPDATED_AT_#
GITLAB_LABEL_TEMPLATE_#
GITLAB_LABEL_DESCRIPTION_#
GITLAB_LABEL_TYPE_#
GITLAB_LABEL_GROUP_ID_#
GITLAB_CHANGES_UPDATED_BY_ID_PREV
GITLAB_CHANGES_UPDATED_BY_ID_CURR
GITLAB_CHANGES_UPDATED_AT_PREV
GITLAB_CHANGES_UPDATED_AT_CURR

Job DSL seed job configuration

To create a Job DSL seed job see this tutorial.

Here is a sample seed job script for folder organization job:

organizationFolder('GitLab Organization Folder') {
    description("GitLab org folder created with Job DSL")
    displayName('My Project')
    // "Projects"
    organizations {
        gitLabSCMNavigator {
            projectOwner("baymac")
            credentialsId("i<3GitLab")
            serverName("gitlab-3214")
            // "Traits" ("Behaviours" in the GUI) that are "declarative-compatible"
            traits {
                subGroupProjectDiscoveryTrait() // discover projects inside subgroups
                gitLabBranchDiscovery {
                    strategyId(3) // discover all branches
                }
                originMergeRequestDiscoveryTrait {
                    strategyId(1) // discover MRs and merge them with target branch
                }
                gitLabTagDiscovery() // discover tags
            }
        }
    }
    // "Traits" ("Behaviours" in the GUI) that are NOT "declarative-compatible"
    // For some 'traits, we need to configure this stuff by hand until JobDSL handles it
    // https://issues.jenkins.io/browse/JENKINS-45504
    configure {
        def traits = it / navigators / 'io.jenkins.plugins.gitlabbranchsource.GitLabSCMNavigator' / traits
        traits << 'io.jenkins.plugins.gitlabbranchsource.ForkMergeRequestDiscoveryTrait' {
            strategyId(2)
            trust(class: 'io.jenkins.plugins.gitlabbranchsource.ForkMergeRequestDiscoveryTrait$TrustPermission')
        }
    }
    // "Project Recognizers"
    projectFactories {
        workflowMultiBranchProjectFactory {
            scriptPath 'Jenkinsfile'
        }
    }
    // "Orphaned Item Strategy"
    orphanedItemStrategy {
        discardOldItems {
            daysToKeep(10)
            numToKeep(5)
        }
    }
    // "Scan Organization Folder Triggers" : 1 day
    // We need to configure this stuff by hand because JobDSL only allow 'periodic(int min)' for now
    triggers {
        periodicFolderTrigger {
            interval('1d')
        }
    }
}

To see all the APIs supported by Job DSL you can visit the following link:

http://localhost:8080/jenkins/plugin/job-dsl/api-viewer/index.html#path/organizationFolder-organizations-gitLabSCMNavigator-traits

JCasC configuration to create job

You can also use JCasC to directly create job from a Job DSL seed job. Here's an example of the yaml config:

jobs:
  - script: >
      organizationFolder('GitLab Organization Folder') {
        description("GitLab org folder configured with JCasC")
        displayName('My Project')
        // "Projects"
        organizations {
          gitLabSCMNavigator {
            projectOwner("baymac")
            credentialsId("i<3GitLab")
            serverName("gitlab-3214")
            // "Traits" ("Behaviours" in the GUI) that are "declarative-compatible"
            traits {
              subGroupProjectDiscoveryTrait() // discover projects inside subgroups
              gitLabBranchDiscovery {
                strategyId(3) // discover all branches
              }
              originMergeRequestDiscoveryTrait {
                strategyId(1) // discover MRs and merge them with target branch
              }
              gitLabTagDiscovery() // discover tags
            }
          }
        }
        // "Traits" ("Behaviours" in the GUI) that are NOT "declarative-compatible"
        // For some 'traits, we need to configure this stuff by hand until JobDSL handles it
        // https://issues.jenkins.io/browse/JENKINS-45504
        configure { node ->
            def traits = node / navigators / 'io.jenkins.plugins.gitlabbranchsource.GitLabSCMNavigator' / traits
            traits << 'io.jenkins.plugins.gitlabbranchsource.ForkMergeRequestDiscoveryTrait' {
                strategyId('2')
                trust(class: 'io.jenkins.plugins.gitlabbranchsource.ForkMergeRequestDiscoveryTrait$TrustPermission')
            }
        }
        // "Project Recognizers"
        projectFactories {
            workflowMultiBranchProjectFactory {
                scriptPath 'Jenkinsfile'
            }
        }
        // "Orphaned Item Strategy"
        orphanedItemStrategy {
          discardOldItems {
            daysToKeep(-1)
            numToKeep(-1)
          }
        }
        // "Scan Organization Folder Triggers" : 1 day
        // We need to configure this stuff by hand because JobDSL only allow 'periodic(int min)' for now
        configure { node ->
          node / triggers / 'com.cloudbees.hudson.plugins.folder.computed.PeriodicFolderTrigger' {
            spec('H H * * *')
            interval(86400000)
          }
        }
      }

You can also use file or url to load the script, see this.

Known Issues

  • System Hook feature is still in beta. The plugin only detects when a new project is created. It is not able to detect when a project is destroyed or updated. For the changes to reflect branch indexing needs to be performed manually or wait for the automatic trigger of branch indexing (configured in the job).

How to talk to us?

Acknowledgements

This plugin was created by the Google Summer of Code (GSoC) Team for Multibranch Pipeline Support for GitLab.

Current Maintainers:

gitlab-branch-source-plugin's People

Contributors

basil avatar basilevs avatar baymac avatar callum-p avatar cpt1gl0 avatar dcendents avatar dependabot[bot] avatar dohbedoh avatar dubrsl avatar elimas avatar eugenelesnov avatar fredg02 avatar guillaumelecerf avatar janis-pigoznis avatar jetersen avatar jmini avatar linuxsuren avatar lmife avatar maksym-kit avatar markewaite avatar mifitous avatar mmusenbr avatar mymarche avatar notmyfault avatar rsandell avatar stuartrowe avatar thomasgl-orange avatar tobix avatar turiok avatar zbynek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gitlab-branch-source-plugin's Issues

Remove redundant namespace in front of project name

When selecting Owner namespace that namespace is prefixed on all repositories under the GitLab Branch
That is redundant and not necessary.
Group/ProjectA
Group/ProjectB

When standing in the GitLab Folder Group, why not ommit the Group/ prefix?
If it is even possible, or feasible in Jenkins?

In Blue Ocean these projects are shown as
Group / Group/Project

ClassCastException

Version report

Jenkins and plugins versions report:

Jenkins: 2.322
OS: Linux - 4.15.0-76-generic
---
ace-editor:1.1
ansicolor:1.0.1
ant:1.12
antisamy-markup-formatter:2.5
apache-httpcomponents-client-4-api:4.5.13-1.0
artifactory:3.13.2
authentication-tokens:1.4
authorize-project:1.4.0
azure-credentials:182.v3ccd4a755864
azure-credentials-ext:1.0
azure-keyvault:122.v72c88cfc0c2b
azure-sdk:12.vc102aedd3c66
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.3-3
bouncycastle-api:2.25
branch-api:2.7.0
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloudbees-disk-usage-simple:0.10
cloudbees-folder:6.16
command-launcher:1.6
config-file-provider:3.8.2
configuration-as-code:1.54
credentials:2.6.1
credentials-binding:1.27
display-url-api:2.3.5
durable-task:493.v195aefbb0ff2
echarts-api:5.2.2-1
embeddable-build-status:2.0.3
extended-read-permission:3.2
font-awesome-api:5.15.4-3
gatling:1.3.0
git:4.10.0
git-client:3.10.0
git-server:1.10
github:1.34.1
github-api:1.133
github-branch-source:2.11.3
gitlab-api:1.0.6
gitlab-branch-source:1.5.9
gradle:1.37.1
greenballs:1.15.1
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
htmlpublisher:1.28
ivy:2.1
jackson2-api:2.13.0-230.v59243c64b0a5
jacoco:3.3.0
javadoc:1.6
jaxb:2.3.0.1
jdk-tool:1.5
jjwt-api:0.11.2-9.c8b45b8bb173
job-dsl:1.77
jquery:1.12.4-1
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.53
kubernetes:1.30.11
kubernetes-client-api:5.4.1
kubernetes-credentials:0.9.0
ldap:2.7
lockable-resources:2.12
mailer:1.34
matrix-auth:2.6.8
matrix-project:1.19
maven-plugin:3.15.1
metrics:4.0.2.8
momentjs:1.1.1
okhttp-api:4.9.2-20211102
pam-auth:1.6.1
pipeline-build-step:2.15
pipeline-graph-analysis:1.12
pipeline-input-step:2.12
pipeline-milestone-step:1.3.2
pipeline-model-api:1.9.3
pipeline-model-definition:1.9.3
pipeline-model-extensions:1.9.3
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.9.3
pipeline-stage-view:2.19
pipeline-utility-steps:2.11.0
plain-credentials:1.7
plugin-util-api:2.5.1
popper-api:1.16.1-2
popper2-api:2.10.2-1
prisma-cloud-jenkins-plugin:21.08.525
prometheus:2.0.10
resource-disposer:0.16
run-condition:1.5
scm-api:2.6.5
script-security:1.78
simple-theme-plugin:0.7
snakeyaml-api:1.29.1
sonar:2.14
ssh-agent:1.23
ssh-credentials:1.19
ssh-slaves:1.33.0
sshd:3.1.0
structs:1.24
token-macro:267.vcdaea6462991
trilead-api:1.0.13
variant:1.4
view-job-filters:2.3
workflow-aggregator:2.6
workflow-api:2.47
workflow-basic-steps:2.24
workflow-cps:2633.v6baeedc13805
workflow-cps-global-lib:548.v9085a486966a
workflow-durable-task-step:2.39
workflow-job:2.42
workflow-multibranch:2.26
workflow-scm-step:2.13
workflow-step-api:2.24
workflow-support:3.8
  • What Operating System are you using (both controller, and any agents involved in the problem)?
OS: Linux - 4.15.0-76-generic

Reproduction steps

  • This worked in Jenkins 2.289
  • Use a seed pipeline to create jobs in code
  • Add a io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource
  • Save the job
  • Call the afterSave method of GitLabSCMSource

Results

Expected result:

Webhooks on GitLab are managed/maintained

Actual result:

2021-12-01 10:28:05.577+0000 [id=6345] WARNING i.j.p.g.GitLabHookCreator#register: Could not manage project hooks for group/project on http://git4lab8
java.lang.ClassCastException: Cannot cast org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory to org.glassfish.jersey.internal.inject.InjectionManagerFactory
at java.base/java.lang.Class.cast(Class.java:3605)
at org.glassfish.jersey.internal.ServiceFinder$LazyObjectIterator.hasNext(ServiceFinder.java:690)
at org.glassfish.jersey.internal.inject.Injections.lookupService(Injections.java:88)
at org.glassfish.jersey.internal.inject.Injections.lookupInjectionManagerFactory(Injections.java:73)
at org.glassfish.jersey.internal.inject.Injections.createInjectionManager(Injections.java:44)
at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:412)
at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:317)
at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:807)
at org.glassfish.jersey.client.ClientRequest.getClientRuntime(ClientRequest.java:219)
at org.glassfish.jersey.client.ClientRequest.getInjectionManager(ClientRequest.java:610)
at org.glassfish.jersey.client.JerseyWebTarget.onBuilder(JerseyWebTarget.java:364)
at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:192)
at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:36)
at org.gitlab4j.api.GitLabApiClient.invocation(GitLabApiClient.java:783)
at org.gitlab4j.api.GitLabApiClient.invocation(GitLabApiClient.java:748)
at org.gitlab4j.api.GitLabApiClient.get(GitLabApiClient.java:399)
at org.gitlab4j.api.GitLabApiClient.get(GitLabApiClient.java:387)
at org.gitlab4j.api.AbstractApi.get(AbstractApi.java:213)
Caused: org.gitlab4j.api.GitLabApiException: Cannot cast org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory to org.glassfish.jersey.internal.inject.InjectionManagerFactory
at org.gitlab4j.api.AbstractApi.handle(AbstractApi.java:655)
at org.gitlab4j.api.AbstractApi.get(AbstractApi.java:215)
at org.gitlab4j.api.Pager.(Pager.java:92)
at org.gitlab4j.api.ProjectApi.getHooks(ProjectApi.java:1802)
at org.gitlab4j.api.ProjectApi.getHooksStream(ProjectApi.java:1815)
at io.jenkins.plugins.gitlabbranchsource.GitLabHookCreator.createWebHookWhenMissing(GitLabHookCreator.java:213)
at io.jenkins.plugins.gitlabbranchsource.GitLabHookCreator.register(GitLabHookCreator.java:97)
at io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource.afterSave(GitLabSCMSource.java:731)
at jdk.internal.reflect.GeneratedMethodAccessor571.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:47)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at com.mastercard.labs.tools.Jenkins.setupWebhooks(Jenkins.groovy:315)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20)
at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixName(FunctionCallBlock.java:78)
at jdk.internal.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
at com.cloudbees.groovy.cps.Next.step(Next.java:83)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:402)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:314)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:278)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

Cannot configure ForkMergeRequestDiscoveryTrait with job-dsl

Version report

Jenkins and plugins versions report:

Jenkins: 2.284
OS: Linux - 4.15.0-137-generic
---
durable-task:1.35
custom-tools-plugin:0.8
gitlab-api:1.0.6
plain-credentials:1.7
git-client:3.7.0
pam-auth:1.6
git-server:1.9
momentjs:1.1.1
ssh-credentials:1.18.2
email-ext:2.82
script-security:1.76
apache-httpcomponents-client-4-api:4.5.13-1.0
checks-api:1.6.1
mailer:1.33
display-url-api:2.3.4
h2-api:1.4.199
antisamy-markup-formatter:2.1
timestamper:1.12
pipeline-model-extensions:1.8.4
jjwt-api:0.11.2-9.c8b45b8bb173
jquery3-api:3.5.1-3
ldap:2.4
jackson2-api:2.12.1
pipeline-milestone-step:1.3.2
pipeline-stage-view:2.19
workflow-cps:2.90
theme-manager:0.6
cloudbees-folder:6.15
popper-api:1.16.1-2
job-dsl:1.77
workflow-scm-step:2.12
github-api:1.123
workflow-job:2.40
pipeline-model-api:1.8.4
lockable-resources:2.10
plugin-util-api:2.0.0
workflow-api:2.42
handy-uri-templates-2-api:2.1.8-1.0
bootstrap4-api:4.6.0-2
workflow-basic-steps:2.23
jdk-tool:1.5
ws-cleanup:0.39
junit:1.49
workflow-cps-global-lib:2.18
pipeline-model-definition:1.8.4
github-branch-source:2.10.2
snakeyaml-api:1.27.0
structs:1.22
bouncycastle-api:2.20
credentials-binding:1.24
pipeline-build-step:2.13
github:1.33.1
handlebars:1.1.1
config-file-provider:3.7.0
pipeline-maven:3.10.0
gitlab-branch-source:1.5.4
credentials:2.3.15
gradle:1.36
jsch:0.1.55.2
workflow-aggregator:2.6
trilead-api:1.0.13
workflow-support:3.8
scm-api:2.6.4
matrix-auth:2.6.6
font-awesome-api:5.15.2-2
git:4.7.0
ace-editor:1.1
token-macro:2.15
echarts-api:5.0.1-1
command-launcher:1.5
workflow-step-api:2.23
workflow-multibranch:2.22
branch-api:2.6.3
build-timeout:1.20
workflow-durable-task-step:2.38
pipeline-stage-tags-metadata:1.8.4
pipeline-graph-analysis:1.10
okhttp-api:3.14.9
matrix-project:1.18
pipeline-input-step:2.12
pipeline-rest-api:2.19
pipeline-github-lib:1.0
pipeline-stage-step:2.5
jquery:1.12.4-1
sshd:3.0.3
ssh-slaves:1.31.6
dark-theme:0.0.12
ant:1.11
resource-disposer:0.15
extended-choice-parameter:0.82

Reproduction steps

Results

Expected result:

Discover merge requests from forks available in traits

Actual result:

No fork trait in the list of traits

Notes:

I can almost add it by guessing, but the trust property is a mystery:

multibranchPipelineJob(JOB_NAME) {
    branchSources {
        branchSource {
            source {
                gitlab {
                    serverName('server-name')
                    projectOwner('project-owner')
                    projectPath('project-owner/project')
                    credentialsId('credentials-id')
                    traits {
                        forkMergeRequestDiscoveryTrait {
                            strategyId(1)
                            trust(????)
                        }
                    }
                }
            }
        }
    }
}

Feature Trigger build on MR comment doesn't work

Jenkins and plugins versions :

We are using Jenkins 2.235.5 version, GitLab Branch Source 1.5.4 version and GitLab 13.9 version

Issue description :

I tried to rebuild my pipeline via the "Trigger build on merge request comment" behaviour, but this option does not work. When I type the rebuild message in Gitlab, nothing happens in Jenkins. It seems that the rebuild is not triggered.
build_MR_commentaire
rebuild_commentaire_git

I have this in my jenkins logs :
Stacktrace_comment
Is there a work-around and is it a known issue?
My server and my webhook are correctly configured and other behaviours I tried work properly.
web_hook_config
GitLab_server_config

Thanks for your help

No longer works without secret token

The new plugin version 1.5.2/1.5.3 no longer works without a configured secret token compared to 1.5.1.

No events trigger a build anymore, only a manual scan does.
Reverting to 1.5.1 restores old behavior.

Jan 04, 2021 7:22:21 PM WARNING hudson.init.impl.InstallUncaughtExceptionHandler handleException
Caught unhandled exception with ID bed65132-413c-4a4e-80a9-00e4d02567b4
java.lang.Exception: Expecting a valid secret token
	at org.kohsuke.stapler.HttpResponses.error(HttpResponses.java:91)
	at io.jenkins.plugins.gitlabbranchsource.GitLabWebHookAction.doPost(GitLabWebHookAction.java:75)

Latest commits not reliably detected when branches are fetched

After pushing a commit and getting triggered by a GitLab webhook, GitLab branch source is not reliably detecting that latest commit. We are repeatedly encountering the issue where GitLab branch source reports "no changes detected" for the respective branch in the Jenkins multibranch pipeline event log and consequently does not trigger a build.

Doing some investigation I found the cause of the issue being the GitLab API itself not reliably giving the latest commit for existing branches. The reason behind this is a caching mechanism which was lately introduced into GitLab API when querying multiple branches.

Better names for MR Builds

Feature Request

It should be possible to define own name patterns for merge request builds.

For example:
Instead of this
MR-[build number]
the name should be this
MR-[build number] | [branch name]

Question on proxy use

Hello, looks like when we do a Scan Gitlab Group Now, it tries to access gitlab.com directly. We use a proxy in order to connect to Gitlab. Any way to get this to use the proxy setting set at the Jenkins instance level?

webhook does not work, and the GitLabPushSCMEvent.isMatch method throw NullPointException

Versions:
Jenkins 2.268
GitLab 10.0.0
Gitlab API Plugin 1.0.6
GitLab Branch Source Plugin 1.5.10

Hello, thank you provide the very powerful plugin
but when i use to create multiple branches project, webhook does not worked.
Jenkins system log view as follows
`
handleEvent: X-Gitlab-Event=Push Hook

SCMEventListener.onSCMHeadEvent(SCMHeadEvent) jenkins.branch.OrganizationFolder$SCMEventListenerImpl@5e6377ad propagated an exception
java.lang.NullPointerException
at io.jenkins.plugins.gitlabbranchsource.GitLabPushSCMEvent.isMatch(GitLabPushSCMEvent.java:75)
at io.jenkins.plugins.gitlabbranchsource.AbstractGitLabSCMHeadEvent.isMatch(AbstractGitLabSCMHeadEvent.java:56)
at jenkins.branch.OrganizationFolder$SCMEventListenerImpl.onSCMHeadEvent(OrganizationFolder.java:1139)
at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:246)
at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:229)
at jenkins.scm.api.SCMEvent$Dispatcher.run(SCMEvent.java:505)
at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:67)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
`

in class GitLabPushSCMEvent, isMatch method throw NullPointException๏ผŒ

then i insert log in isMatch method,
payload project id is null.
so what should i do?
please help me !
Thank you!

`
@OverRide
public boolean isMatch(@nonnull GitLabSCMSource source) {

LOGGER.info("project="+getPayload().getProject());

LOGGER.info("sourceProjectId="+source.getProjectId());

return getPayload().getProject().getId().equals(source.getProjectId());

}
`

logs
'
project={
"id" : null,
"name" : "xxx",
"description" : "",
"webUrl" : "http://xxxx/xxx/GitPipDemo",
"avatarUrl" : null,
"gitSshUrl" : "git@1xxx:xxxx/GitPipDemo.git",
"gitHttpUrl" : "http://xxxx:xxxx/xxxx/GitPipDemo.git",
"namespace" : "xxxx",
"visibilityLevel" : 0,
"pathWithNamespace" : "xxxx/GitPipDemo",
"defaultBranch" : "feature/test",
"ciConfigPath" : null
....
}
sourceProjectId=2
'

Trigger job when an MR is closed

Hello Team,

Thanks for your good work ! Is it possible to trigger a job when an MR is closed ? I have enabled the Merge request events hooks on gitlab side but I can't trigger the job associated when the MR is closed.

Do I have a specific configuration to do ?

Am I forced to build all branches when pushing to the target branch of multiples MRs ?

Hello, sorry to post as an "issue" but I found no other way to ask my 2 questions :/
The title of this issue regards the second question.

1- I have a multibranch Pipeline job in Jenkins previously set up only with the "git" plugin.
With this "Gitlab Branch Source plugin" Jenkins now detects MergeRequests as MR and build them specifically.
But I still have to keep the classic git plugin otherwise my job is not notified when new commits are pushed.
I this the intended behavior ? I was expecting to need only the "Gitlab Branch Source plugin", not both plugins at the same time.

2- From what I experienced with "Gitlab Branch Source plugin", a push in a branch set as target of multiple MRs will
trigger a build of all those MR at the same time. It is a problem for my job because my legacy application takes
a long time to build and I do not want this behavior: I would like the MR job to build only when there is a push in the
corresponding source branch of the MR. Or build it when I decide. Not upon any commit in the MR's target branch.
Is it possible ?

Regards (and again sorry to post here, I found no other support channel)

Is it possible to use parameterized builds?

Dependencies

N/A

Feature Request

I am interested to know if this plugin supports parameterized builds. (a UI, where a user can input the values inside, before triggering a build)

Jenkins folders for subgroups?

Is it possible to have the GitLab project Jenkins jobs that are created by this plugin put into a Jenkins folder structure corresponding to the GitLab subgroups in the configured group?

I'm working on a migration from Bitbucket Server to GitLab, and the BitBucket branch source plugin makes subfolders for each BitBucket 'project', which is analogous to a GitLab subgroup. We've got ~1000 repos in ~50 BitBucket projects, and we're planning on make a GitLab subgroup for each BitBucket project. It would be great to have a matching hierarchical folder structure in Jenkins for our GitLab CI jobs, rather than having 1000 folders at the same level.

In any case, this plugin is great and is going to save us a huge amount of work either way. Thank you for your work!

If there's a better place for support questions, I'm all ears. I wasn't able to put an issue in the Jenkins JIRA instance, and it seems like the gitter instance is not monitored.

Webhook secret is deleted by JCasC on every restart

Version report

Jenkins and plugins versions report:

Jenkins LTS 2.303.2
GitLab branch source plugin 1.5.9
  • What Operating System are you using (both controller, and any agents involved in the problem)?
Linux

Reproduction steps

  • Define GitLab branch source config in JCasC (Jenkins configuration as code), without setting the webhook secret (since the JCasC config is stored in a public Git repo)
  • Set webhook secret in the global GitLab branch source config
  • Restart Jenkins instance

Results

Expected result:

Since the webhook secret is not set in JCasC, it should not be reset/deleted.

Actual result:

Webhook secret is reset/deleted.

Side note:
Not setting a webhook secret is no longer an option due to #106.

Proposed changes:

  • Do not reset/delete a value of a config field if it's not set in JCasC.
  • Allow to store webhook secret in Jenkins credentials so it's not exposed in plain text JCasC.

Version 1.5.9 breaks gitlab notification for merge requests

With the plugin version 1.5.8 when a merge request was built in jenkins, the plugin would notify gitlab using the revision ref. Now gitlab could easily match the revision with any open merge request. That always worked for me.

Now with the plugin version 1.5.9, if I understand the modification correctly, it is trying to find the correct project id, I would assume in case the MR is from a fork. I can see in the code it parses the jenkins job name, split the string on character "-" and expect the last item of the split to be the merge request ID.

On some projects I have chosen the merge request build strategy "Both the current merge request revision and the merge request merged with the current target branch revision"

Which means for each merge request I get 2 jobs: MR-123-head and MR-123-merge.
Now with the blind string splitting it is trying to convert the strings head and merge to a number, fails to do so and it does not notify gitlab at all. At least it could revert to the previous strategy (revision ref) in that case.

java.lang.NumberFormatException: For input string: "head"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.base/java.lang.Integer.parseInt(Integer.java:652)
	at java.base/java.lang.Integer.parseInt(Integer.java:770)
	at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier.getSourceProjectId(GitLabPipelineStatusNotifier.java:213)
	at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier.sendNotifications(GitLabPipelineStatusNotifier.java:319)
	at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier.access$400(GitLabPipelineStatusNotifier.java:52)
	at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier$JobCheckOutListener.onCheckout(GitLabPipelineStatusNotifier.java:470)
java.lang.NumberFormatException: For input string: "merge"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.base/java.lang.Integer.parseInt(Integer.java:652)
	at java.base/java.lang.Integer.parseInt(Integer.java:770)
	at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier.getSourceProjectId(GitLabPipelineStatusNotifier.java:213)
	at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier.sendNotifications(GitLabPipelineStatusNotifier.java:319)
	at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier.access$400(GitLabPipelineStatusNotifier.java:52)
	at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier$JobCompletedListener.onCompleted(GitLabPipelineStatusNotifier.java:483)

Reproduction steps

  • Configure a project to use the Discover merge requests from origin strategy: Both the current merge request revision and the merge request merged with the current target branch revision
  • Open a MR in gitlab, it will forever stay in the "Checking pipeline status" state

Not getting project code from GitLab projects after scanning.

As commented in gitter (link), once you have projects in a group-subgroup-subgroup structure, the scanning process is working fine and finding the projects and branches but it is not getting the code from the branches of the projects found to perform de process over that code that is it implemented in the corresponding jenkinsfile.

Support for forks that are not mirrors, so that MRs are built

Feature Request

We have a GitLab project which is a fork of another project from another team, in order to isolate artefacts and allow an MR flow.

This means we use MRs inside that fork from branches in the fork back to the fork's default branch.

I was puzzled by the lack of MR builds when I have the same Jenkins config and webhooks in both the upstream and fork, until I noticed

Starting branch indexing...

Ignoring merge requests as project is a mirror...

in the scan logs, which pointed me at this unconditional code, which always ignores MRs if a repo is a fork of another repo, even if it is not a mirror.

                    if (gitlabProject.getForkedFromProject() == null) {
                        listener.getLogger()
                            .format(
                                "%nUnable to detect if it is a mirror or not still fetching MRs anyway...%n");
                        List<MergeRequest> mrs = gitLabApi.getMergeRequestApi()
                            .getMergeRequests(gitlabProject, Constants.MergeRequestState.OPENED);
                        mrs = mrs.stream().filter(mr -> mr.getSourceProjectId() != null)
                            .collect(Collectors.toList());
                        request.setMergeRequests(mrs);
                    } else {
                        listener.getLogger()
                            .format("%nIgnoring merge requests as project is a mirror...%n");
                    }

My initial thought was that this should be controlled by a strategy setting.

However, maybe it only makes sense to ignore MRs in a fork if they are targeting the upstream repo (or perhaps any repo other than the current repo), since they will potentially be built by the CI for the upstream repo using the "Discover merge requests from forks" behaviour, i.e. something like

                    if (gitlabProject.getForkedFromProject() == null) {
                        listener.getLogger()
                            .format(
                                "%nUnable to detect if it is a mirror or not still fetching MRs anyway...%n");
                        List<MergeRequest> mrs = gitLabApi.getMergeRequestApi()
                            .getMergeRequests(gitlabProject, Constants.MergeRequestState.OPENED);
                        mrs = mrs.stream().filter(mr -> mr.getSourceProjectId() != null)
                            .collect(Collectors.toList());
                        request.setMergeRequests(mrs);
                    } else {
                        listener.getLogger()
                            .format(
                                "%nCollecting MRs for fork except those that target its upstream...%n");
                        List<MergeRequest> mrs = gitLabApi.getMergeRequestApi()
                            .getMergeRequests(gitlabProject, Constants.MergeRequestState.OPENED);
                        mrs = mrs.stream().filter(mr -> mr.getSourceProjectId() != null && mr.getTargetProjectId() != gitlabProject.getForkedFromProject().getId() )
                            .collect(Collectors.toList());
                        request.setMergeRequests(mrs);
                    }

GitLab being notified of 2 builds per branch even when the discover strategy is configured as branch revision only

Sometimes Merge Requests from Multibranch pipeline jobs using GitLab Branch Source plugin notify GitLab of 2 pipelines per build instead of only one. This messes with GitLab as it thinks that one pipeline is running forever.

Version report

Unfortunately I can't easily run the versions fetching script on the Jenkins console, but I can list the most important versions manually:

Plugin Version
Jenkins 2.263.4
GitLab Branch Source Plugin 1.5.7
Job DSL 1.77
Jenkins Git plugin 4.7.1
Pipeline Utility Steps 2.7.1
Pipeline: Basic Steps 2.23
Pipeline: Build Step 2.13
Pipeline: Declarative 1.8.4
Pipeline: Groovy 2.90
Pipeline: Input Step 2.12
Pipeline: Job 2.40
Basic Branch Build Strategies Plugin 1.3.2
Branch API Plugin 2.6.2
Gitlab API Plugin 1.0.6
Pipeline: API 2.42
Pipeline: Declarative Extension Points API 1.8.4
Pipeline: Job 2.40
Pipeline: Model API 1.8.4
Pipeline: REST API Plugin 2.19
Pipeline: Stage Tags Metadata 1.8.4
Pipeline: Stage View Plugin 2.19
Pipeline: Step API 2.23
Pipeline: Supporting APIs 3.8
  • What Operating System are you using (both controller, and any agents involved in the problem)?
    Linux host running agents on K8s Linux.

Reproduction steps

  • Create a multibranch pipeline job connecting to GitLab
  • Configure it to track only MRs and to build only the source branch from it
    In our case we have it configured with something like this:
                      traits {
                          gitLabBranchDiscovery {
                              strategyId(1) // Only branches not also listed as MRs
                          }
                          originMergeRequestDiscoveryTrait {
                              strategyId(2) // Discover Merge requests from origin, build the branch directly
                          }
                          headWildcardFilter {
                              includes("MR-*")
                              excludes('')
                          }
                      }
    
  • Create a new MR from a branch
  • Check triggered pipelines on GitLab for the MR
  • Sometimes 2 pipelines are created

Results

Expected result:
Only one pipeline job per branch/push is created on GitLab, as in the following example of a well behaving MR:
Screen Shot 2021-11-02 at 19 51 01

Actual result:
Two pipelines are triggered, one named jenkinsci/mr-merge and another one jenkinsci/mr-head, as the bad example from another MR, from the same project, generated automatically with the same configuration as the above one, just a few hours before:
Screen Shot 2021-11-02 at 19 54 22

NPE When creating webhooks for Organisation folders

Somewhere after version 1.4.1 a NullPointer Exception was introduced, when creating webHooks for subprojects within an organisation folder.
To reproduce it, scan for subprojects within an organisation folder and confuigure that webhooks should be created.

Here is the log for this behavior:
[Thu Jun 10 14:26:37 CEST 2021] Starting organization scan...
[Thu Jun 10 14:26:37 CEST 2021] Updating actions...
Group URL: ...
[Thu Jun 10 14:26:40 CEST 2021] Consulting GitLab Group
Checking projects...

Checking project ...
ERROR: [Thu Jun 10 14:26:45 CEST 2021] Could not fetch sources from navigator io.jenkins.plugins.gitlabbranchsource.GitLabSCMNavigator@d87e8c0a
[Thu Jun 10 14:26:45 CEST 2021] Finished organization scan. Scan took 7.7 sec
FATAL: Failed to recompute children of ...
java.lang.NullPointerException
at io.jenkins.plugins.gitlabbranchsource.GitLabSCMNavigator.visitSources(GitLabSCMNavigator.java:274)
at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:542)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:1031)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE

GitLab pipeline status notifications for specific branch

Would it be possible to have GitLab pipeline status notifications for a specific branch and not for all branches at the same commit?

At the moment if you have two branches A and B both pointing to the same commit, GitLab status will be updated for both branches, no matter if Jenkins is building for branch A or B.

Credential GitLab Personnal Access Token should be System and not Global

Hello,

We have a security issue with the scope of the credential used in the plugin
Wen we configure the GitLab Server, we have to specify a GitLab Personnal Access Token. This credential have to be in global scope for the plugin to work.
This causes security ploblems because the credential can be used by everyone and everywhere. Indeed it would be a great improvement if the credential can be specified only in System scope (visible only by admins).

Thanks for your help :)

Hook executed successfully but returned HTTP 401

jenkins version : 2.276
GitLab Branch Source Plugin version: 1.5.3
OS:Centos7
GitLab Community Edition 13.0.10
I have Credentials verified for user,but Hook executed successfully but returned HTTP 401,gitlab webhook not works

please help
1
2
3

Please support the "GitLab API Token" credential from GitLab Plugin

This plugin introduces "GitLab Personal Access Token", which appears to serve the same purpose as the "GitLab API Token" from the GitLab Plugin.

It'd be nice if this plugin could consume GitLab API Tokens where it consumes GitLab Personal Access Token, to save duplication of credential entries.

And if it can't do that in the GitLab Server case, then it'd be nice if the "Convert login and password to token" feature also supported "Convert GitLab API Token to token", and even "Convert Secret Text to token", since it turns out our local Jenkins has API tokens for GitLab in the "Secret text" type too.

Gitlab group scan access denied

Version report

Jenkins and plugins versions report:

Jenkins: 2.277.2
OS: Linux - 3.10.0-1160.24.1.el7.x86_64
---
jdk-tool:1.5
script-security:1.77
command-launcher:1.6
structs:1.23
jacoco:3.2.0
workflow-step-api:2.23
scm-api:2.6.4
workflow-api:2.44
bouncycastle-api:2.20
junit:1.50
matrix-project:1.18
dashboard-view:2.17
workflow-scm-step:2.12
credentials:2.5
apache-httpcomponents-client-4-api:4.5.13-1.0
ssh-credentials:1.18.1
jsch:0.1.55.2
git-client:3.7.2
display-url-api:2.3.5
mailer:1.34
git:4.7.2
jira-ext:0.9
jenkins-jira-issue-updater:1.18
jira-trigger:1.0.1
javadoc:1.6
antisamy-markup-formatter:2.1
sonar:2.13.1
workflow-support:3.8
workflow-job:2.41
gitlab-plugin:1.5.20
jackson2-api:2.12.3
cloudbees-folder:6.15
branch-api:2.6.4
jira:3.3
jquery:1.12.4-1
git-parameter:0.9.13
ant:1.11
chucknorris:1.4
gradle:1.36
ace-editor:1.1
jquery-detached:1.2.1
workflow-cps:2.92
token-macro:2.15
config-file-provider:3.8.0
ivy:2.1
artifactory:3.11.4
pipeline-stage-tags-metadata:1.8.5
locale:1.4
ldap:2.7
plain-credentials:1.7
lockable-resources:2.11
pipeline-model-extensions:1.8.5
pipeline-milestone-step:1.3.2
pipeline-input-step:2.12
pipeline-stage-step:2.5
pipeline-graph-analysis:1.11
pipeline-rest-api:2.19
handlebars:3.0.8
momentjs:1.1.1
pipeline-stage-view:2.19
pipeline-build-step:2.13
credentials-binding:1.25
pipeline-model-api:1.8.5
workflow-durable-task-step:2.39
git-server:1.9
workflow-cps-global-lib:2.19
workflow-multibranch:2.24
authentication-tokens:1.4
docker-commons:1.17
durable-task:1.37
workflow-basic-steps:2.23
docker-workflow:1.26
pipeline-model-definition:1.8.5
workflow-aggregator:2.6
publish-over:0.22
active-directory:2.24
publish-over-cifs:0.16
slack:2.48
pam-auth:1.6
windows-slaves:1.8
external-monitor-job:1.7
matrix-auth:2.6.7
greenballs:1.15.1
blueocean-rest:1.24.7
pubsub-light:1.16
github-api:1.123
github-branch-source:2.10.2
blueocean-jwt:1.24.7
blueocean-rest-impl:1.24.7
blueocean-core-js:1.24.7
github:1.33.1
blueocean-commons:1.24.7
blueocean-pipeline-scm-api:1.24.7
variant:1.4
favorite:2.3.3
blueocean-pipeline-api-impl:1.24.7
blueocean-github-pipeline:1.24.7
blueocean-git-pipeline:1.24.7
blueocean-config:1.24.7
mercurial:2.15
handy-uri-templates-2-api:2.1.8-1.0
cloudbees-bitbucket-branch-source:2.9.9
blueocean-bitbucket-pipeline:1.24.7
blueocean-dashboard:1.24.7
blueocean-personalization:1.24.7
blueocean-jira:1.24.7
blueocean-display-url:2.4.1
sse-gateway:1.24
blueocean-events:1.24.7
blueocean-autofavorite:1.2.4
blueocean:1.24.7
jenkins-design-language:1.24.7
blueocean-pipeline-editor:1.24.7
role-strategy:3.1.1
pipeline-npm:0.9.2
h2-api:1.4.199
pipeline-maven:3.10.0
analysis-model-api:10.2.5
warnings-ng:9.2.0
code-coverage-api:1.3.2
cobertura:1.16
enhanced-old-build-discarder:1.4
blueocean-web:1.24.7
blueocean-i18n:1.24.7
extended-read-permission:3.2
forensics-api:1.1.0
maven-plugin:3.12
htmlpublisher:1.25
Office-365-Connector:4.15.0
extensible-choice-parameter:1.7.0
embeddable-build-status:2.0.3
next-build-number:1.6
cloudbees-disk-usage-simple:0.10
plugin-util-api:2.3.0
font-awesome-api:5.15.3-3
popper-api:1.16.1-2
jquery3-api:3.6.0-1
bootstrap4-api:4.6.0-3
echarts-api:5.1.2-2
data-tables-api:1.10.25-1
publish-over-ssh:1.22
nodejs:1.4.0
metrics:4.0.2.8
prometheus:2.0.10
snakeyaml-api:1.29.1
folder-auth:1.3
okhttp-api:3.14.9
trilead-api:1.0.13
jjwt-api:0.11.2-9.c8b45b8bb173
copyartifact:1.46.1
run-condition:1.5
copy-project-link:1.5
python:1.3
envinject-api:1.7
gitlab-api:1.0.6
gitlab-branch-source:1.5.7
ruby-runtime:0.12
gitlab-hook:1.4.2
authorize-project:1.4.0
checks-api:1.7.0
caffeine-api:2.9.1-23.v51c4e2c879c8
adoptopenjdk:1.4
mapdb-api:1.0.9.0
popper2-api:2.5.4-2
bootstrap5-api:5.0.1-2
subversion:2.14.4
basic-branch-build-strategies:1.3.2
  • What Operating System are you using (both controller, and any agents involved in the problem)?
Jenkins: 
Hardware   : VMware Virtual Machine (SN=42347bba748457ca-d6636e286da09)
Processor  : 4 x Intel Xeon E5-2650v4 2,20GHz (1C,30MB Cache,64 Bit,MC:IBRS)
Additional : 4 cores, HT=off, 16 GB Memory (DDR)
System     : Linux Kernel 3.10.0-1160.24.1.el7.x86_64 on x86_64 (64 Bit)
Distrib    : Red Hat Enterprise Linux Server release 7.9 (Maipo)

Gitlab: 
Hardware   : VMware Virtual Machine (SN=42344548e0a2234f-a5510b677d724)
Processor  : 4 x Intel Xeon E5-2650v4 2,20GHz (1C,30MB Cache,64 Bit,MC:IBRS)
Additional : 4 cores, HT=off, 16 GB Memory (DDR)
System     : Linux Kernel 3.10.0-1160.24.1.el7.x86_64 on x86_64 (64 Bit)
Distrib    : Red Hat Enterprise Linux Server release 7.9 (Maipo)

Reproduction steps

  • Create a Gitlab group with many projects
  • Scan this gitlab group

Results

Expected result:

All projects which contain a Jenkinsfile to show up in the Gitlab group in Jenkins.

Actual result:

After a number of projects errors start showing up:

Checking project xxx/yyy/zzz
Cannot set web hook: Forbidden
Proposing xxx/yyy/zzz
ERROR: Failed to create or update a subproject xxx/yyy/zzz
org.gitlab4j.api.GitLabApiException: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>ERROR: The requested URL could not be retrieved</title>
<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
</head><body>
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
<hr>
<p>The following error was encountered while trying to retrieve the URL: <a href="gitlab.xxx.com:443">gitlab.xxx.com:443</a></p>

<blockquote>
<p><b>Access Denied.</b></p>
</blockquote>

<p>Access control configuration prevents your request from being allowed at this time.  Please contact your service provider if you feel this is incorrect.</p>

<hr>
URL: CONNECT gitlab.xxx.com:443 <br>
User: - xx.xxx.xxx.xx <br>
Error: [not available] <br>
<hr>

<div id="footer">Generated Mon, 28 Jun 2021 07:27:29 GMT by xxx (squid/2.6.STABLE21)</div>
</body></html>

	at org.gitlab4j.api.AbstractApi.validate(AbstractApi.java:633)
	at org.gitlab4j.api.AbstractApi.get(AbstractApi.java:213)
	at org.gitlab4j.api.ProjectApi.getProject(ProjectApi.java:673)
	at io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource.getGitlabProject(GitLabSCMSource.java:204)
Caused: java.lang.IllegalStateException: Failed to retrieve project vds/admin/building/releases/adams-car/2020/plugins/digital-road-sim-user
	at io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource.getGitlabProject(GitLabSCMSource.java:209)
	at io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource.retrieve(GitLabSCMSource.java:308)
	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:327)
	at jenkins.branch.MultiBranchProjectFactory$BySCMSourceCriteria.recognizes(MultiBranchProjectFactory.java:261)
	at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.recognizes(OrganizationFolder.java:1466)
	at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.complete(OrganizationFolder.java:1481)
	at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:254)
	at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:204)
	at io.jenkins.plugins.gitlabbranchsource.GitLabSCMNavigator.visitSources(GitLabSCMNavigator.java:282)
	at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:542)
	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
	at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:1031)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)

This is not always at the same project, indexed projects function well, sometimes all the projects are indexed, other times not. I tried looking in the Gitlab access logs at this point in time but this shows not major errors. To be complete I added a part of the gitlab_access.log:

193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_1>/repository/files/Jenkinsfile?ref=f1ef40899c46170a693c2d17b0466a0b3d7c5ea6 HTTP/1.1" 200 798 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" 1.94
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_2> HTTP/1.1" 200 1334 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" 2.87
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/962/repository/branches?per_page=96&page=1 HTTP/1.1" 200 886 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" 4.25
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_1>/repository/files/Jenkinsfile?ref=55da6dc8910b5e581bdf0a7bbbee3e5a5b8e0d4e HTTP/1.1" 200 798 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" 1.94
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/962/merge_requests?state=opened&per_page=96&page=1 HTTP/1.1" 200 2 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" -
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_2>/members/all?per_page=96&page=1 HTTP/1.1" 200 1054 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" 4.38
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_1>/repository/files/Jenkinsfile?ref=b7eba3b9c7b3ea1cff69d83ead15dd7bb0ba00e1 HTTP/1.1" 200 798 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" 1.94
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/960/repository/branches?per_page=96&page=1 HTTP/1.1" 200 406 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" 2.30
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/962/repository/tags?per_page=96&page=1 HTTP/1.1" 200 2602 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" 4.48
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_1>/repository/files/Jenkinsfile?ref=3f25a09dfcd429fa96a9b9e51081a2869f9b0448 HTTP/1.1" 404 32 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" -
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/960/merge_requests?state=opened&per_page=96&page=1 HTTP/1.1" 200 2 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" -
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_3>/repository/files/Jenkinsfile?ref=e4f030cb7717d293c73aeab0e22af9cdcadddbae HTTP/1.1" 200 797 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" 1.94
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_1>/repository/tree?id=<redacted_4>&path=Jenkinsfile&ref=3f25a09dfcd429fa96a9b9e51081a2869f9b0448&recursive=false&per_page=96&page=1 HTTP/1.1" 200 2 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" -
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/960/repository/tags?per_page=96&page=1 HTTP/1.1" 200 493 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" 3.27
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_1>/repository/files/Jenkinsfile?ref=1d043eaf70bb93584e89428108950d1bdba5af7a HTTP/1.1" 404 32 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" -
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_3>/repository/files/Jenkinsfile?ref=f1ef40899c46170a693c2d17b0466a0b3d7c5ea6 HTTP/1.1" 200 798 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" 1.94
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_2>/repository/files/Jenkinsfile?ref=55995442c35c63d17de950ea453c0af443e58772 HTTP/1.1" 200 581 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" 1.89
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_1>/repository/tree?id=<redacted_4>&path=Jenkinsfile&ref=1d043eaf70bb93584e89428108950d1bdba5af7a&recursive=false&per_page=96&page=1 HTTP/1.1" 200 2 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" -
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_3>/repository/files/Jenkinsfile?ref=5f0fcab4821f41f3c12a72f2300469dbf503428b HTTP/1.1" 404 32 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" -
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_2>/hooks?per_page=96&page=1 HTTP/1.1" 200 306 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" 1.82
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_1>/repository/files/Jenkinsfile?ref=8b9c1fb7aa5dc9ee0ec00838b8e62d504ffb71ec HTTP/1.1" 404 32 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" -
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/hooks?per_page=96&page=1 HTTP/1.1" 403 27 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" -
193.187.198.121 - - [28/Jun/2021:09:27:29 +0200] "GET /api/v4/projects/<redacted_3>/repository/tree?id=<redacted_4>&path=Jenkinsfile&ref=5f0fcab4821f41f3c12a72f2300469dbf503428b&recursive=false&per_page=96&page=1 HTTP/1.1" 200 2 "" "Jersey/2.30.1 (Apache HttpClient 4.5.9)" -

No apparent "Generate Secret Token" button in GitLab Server setup

If I understand the docs correctly,

The secret token is required to authenticate the webhook payloads received from GitLab Server. Use generate secret token from Advanced options or use your own. If you are a old plugin user and did not set a secret token previously and want secret token to applied to the hooks of your existing jobs, you can add the secret token and rescan your jobs. Existing hooks with new secret token will be applied.

there should be some "Advanced" button which exposes a "Generate Secret Token" button, which should call generateSecretToken.

However, I can't see anywhere in this codebase that calls that function, or hooks up the help text.

Was this feature simply not implemented?

Based on that function, I'm using

dd if=/dev/random bs=16 count=1 2>/dev/null | md5sum -

to generate the secret token in the meantime.

MR clone with Group Pipeline not working

Version report

GitLab EE 13.12.3-ee

Jenkins: 2.299
OS: Windows Server 2012 - 6.2
---
ace-editor:1.1
active-directory:2.24
analysis-core:1.96
ant:1.11
antisamy-markup-formatter:2.1
apache-httpcomponents-client-4-api:4.5.13-1.0
artifactdeployer:1.2
artifactory:3.11.4
authentication-tokens:1.4
blueocean-commons:1.24.7
blueocean-core-js:1.24.7
blueocean-dashboard:1.24.7
blueocean-jwt:1.24.7
blueocean-pipeline-api-impl:1.24.7
blueocean-pipeline-editor:1.24.7
blueocean-pipeline-scm-api:1.24.7
blueocean-rest-impl:1.24.7
blueocean-rest:1.24.7
blueocean-web:1.24.7
bootstrap4-api:4.6.0-3
bootstrap5-api:5.0.1-2
bouncycastle-api:2.20
branch-api:2.6.4
build-keeper-plugin:1.3
build-pipeline-plugin:1.5.8
caffeine-api:2.9.1-23.v51c4e2c879c8
checks-api:1.7.0
cloudbees-folder:6.15
cobertura:1.16
code-coverage-api:1.4.0
command-launcher:1.6
conditional-buildstep:1.4.1
config-file-provider:3.8.0
credentials-binding:1.26
credentials:2.5
cvs:2.19
data-tables-api:1.10.25-1
deploy:1.16
display-url-api:2.3.5
docker-commons:1.17
docker-compose-build-step:1.0
docker-java-api:3.1.5.2
docker-plugin:1.2.2
docker-workflow:1.26
dotnet-as-script:1.0.2
dtkit-api:3.0.0
durable-task:1.37
dynamicparameter:0.2.0
echarts-api:5.1.2-2
email-ext:2.83
envinject-api:1.7
envinject:2.4.0
external-monitor-job:1.7
favorite:2.3.3
files-found-trigger:1.5
font-awesome-api:5.15.3-3
forensics-api:1.1.0
fstrigger:0.41
generic-webhook-trigger:1.74
git-client:3.7.2
git-server:1.9
git:4.7.2
github-api:1.123
github-branch-source:2.11.1
github-organization-folder:1.6
github:1.33.1
gitlab-api:1.0.6
gitlab-branch-source:1.5.7
gradle:1.36
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
htmlpublisher:1.25
http-post:1.2
icon-shim:3.0.0
ivy:2.1
jackson2-api:2.12.3
javadoc:1.6
jdk-tool:1.5
jenkins-design-language:1.24.7
jira:3.5
jjwt-api:0.11.2-9.c8b45b8bb173
job-dsl:1.77
jquery-detached:1.2.1
jquery:1.12.4-1
jquery3-api:3.6.0-1
jsch:0.1.55.2
junit:1.50
ldap:2.7
ldapemail:0.8
lockable-resources:2.11
m2release:0.16.2
mailer:1.34
mapdb-api:1.0.9.0
matrix-auth:2.6.7
matrix-project:1.19
maven-plugin:3.12
momentjs:1.1.1
msbuild:1.30
mstest:1.0.0
mstestrunner:1.3.0
nant:1.4.3
nodejs:1.4.0
nuget:1.1
nunit:0.27
Office-365-Connector:4.15.0
okhttp-api:3.14.9
opencover:1.0.3
pam-auth:1.6
parameterized-trigger:2.41
pipeline-build-step:2.13
pipeline-github-lib:1.0
pipeline-graph-analysis:1.11
pipeline-input-step:2.12
pipeline-milestone-step:1.3.2
pipeline-model-api:1.8.5
pipeline-model-declarative-agent:1.1.1
pipeline-model-definition:1.8.5
pipeline-model-extensions:1.8.5
pipeline-npm:0.9.2
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.8.5
pipeline-stage-view:2.19
pipeline-utility-steps:2.8.0
plain-credentials:1.7
plugin-util-api:2.3.0
pollscm:1.3.1
popper-api:1.16.1-2
popper2-api:2.5.4-2
postbuild-task:1.9
powershell:1.5
preSCMbuildstep:0.3
pubsub-light:1.16
resource-disposer:0.16
run-condition:1.5
saferestart:0.3
scm-api:2.6.4
script-security:1.77
scriptler:3.3
slack:2.48
snakeyaml-api:1.29.1
sonar:2.13.1
ssh-agent:1.23
ssh-credentials:1.19
ssh-slaves:1.32.0
sshd:3.0.3
status-view:1.0
structs:1.23
subversion:2.14.4
token-macro:2.15
translation:1.16
trilead-api:1.0.13
urltrigger:0.49
variant:1.4
veracode-scan:21.6.13.0
viewVC:1.7
windows-slaves:1.8
workflow-aggregator:2.6
workflow-api:2.46
workflow-basic-steps:2.23
workflow-cps-global-lib:2.21
workflow-cps:2.92
workflow-durable-task-step:2.39
workflow-job:2.41
workflow-multibranch:2.26
workflow-scm-step:2.13
workflow-step-api:2.23
workflow-support:3.8
ws-cleanup:0.39
xunit:3.0.2
  • What Operating System are you using (both controller, and any agents involved in the problem)?
Windows 2019 Server

Reproduction steps

I have a number of projects hosted in GitLab EE (under a group). The main branch is protected, merge requests are raised to push changes back to main.

I have created a Jenkins "GitLab Group" pointing to the group, and all the project underneath are recognized and builds are triggering as expected for the main and other branches, however, merge requests are being detected but when the job execute the clone / pull step fails in the JenkinsFile.

I suspect the issue is the checkout, but cannot work out what to change here to make it work ...

    def scmVars = checkout ([
              $class: 'GitSCM',
              branches: scm.branches,
              extensions: [
                [$class: 'CleanBeforeCheckout'],
                [$class: 'PruneStaleBranch']],
              userRemoteConfigs: [[
                 credentialsId: 'blahblah-jenkins-ci', 
                 url: 'ssh://[email protected]:7888/group1/group2/project.git'
              ]]
            ])

I wonder if it might be something to o with the refspec not being set, above to +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/* .

refspec: '+refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*',

Results

Expected result:

Successful checkout / clone of MR.

Actual result:

The recommended git tool is: NONE
using credential sunsystems-jenkins-ci
Cloning the remote Git repository
Cloning repository ssh://[email protected]:7888/group1/group2/project.git
 > git.exe init C:\Jenkins\workspace\Microsoft_Api_MR-1 # timeout=10
Fetching upstream changes from ssh://[email protected]:7888/group1/group2/project.git
 > git.exe --version # timeout=10
 > git --version # 'git version 2.32.0.windows.1'
using GIT_SSH to set credentials SunSystems Jenkins CI
 > git.exe fetch --tags --force --progress -- ssh://[email protected]:7888/group1/group2/project.git +refs/heads/*:refs/remotes/origin/* # timeout=10
Avoid second fetch
[Pipeline] }
[Pipeline] // script
[Pipeline] }
 > git.exe config remote.origin.url ssh://[email protected]:7888/group1/group2/project.git # timeout=10
 > git.exe config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git.exe rev-parse "origin/MR-1^{commit}" # timeout=10
 > git.exe rev-parse "MR-1^{commit}" # timeout=10
[Pipeline] // stage
[Pipeline] stage
[Pipeline] End of Pipeline
...
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
[GitLab Pipeline Status] Notifying merge request build status: FAILED group2/project/MR-1: There was a failure building this commit
[GitLab Pipeline Status] Notified
Finished: FAILURE

Plugin doesn't populate credentials drop down

When configuring GitLab Servers in the Jenkins global configuration, the credentials dropdown doesn't populate with system credentials.

We have a private GitLab server on the same network as our Cloudbees instance. After entering the GitLab URL in the URL field, the UI shows an "Invalid GitLab Server URL".

I did some digging into the source code and figured out that it tries to hit the /projects API of the gitlab instance in order to validate the location. For our instance, you can't hit the /projects API unless you're authorized. Since the credentials drop down seemingly doesn't populate unless you've entered a "valid" gitlab URL (or maybe not at all?), we can't select creds to authorize the GitLab validity check with.

Also, adding new credentials from this configuration doesn't populate the drop down, but it does at them to the list of system credentials for the Jenkins managed master.

Screen shot below:

Screen Shot 2021-01-12 at 7 42 28 AM

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

No projects found from gitlab in Multibranch Pipeline

Version report

Jenkins and plugins versions report:

Using Jenkins 2.309 version, GitLab Branch Source Plugin 1.5.9 version, GitLab Edition 14.0.3
  • What Operating System are you using (both controller, and any agents involved in the problem)?
Ubuntu 20.04.3 LTS

Reproduction steps

step1) add gitlab branch source plugin for jenkins
step2) on gitlab create personal access token with api access
step3) on gitlab create ssh-key and put a public key
step4) on jenkins manage credentials -> global -> add credentials for gitlab access token and ssh key
step5) on jenkins in manage configuration we need to setup gitlab credentials by setting gitlab server url, key and gitlab username
step7) create multibranch pipeline and choose gitlab as source

Results

Expected result:

I am trying to create my multi branch pipeline with a project that is on gitlab

Actual result:

No projects are shown, I tried creating projects that are public, private and internal but none are showing in the projects tab.

jenkinsprojectbug

GitLabSystemHook: Expecting a valid secret token

So it's the hook added to the GitLab system webhooks for detecting job deletion, not the hook attached to the individual GitLab repository.

I think this is a bug in the changes for the webhook token, as Webhooks have their token updated on save, but System hooks lack that code.

I think you should log that as a new issue, that changing the secret token in the Jenkins configuration does not update the system hook in GitLab if it already exists.

In the meantime, I'd suggested either fixing the system hook in GitLab to have the right token, or deleting it, and resaving the GitLab config in Jenkins, which should trigger it to recreate the system hook.

Originally posted by @TBBle in #106 (comment)

@TBBle as you suggested - I created new issues for this problem. If I understand your advice correctly - I should add some secret token to the system hook.
I've tried to add the same token as for webhooks and got error 500 (before I've getting 401 as you can see):
image

Gitlab MR pipelines are not notified anymore (because of PR 128)

PR #128 breaks pipelines for merge requests.

Version report

Jenkins and plugins versions report:

Jenkins 2.277.2
Gitlab branch source plugin 1.5.6

Reproduction steps

On a project, I have jenkins configured to build only the Merge Requests and the main branch (develop)


With version 1.5.5, when a Merge Request was building, in gitlab I could see in the project pipelines page that a pipeline had started for branch branch-name with the commit ref, where branch-name is the source branch of my merge request.

In the merge request page I could also see Pipeline # 123 running for commit ref on branch-name


Now with version 1.5.6, in gitlab in the project pipelines page it says that a pipeline has started for branch MR-200 with the commit ref, where MR-200 is the merge request 200 but not a valid git branch name.

In the merge request page it says Checking pipeline status indefinitely...

Since I have a condition that a pipeline must succeed to allow the merge request to be merged I'm stuck.


I don't propose to revert PR #128, but I think that when jenkins builds a merge request, the ref field should be set to the merge request source branch name.

Also it should be tested with tags as well

Status notification timeout

Sometimes our pipeline freezes because the plugin gets a timeout when sending status notifications to GitLab. Our current solution is to try to resend the status message when it times out. Is it possible to add an option to increase the request timeout?

After some research, we think the timeout occurs in the following code section:
GitLabPipelineStatusNotifier

try {
    GitLabApi gitLabApi = GitLabHelper.apiBuilder(source.getServerName());
    LOGGER.log(Level.FINE, String.format("Notifiying commit: %s", hash));

    if (revision instanceof MergeRequestSCMRevision) {
        Integer projectId = getSourceProjectId(build.getParent(), gitLabApi, source.getProjectPath());
        status.setRef(((MergeRequestSCMRevision) revision).getOrigin().getHead().getName());
        gitLabApi.getCommitsApi().addCommitStatus(
            projectId,
            hash,
            state,
            status);
    } else {
        gitLabApi.getCommitsApi().addCommitStatus(
            source.getProjectPath(),
            hash,
            state,
            status);
    }

    listener.getLogger().format("[GitLab Pipeline Status] Notified%n");
} catch (GitLabApiException e) {
    if(!e.getMessage().contains(("Cannot transition status"))) {
        LOGGER.log(Level.WARNING, String.format("Exception caught: %s",e.getMessage()));
    }
}

GitLab Merge Request pipeline runs upon a certain number of commits

Feature Request

Hi,

I have been working the jenkins gitlab source plugin for running multi branch CI pipelines for merge requests. Currently i'm using this configuration for the pipeline:

merge_request_gitlab_jenkins

The pipeline builds for the current merge request revision as you can see. I want it to run with the option: Merging the merge request with the current target branch revision.
The problem with the latter is that, pipeline builds automatically for every single commit to the target branch of the merge request.

Can a feature be added in such a way that this automatic build for pipeline happens only when there is a specific number of commits to target branch?

If there is an option to specify the number of commits to target branch as 100, then the pipeline for merge request should only build when it is a 100 commits behind the target branch.

Thank you.

Credentials drop down not populating

When configuring GitLab Servers in the Jenkins global configuration, the credentials dropdown doesn't populate with system credentials.

We have a private GitLab server on the same network as our Cloudbees instance. After entering the GitLab URL in the URL field (using a dummy URL), the UI shows an "Invalid GitLab Server URL".

I did some digging into the source code and figured out that it tries to hit the /projects API of the gitlab instance in order to validate the location. For our instance, you can't hit the /projects API unless you're authorized. Since the credentials drop down seemingly doesn't populate unless you've entered a "valid" gitlab URL (or maybe not at all?), we can't select creds to authorize the GitLab validity check with.

Also, adding new credentials from this configuration doesn't populate the drop down, but it does at them to the list of system credentials for the Jenkins managed master.

Screen shot below:

Screen Shot 2021-01-12 at 7 42 28 AM

Branches get randomly "crossed out" for no apparent reason

Version report

Jenkins and plugins versions report:

Jenkins: 2.289.1
OS: Linux - 4.14.232-176.381.amzn2.x86_64
---
jjwt-api:0.11.2-9.c8b45b8bb173
sshd:3.0.3
cloudbees-folder:6.15
trilead-api:1.0.13
durable-task:1.37
antisamy-markup-formatter:2.1
handlebars:3.0.8
structs:1.23
workflow-cps:2.92
workflow-step-api:2.23
token-macro:2.15
build-timeout:1.20
momentjs:1.1.1
credentials:2.5
workflow-job:2.41
plain-credentials:1.7
ssh-credentials:1.19
mailer:1.34
credentials-binding:1.26
scm-api:2.6.4
workflow-api:2.46
timestamper:1.13
caffeine-api:2.9.1-23.v51c4e2c879c8
script-security:1.77
workflow-basic-steps:2.23
plugin-util-api:2.3.0
font-awesome-api:5.15.3-3
jsch:0.1.55.2
popper-api:1.16.1-2
jquery3-api:3.6.0-1
gradle:1.36
bootstrap4-api:4.6.0-3
pipeline-milestone-step:1.3.2
snakeyaml-api:1.29.1
git-client:3.7.2
jackson2-api:2.12.3
popper2-api:2.5.4-2
bootstrap5-api:5.0.1-2
git-server:1.9
echarts-api:5.1.2-2
display-url-api:2.3.5
pipeline-input-step:2.12
workflow-support:3.8
checks-api:1.7.0
branch-api:2.6.4
junit:1.50
matrix-project:1.19
pipeline-stage-step:2.5
resource-disposer:0.16
ws-cleanup:0.39
ant:1.11
workflow-durable-task-step:2.39
pipeline-graph-analysis:1.11
command-launcher:1.6
jdk-tool:1.5
bouncycastle-api:2.20
ace-editor:1.1
workflow-scm-step:2.13
pipeline-rest-api:2.19
blueocean-web:1.24.7
apache-httpcomponents-client-4-api:4.5.13-1.0
generic-webhook-trigger:1.74
pipeline-stage-view:2.19
pipeline-build-step:2.13
pipeline-model-api:1.8.5
aws-credentials:1.29
pipeline-model-extensions:1.8.5
workflow-cps-global-lib:2.21
blueocean-commons:1.24.7
workflow-multibranch:2.26
ec2-fleet:2.3.2
pipeline-stage-tags-metadata:1.8.5
pipeline-model-definition:1.8.5
lockable-resources:2.11
blueocean-rest:1.24.7
workflow-aggregator:2.6
blueocean-jwt:1.24.7
okhttp-api:3.14.9
github-api:1.123
git:4.7.2
github:1.33.1
github-branch-source:2.11.1
pubsub-light:1.16
pipeline-github-lib:1.0
ssh-slaves:1.32.0
favorite:2.3.3
matrix-auth:2.6.7
pam-auth:1.6
ldap:2.7
email-ext:2.83
dashboard-view:2.17
authentication-tokens:1.4
configuration-as-code:1.51
ansicolor:1.0.0
ssh-agent:1.23
msbuild:1.30
config-file-provider:3.8.0
slack:2.48
nodejs:1.4.0
copyartifact:1.46.1
htmlpublisher:1.25
run-condition:1.5
pipeline-npm:0.9.2
javadoc:1.6
blueocean-config:1.24.7
maven-plugin:3.12
conditional-buildstep:1.4.1
handy-uri-templates-2-api:2.1.8-1.0
parameterized-trigger:2.41
jquery:1.12.4-1
jenkins-design-language:1.24.7
git-parameter:0.9.13
role-strategy:3.1.1
publish-over:0.22
publish-over-ssh:1.22
ivy:2.1
ssh:2.6.1
variant:1.4
sse-gateway:1.24
aws-java-sdk:1.11.995
cloudbees-bitbucket-branch-source:2.9.9
blueocean-pipeline-scm-api:1.24.7
blueocean-core-js:1.24.7
blueocean-rest-impl:1.24.7
jobConfigHistory:2.28.1
blueocean-pipeline-api-impl:1.24.7
blueocean-bitbucket-pipeline:1.24.7
blueocean-github-pipeline:1.24.7
blueocean-git-pipeline:1.24.7
blueocean-dashboard:1.24.7
blueocean-personalization:1.24.7
blueocean-display-url:2.4.1
blueocean-events:1.24.7
blueocean-pipeline-editor:1.24.7
blueocean-i18n:1.24.7
blueocean-autofavorite:1.2.4
blueocean:1.24.7
docker-commons:1.17
docker-workflow:1.26
pipeline-aws:1.43
artifactory:3.11.4
pipeline-utility-steps:2.8.0
data-tables-api:1.10.25-1
forensics-api:1.1.0
code-coverage-api:1.4.0
cobertura:1.16
nunit:0.27
s3:0.11.7
file-operations:1.11
rebuild:1.32
http_request:1.9.0
content-replace:1.6.0
extended-choice-parameter:0.82
theme-manager:0.6
material-theme:0.3.3
job-dsl:1.77
build-monitor-plugin:1.12+build.201809061734
gitlab-api:1.0.6
gitlab-branch-source:1.5.8
  • What Operating System are you using (both controller, and any agents involved in the problem)?
ubuntu 18

Reproduction steps

  • Create a new multibranch pipeline
  • Configure Gitlab branch source
  • Add "filter by name (with wildcards) - develop master MR* dev2 dev4 qa prod5
  • Save
  • Branches are discovered and builds are started correctly

Results

Expected result:

Returning to the pipeline UI after some time has passed will still show the same branches as discovered and open, unless they have been removed from Gitlab.

Actual result:

Come back later and see that most discovered branches are "crossed out". Seems like this happens with branches that do not have activity for a while. Branch discovery strategy is set to "all branches" so branches should not be filtered out even if they are filed as MRs (regardless, they are not filed as MRs).

A push to one of these branches re-opens it and starts a build (after a delay of about 10-20 seconds).

Running a manual iscan re-opens all the closed branches.

It looks like some sort of behavior that closes discovered branches on Jenkins if there has not been activity on them for a while, but I've been unable to see any setting related to this.

Archived projects are still visible in Jenkins

Hi there!

Thanks for the awesome plugin! We have archived a few projects in GitLab but they are still showing up as valid projects in Jenkins.

I think what is needed is a call to https://javadoc.io/static/org.gitlab4j/gitlab4j-api/4.12.17/org/gitlab4j/api/models/GroupProjectsFilter.html#withArchived-java.lang.Boolean- but I am unclear if that would need to be brought to the surface as an option in the configuration.

What can I do to assist with this or is there a different route (or something I am missing here)?

Organization folder icons are using not the Jenkins url

Version report

Jenkins and plugins versions report:

Jenkins: 2.277.3
OS: Linux - 4.4.0-210-generic
---
matrix-auth:2.6.6
data-tables-api:1.10.23-3
blueocean-config:1.24.6
docker-commons:1.17
trilead-api:1.0.13
blueocean-autofavorite:1.2.4
blueocean-pipeline-scm-api:1.24.6
matrix-project:1.18
gitlab-branch-source:1.5.7
script-security:1.76
pipeline-stage-view:2.19
handlebars:3.0.8
apache-httpcomponents-client-4-api:4.5.13-1.0
blueocean-commons:1.24.6
jsch:0.1.55.2
github:1.33.1
jackson2-api:2.12.3
dependency-track:3.1.1
junit:1.49
momentjs:1.1.1
blueocean-rest-impl:1.24.6
msbuild:1.30
forensics-api:1.0.0
run-condition:1.5
credentials:2.3.18
gitlab-plugin:1.5.20
variant:1.4
view-job-filters:2.3
influxdb:3.0
build-timeout:1.20
pipeline-utility-steps:2.7.1
pipeline-model-definition:1.8.4
workflow-cps-global-lib:2.19
cobertura:1.16
checks-api:1.7.0
ldap:2.6
pubsub-light:1.13
blueocean-web:1.24.6
pipeline-stage-step:2.5
branch-api:2.6.3
dashboard-view:2.15
jquery3-api:3.6.0-1
blueocean-personalization:1.24.6
authorize-project:1.4.0
pam-auth:1.6
jdk-tool:1.5
blueocean-i18n:1.24.6
blueocean-jwt:1.24.6
bouncycastle-api:2.20
gitlab-api:1.0.6
ldapemail:0.8
maven-plugin:3.10
javadoc:1.6
github-api:1.123
pipeline-rest-api:2.19
okhttp-api:3.14.9
job-dsl:1.77
workflow-multibranch:2.23
snakeyaml-api:1.27.0
cloudbees-folder:6.15
extensible-choice-parameter:1.7.0
http_request:1.9.0
blueocean-rest:1.24.6
mailer:1.34
workflow-basic-steps:2.23
lockable-resources:2.10
conditional-buildstep:1.4.1
pipeline-graph-analysis:1.10
metrics:4.0.2.7
git-server:1.9
plugin-util-api:2.1.0
workflow-job:2.40
code-coverage-api:1.3.2
docker-workflow:1.26
workflow-aggregator:2.6
ssh-steps:2.0.0
authentication-tokens:1.4
active-directory:2.23
ssh-credentials:1.18.1
command-launcher:1.5
PrioritySorter:4.0.0
scm-api:2.6.4
git-client:3.7.1
rebuild:1.32
sonar:2.13.1
artifactory:3.10.6
workflow-durable-task-step:2.38
xvfb:1.1.3
config-file-provider:3.8.0
blueocean-github-pipeline:1.24.6
blueocean-pipeline-api-impl:1.24.6
dependency-check-jenkins-plugin:5.1.1
pipeline-input-step:2.12
warnings-ng:9.0.1
blueocean-git-pipeline:1.24.6
jacoco:3.1.1
ace-editor:1.1
workflow-api:2.42
slack:2.47
ant:1.11
gradle:1.36
plain-credentials:1.7
antisamy-markup-formatter:2.1
htmlpublisher:1.25
font-awesome-api:5.15.2-2
workflow-step-api:2.23
credentials-binding:1.24
blueocean-events:1.24.6
workflow-cps:2.90
sse-gateway:1.24
parameterized-trigger:2.40
blueocean-dashboard:1.24.6
workflow-scm-step:2.12
build-failure-analyzer:2.0.0
token-macro:2.15
show-build-parameters:1.0
display-url-api:2.3.4
jenkins-design-language:1.24.6
pipeline-stage-tags-metadata:1.8.4
blueocean-bitbucket-pipeline:1.24.6
ssh-slaves:1.31.5
external-monitor-job:1.7
docker-java-api:3.1.5.2
monitoring:1.87.0
ivytrigger:0.35
blueocean:1.24.6
echarts-api:5.1.0-2
analysis-model-api:10.0.0
copy-project-link:1.5
git:4.7.1
blueocean-pipeline-editor:1.24.6
windows-slaves:1.7
pipeline-build-step:2.13
popper-api:1.16.1-2
pipeline-milestone-step:1.3.2
pipeline-model-extensions:1.8.4
jjwt-api:0.11.2-9.c8b45b8bb173
bootstrap4-api:4.6.0-3
handy-uri-templates-2-api:2.1.8-1.0
durable-task:1.35
github-branch-source:2.10.2
structs:1.22
blueocean-display-url:2.4.1
ivy:2.1
pipeline-model-api:1.8.4
ssh-agent:1.22
powershell:1.4
favorite:2.3.3
docker-plugin:1.2.2
blueocean-core-js:1.24.6
email-ext:2.82
cloudbees-bitbucket-branch-source:2.9.8
workflow-support:3.8

Reproduction steps

  • Start Jenkins Docker Instance
  • Start GitLab self-managed instance
  • connect both
  • create a group in gitlab
  • create a organization folder in Jenkins for the group
  • copy URL of icon

Results

Expected result:

https://ci.example.com/path-to-the-icon

Actual result:

http://ci.example.com/path-to-the-icon

Seems to ignore the HTTP protocol given in the configured URL.

Give users/groups permission to scan Gitlab group

Dependencies

Feature Request

Sometimes the Gitlab webhook isn't sufficient to trigger the job creation. For example, the repository is created without a Jenkinsfile, so the job isn't created and no webhooks are configured to notify Jenkins when the Jenkinsfile is pushed (it wouldn't make any sense). So I want to give my users the power to force Scan when they need instead of reducing polling frequency. Ideally, I would be able to give this permission to certain user logins or groups.

GitLab repository browser breaks Freestyle job configuration

Version report

Jenkins and plugins versions report:

Click to expand!
Jenkins: 2.289
OS: Linux - 4.15.0-142-generic
---
gitlab-branch-source:1.5.7
gitlab-plugin:1.5.20

ace-editor:1.1
adoptopenjdk:1.4
analysis-model-api:10.0.0
ant:1.11
antisamy-markup-formatter:2.1
apache-httpcomponents-client-4-api:4.5.13-1.0
async-http-client:1.9.40.0
authentication-tokens:1.4
authorize-project:1.4.0
badge:1.8
basic-branch-build-strategies:1.3.2
bitbucket:1.1.27
blueocean-autofavorite:1.2.4
blueocean-bitbucket-pipeline:1.24.6
blueocean-commons:1.24.6
blueocean-config:1.24.6
blueocean-core-js:1.24.6
blueocean-dashboard:1.24.6
blueocean-display-url:2.4.1
blueocean-events:1.24.6
blueocean-git-pipeline:1.24.6
blueocean-github-pipeline:1.24.6
blueocean-i18n:1.24.6
blueocean-jwt:1.24.6
blueocean-personalization:1.24.6
blueocean-pipeline-api-impl:1.24.6
blueocean-pipeline-editor:1.24.6
blueocean-pipeline-scm-api:1.24.6
blueocean-rest-impl:1.24.6
blueocean-rest:1.24.6
blueocean-web:1.24.6
blueocean:1.24.6
bootstrap4-api:4.6.0-3
bouncycastle-api:2.20
branch-api:2.6.3
build-blocker-plugin:1.7.7
build-name-setter:2.2.0
build-timeout:1.20
buildresult-trigger:0.17
checks-api:1.7.0
cloudbees-bitbucket-branch-source:2.9.8
cloudbees-folder:6.15
cloudbees-jenkins-advisor:3.2.5
code-coverage-api:1.3.2
command-launcher:1.5
conditional-buildstep:1.4.1
config-file-provider:3.8.0
configuration-as-code:1.47
configurationslicing:1.52
copyartifact:1.46
credentials-binding:1.24
credentials:2.3.18
data-tables-api:1.10.23-3
description-setter:1.10
display-url-api:2.3.4
docker-commons:1.17
docker-workflow:1.26
dtkit-api:3.0.0
durable-task:1.35
echarts-api:5.1.0-2
elastic-axis:1.3
email-ext:2.82
envinject-api:1.7
envinject:2.4.0
external-monitor-job:1.7
favorite:2.3.3
font-awesome-api:5.15.2-2
forensics-api:1.0.0
git-client:3.7.2-rc2794.85c827b258f0
git-forensics:1.0.0
git-parameter:0.9.13
git-server:1.9
git-userContent:1.4
git:4.7.2-rc4325.76725ac7d380
gitea:1.2.1
github-api:1.222
github-branch-source:2.10.2
github-scm-filter-aged-refs:0.2.0
github-scm-trait-commit-skip:0.4.0
github:1.33.1
gitlab-api:1.0.6
groovy-postbuild:2.5
h2-api:1.4.199
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
htmlpublisher:1.25
implied-labels:0.7
jackson2-api:2.12.3
jacoco:3.1.2-SNAPSHOT (private-b3d6940e-mwaite)
javadoc:1.6
jaxb:2.3.0.1
jdk-tool:1.5
jenkins-design-language:1.24.6
jira:3.2.1
jjwt-api:0.11.2-9.c8b45b8bb173
jmh-report:0.9.1-SNAPSHOT (private-688739fd-RishabhBudhouliya)
job-dsl:1.77
jquery-detached:1.2.1
jquery3-api:3.6.0-1
jquery:1.12.4-1
jsch:0.1.55.2
junit-attachments:1.6
junit-realtime-test-reporter:0.6
junit:1.49
label-verifier:1.4
ldap:2.6
leastload:3.0.0
locale:1.4
lockable-resources:2.10
log-parser:2.1
mailer:1.34
mapdb-api:1.0.9.0
matrix-auth:2.6.6
matrix-project:1.18
maven-plugin:3.10
mercurial:2.14
metrics:4.0.2.7
momentjs:1.1.1
monitoring:1.87.0
naginator:1.18.1
nodelabelparameter:1.8.0
okhttp-api:3.14.9
oracle-cloud-infrastructure-compute:1.0.14
pam-auth:1.6
parallel-test-executor:1.13
parameterized-trigger:2.40
pipeline-build-step:2.13
pipeline-github-lib:1.0
pipeline-graph-analysis:1.10
pipeline-graph-view:0.1
pipeline-input-step:2.12
pipeline-maven:3.10.0
pipeline-milestone-step:1.3.2
pipeline-model-api:1.8.4
pipeline-model-definition:1.8.4
pipeline-model-extensions:1.8.4
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.8.4
pipeline-stage-view:2.19
pipeline-utility-steps:2.7.1
plain-credentials:1.7
platformlabeler:820.ve11757883dbc
plugin-util-api:2.1.0
pollscm:1.3.1
popper-api:1.16.1-2
preSCMbuildstep:0.3
promoted-builds:3.9.1
pubsub-light:1.13
resource-disposer:0.15
run-condition:1.5
scm-api:2.6.4
script-security:1.76
snakeyaml-api:1.27.0
sse-gateway:1.24
ssh-agent:1.22
ssh-credentials:1.18.2
ssh-slaves:1.31.7
sshd:3.0.3
structs:1.22
support-core:2.73
swarm:3.25
text-finder:1.15
throttle-concurrents:2.2
timestamper:1.12
token-macro:2.15
trilead-api:1.0.13
variant:1.4
versioncolumn:2.1
view-job-filters:2.3
warnings-ng:9.0.1
windows-slaves:1.7
workflow-aggregator:2.6
workflow-api:2.42
workflow-basic-steps:2.23
workflow-cps-global-lib:2.19-SNAPSHOT (private-ab276be9-mwaite)
workflow-cps:2.90
workflow-durable-task-step:2.38
workflow-job:2.40
workflow-multibranch:2.23
workflow-scm-step:2.13-rc374.dcd7e780273e
workflow-step-api:2.23
workflow-support:3.8
ws-cleanup:0.39
xshell:0.10
xunit:3.0.2

What Operating System are you using (both controller, and any agents involved in the problem)?

Controller: Jenkins image jenkins/jenkins:2.289 running on a Ubuntu 20.04 operating system
OS: Linux - 4.15.0-142-generic

Reproduction steps

  1. Define a Jenkins freestyle project with git as the SCM
  2. In the "Repository browser" section of the job definition, change the definition from the default '(Auto)' to 'GitLab'
  3. Save the freestyle project
  4. Attempt to configure the freestyle project again and notice that the "Save" button is no longer available on the page. A stack trace is reported to the Jenkins log that:
listScmBrowsers.jelly:43:77: <st:include> No page found 'config.jelly' for 
class io.jenkins.plugins.gitlabbranchsource.helpers.GitLabBrowser$DescriptorImpl

Results

Expected result:

  • Able to reconfigure and save freestyle job that configures the 'GitLab' repository browser

Actual result:

  • Freestyle job configured with 'GitLab' repository browser cannot be configured

Workaround:

  • Use the 'gitlab' repository browser in the freestyle project instead of using the 'GitLab' repository browser

Errors when trying to use a remote Jenkinsfile

Jenkins: 2.277.2
OS: Linux - 5.4.0-1045-aws
---
popper2-api:2.5.4-2
gradle:1.36
cloudbees-folder:6.15
ws-cleanup:0.39
durable-task:1.37
plain-credentials:1.7
pipeline-stage-view:2.19
ec2-fleet:2.3.2
github:1.33.1
ant:1.11
bouncycastle-api:2.20
workflow-job:2.41
pipeline-model-api:1.8.5
workflow-step-api:2.23
timestamper:1.13
workflow-aggregator:2.6
ldap:2.7
pipeline-model-extensions:1.8.5
okhttp-api:3.14.9
pipeline-stage-tags-metadata:1.8.5
plugin-util-api:2.3.0
echarts-api:5.1.2-2
workflow-multibranch:2.24
aws-java-sdk:1.11.995
apache-httpcomponents-client-4-api:4.5.13-1.0
ssh-credentials:1.18.1
matrix-project:1.18
ssh-slaves:1.31.5
bootstrap4-api:4.6.0-3
variant:1.4
lockable-resources:2.11
workflow-support:3.8
branch-api:2.6.4
display-url-api:2.3.5
popper-api:1.16.1-2
pam-auth:1.6
momentjs:1.1.1
ace-editor:1.1
workflow-durable-task-step:2.39
workflow-cps-global-lib:2.21
pipeline-stage-step:2.5
token-macro:2.15
git-client:3.7.2
git-server:1.9
jsch:0.1.55.2
checks-api:1.7.0
structs:1.23
caffeine-api:2.9.1-23.v51c4e2c879c8
pipeline-rest-api:2.19
git:4.7.2
matrix-auth:2.6.7
build-timeout:1.20
handlebars:3.0.8
antisamy-markup-formatter:2.1
jdk-tool:1.5
workflow-scm-step:2.13
pipeline-milestone-step:1.3.2
github-branch-source:2.10.2
snakeyaml-api:1.29.1
pipeline-build-step:2.13
pipeline-input-step:2.12
trilead-api:1.0.13
font-awesome-api:5.15.3-3
workflow-api:2.46
jackson2-api:2.12.3
github-api:1.123
script-security:1.77
jquery3-api:3.6.0-1
mailer:1.34
pipeline-github-lib:1.0
scm-api:2.6.4
pipeline-model-definition:1.8.5
junit:1.50
bootstrap5-api:5.0.1-2
email-ext:2.83
aws-credentials:1.29
pipeline-graph-analysis:1.11
jjwt-api:0.11.2-9.c8b45b8bb173
workflow-basic-steps:2.23
credentials-binding:1.26
resource-disposer:0.16
command-launcher:1.6
credentials:2.5
workflow-cps:2.92
ansicolor:1.0.0
config-file-provider:3.8.0
ivy:2.1
javadoc:1.6
maven-plugin:3.12
artifactory:3.11.4
authentication-tokens:1.4
handy-uri-templates-2-api:2.1.8-1.0
cloudbees-bitbucket-branch-source:2.9.9
blueocean-commons:1.24.7
blueocean-rest:1.24.7
pubsub-light:1.16
blueocean-pipeline-scm-api:1.24.7
htmlpublisher:1.25
jenkins-design-language:1.24.7
blueocean-core-js:1.24.7
blueocean-web:1.24.7
blueocean-jwt:1.24.7
favorite:2.3.3
blueocean-rest-impl:1.24.7
blueocean-pipeline-api-impl:1.24.7
blueocean-bitbucket-pipeline:1.24.7
blueocean-github-pipeline:1.24.7
blueocean-git-pipeline:1.24.7
blueocean-config:1.24.7
blueocean-dashboard:1.24.7
blueocean-personalization:1.24.7
blueocean-display-url:2.4.1
sse-gateway:1.24
blueocean-events:1.24.7
blueocean-pipeline-editor:1.24.7
blueocean-i18n:1.24.7
blueocean-autofavorite:1.2.4
blueocean:1.24.7
configuration-as-code:1.51
configuration-as-code-groovy:1.1
content-replace:1.6.0
dashboard-view:2.17
docker-commons:1.17
docker-workflow:1.26
jquery:1.12.4-1
extended-choice-parameter:0.82
file-operations:1.11
generic-webhook-trigger:1.74
git-parameter:0.9.13
http_request:1.9.0
nodejs:1.4.0
nunit:0.27
run-condition:1.5
conditional-buildstep:1.4.1
parameterized-trigger:2.41
pipeline-npm:0.9.2
pipeline-utility-steps:2.8.0
publish-over:0.22
publish-over-ssh:1.22
rebuild:1.32
role-strategy:3.1.1
copyartifact:1.46.1
s3:0.11.7
slack:2.48
ssh-agent:1.22
ssh:2.6.1
theme-manager:0.6
material-theme:0.3.3
simple-theme-plugin:0.6
gitlab-plugin:1.5.20
gitlab-api:1.0.6
gitlab-branch-source:1.5.7
remote-file:1.17
atlassian-bitbucket-server-integration:2.1.3
mercurial:2.15
bitbucket:1.1.29
stashNotifier:1.20
  • What Operating System are you using (both controller, and any agents involved in the problem)?
Controller: Ubuntu , Agents: Centos

Reproduction steps

  • Create a new Multi Bransh Pipeline
  • Add a Gitlab Server as source code
  • In the Build Configuration use "Remote Jenkins file Provider Plugin" and use a different repo for the Jenkins file.
  • Put the following in the Jenkinsfile:
      pipeline {
        agent {
            node { label 'docker' }
        }
        environment {
            gitCheckoutParams = checkout scm
        }
        triggers {
            pollSCM '* * * * *'
        }
        options {
          timeout(time: 30, unit: 'MINUTES')
          ansiColor('xterm')
        }
      
        stages {
            stage('Initialize'){
                steps{
                    script{ 
                        sh "ls"
                        sh 'printenv'
                    }
                }
            }
        }
      
        }
      }
    
    

Results

Expected result:

Should Run the Job and print the files list.

Actual result:

Job fails with multiple errors:

java.lang.ClassCastException: Cannot cast org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory to org.glassfish.jersey.internal.inject.InjectionManagerFactory
	at java.lang.Class.cast(Class.java:3369)
	at org.glassfish.jersey.internal.ServiceFinder$LazyObjectIterator.hasNext(ServiceFinder.java:690)
	at org.glassfish.jersey.internal.inject.Injections.lookupService(Injections.java:88)
	at org.glassfish.jersey.internal.inject.Injections.lookupInjectionManagerFactory(Injections.java:73)
	at org.glassfish.jersey.internal.inject.Injections.createInjectionManager(Injections.java:44)
	at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:412)
	at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:317)
	at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:807)
	at org.glassfish.jersey.client.ClientRequest.getClientRuntime(ClientRequest.java:219)
	at org.glassfish.jersey.client.ClientRequest.getInjectionManager(ClientRequest.java:610)
	at org.glassfish.jersey.client.JerseyWebTarget.onBuilder(JerseyWebTarget.java:364)
	at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:192)
	at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:36)
	at org.gitlab4j.api.GitLabApiClient.invocation(GitLabApiClient.java:783)
	at org.gitlab4j.api.GitLabApiClient.invocation(GitLabApiClient.java:748)
	at org.gitlab4j.api.GitLabApiClient.get(GitLabApiClient.java:399)
	at org.gitlab4j.api.GitLabApiClient.get(GitLabApiClient.java:387)
	at org.gitlab4j.api.AbstractApi.get(AbstractApi.java:213)
Caused: org.gitlab4j.api.GitLabApiException: Cannot cast org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory to org.glassfish.jersey.internal.inject.InjectionManagerFactory
	at org.gitlab4j.api.AbstractApi.handle(AbstractApi.java:655)
	at org.gitlab4j.api.AbstractApi.get(AbstractApi.java:215)
	at org.gitlab4j.api.RepositoryApi.getBranch(RepositoryApi.java:104)
	at io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource.retrieve(GitLabSCMSource.java:258)
	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
	at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:101)
	at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:58)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.getProperty(CpsScript.java:135)
	at sun.reflect.GeneratedMethodAccessor1607.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:57)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.jenkinsci.plugins.pipeline.modeldefinition.Utils.getScriptPropOrParam(Utils.groovy:112)
	at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$getScriptPropOrParam$17.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$getScriptPropOrParam$17.call(Unknown Source)
	at org.jenkinsci.plugins.pipeline.modeldefinition.model.Environment$EnvironmentResolver.getScriptPropOrParam(Environment.groovy:133)
	at sun.reflect.GeneratedMethodAccessor1787.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:163)
	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:158)
	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:161)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:165)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:130)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
Caused: java.io.IOException: Failed to retrieve the SCM revision for develop
	at io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource.retrieve(GitLabSCMSource.java:298)
	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
	at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:101)
	at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:58)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.getProperty(CpsScript.java:135)
	at sun.reflect.GeneratedMethodAccessor1607.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:57)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.jenkinsci.plugins.pipeline.modeldefinition.Utils.getScriptPropOrParam(Utils.groovy:112)
	at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$getScriptPropOrParam$17.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$getScriptPropOrParam$17.call(Unknown Source)
	at org.jenkinsci.plugins.pipeline.modeldefinition.model.Environment$EnvironmentResolver.getScriptPropOrParam(Environment.groovy:133)
	at sun.reflect.GeneratedMethodAccessor1787.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:163)
	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:158)
	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:161)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:165)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:130)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
	at WorkflowScript.run(WorkflowScript)
	at WorkflowScript.run(WorkflowScript)
	at WorkflowScript.run(WorkflowScript)
	at WorkflowScript.run(WorkflowScript)
	at WorkflowScript.run(WorkflowScript)
	at WorkflowScript.run(WorkflowScript)
	at WorkflowScript.run(WorkflowScript)
	at WorkflowScript.run(WorkflowScript)
	at WorkflowScript.run(WorkflowScript)
	at WorkflowScript.run(WorkflowScript)
	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:431)
	at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.callClosureForMapEntry(CpsDefaultGroovyMethods:5226)
	at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.collect(CpsDefaultGroovyMethods:3446)
	at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.collect(CpsDefaultGroovyMethods:3463)
	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:429)
	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(ModelInterpreter.groovy:78)
	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withCredentialsBlock(ModelInterpreter.groovy:476)
	at ___cps.transform___(Native Method)
	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
	at sun.reflect.GeneratedMethodAccessor1342.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
	at com.cloudbees.groovy.cps.Next.step(Next.java:83)
	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
	at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

FYI , When I use the Jenkinsfile not remotely It works fine.

Branches being disabled in multi branch pipelines since update to Gitlab 13.12.4

Version report

Jenkins version:
[Dev] Jenkins 2.289.1
[Prod] Jenkins 2.263.4
GitlabBranchSource: 1.5.1
GitlabPlugin: 1.5.20

Last week we updated updated our Gitlab to 13.12.4 and since then have seen on our prod jenkins that the jobs we have defined as multi branch pipelines are not always discovering correctly

We current have it configured for "master, release"* and intermittetly during the days they're disabled as the discovery fails.
Trigger of "Scan Gitlab Project Now" corrects it will then at some point again revert to disabled

We saw the open pull request #145 and tried building the plugin ourselves based on 1.5.1 with the fix suggested there -> problem persisted
We then buildt based on 1.5.7 with the fix suggested there -> problem persisted

Seems the pull request suggested was based on https://gitlab.com/gitlab-org/gitlab/-/issues/333548

At the moment the only option we have without a fix is to roll back our gitlab version

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.