Jenkinsfile MR pipeline status is ignored if there is a Gitlab MR pipeline

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major
    • None
    • Environment:
      Jenkins 2.504.1
      gitlab-branch-source: 718.v40b_5f0e67cd3

      The issue occurs when there are both a .gitlab-ci.yml and a Jenkinsfile present in repo and triggered in a Merge Request, the MR pipeline status will only consider status from GitLab pipeline (ignoring Jenkins pipeline status).

      The issue doesn't occur when only Jenkins pipeline is triggered (where GitLab rules didn't trigger GitLab MR pipeline), the MR pipeline status will consider the Jenkins pipeline status.

      gitlab-branch-source-plugin use this GitLab REST API to set the status of a pipeline: https://docs.gitlab.com/api/commits/#set-the-pipeline-status-of-a-commit

      And the probable source is from the usage of "status.setRef" where it sets the "branch-name" of the merge request here:

      But GitLab uses another ref for merge request statuses:

      • either "refs/merge-requests/<mr-iid>/head"
      • or "refs/merge-requests/<mr-iid>/merge"

      Actual Result

      When both triggered, there are 2 "pipeline results" in GitLab

      • one pipeline "branch" from Jenkins with ref: "<branch-name>"
      • one pipeline "merge request" from GitLab with ref: "refs/merge-requests/<mr-iid>/head" (or "refs/merge-requests/<mr-iid>/merge")

      And only the GitLab pipeline status is shown in the MR.

      Expected Result

      When both triggered, only one pipeline "merge request" including both GitLab jobs statuses and Jenkins pipeline status.

       

      Github issue: https://github.com/jenkinsci/gitlab-branch-source-plugin/issues/493

        1. 2025-10-23-gitlab-mr-overview.png
          71 kB
          Francis Bolduc
        2. 2025-10-23-gitlab-mr-pipelines.png
          45 kB
          Francis Bolduc
        3. gitlab-ci.yml
          0.1 kB
          Francis Bolduc
        4. image-2025-10-23-12-22-27-071.png
          56 kB
          Konstantin Grammatikati
        5. image-2025-10-23-12-28-07-314.png
          32 kB
          Konstantin Grammatikati
        6. image-2025-10-23-12-38-12-126.png
          278 kB
          Konstantin Grammatikati
        7. Jenkinsfile
          0.1 kB
          Francis Bolduc

            Assignee:
            Parichay Barpanda
            Reporter:
            Francis Bolduc
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: