Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75698

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 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. gitlab-ci.yml
          0.1 kB
        2. Jenkinsfile
          0.1 kB

            baymac Parichay Barpanda
            francisbolduc Francis Bolduc
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: