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

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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

            Assignee:
            Parichay Barpanda
            Reporter:
            Francis Bolduc
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: