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

updateGitlabCommitStatus doesn't work after cloning the second GitLab project

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • gitlab-plugin
    • None
    • Jenkins ver. 2.190.2
      1.5.12 GitLab Plugin
      GitLab Community Edition 11.6.5
      Pipeline from SCM, groovy file

      If there is only one GitLab project which is cloned in the pipeline, updateGitlabCommitStatus works fine.

      If two different projects were cloned before updateGitlabCommitStatus, it stops to work.
      That is if you clone two projects at the very top of the pipeline, no one updateGitlabCommitStatus will work. If you clone the second project on some stage at the end of the pipeline, all updateGitlabCommitStatus above this will work fine, but all updateGitlabCommitStatus after cloning of the second project will fail.

      There is issue https://github.com/jenkinsci/gitlab-plugin/issues/522 for the plugin about gitlabCommitStatus and it was resolved with documentation changing that it should be close to the corresponding SCM definition:
      NOTE: If you use Pipeline global libraries, or if you clone your project's Jenkinsfile from a repo different from the one that contains the relevant source code, you need to be careful about when you send project status. In short, make sure you put your gitlabCommitStatus or other similar steps after the SCM step that clones your project's source. Otherwise, you may get HTTP 400 errors, or you may find build status being sent to the wrong repo
      https://github.com/jenkinsci/gitlab-plugin
      This doesn't work for updateGitlabCommitStatus. You can try to clone the first project just before updateGitlabCommitStatus, but this will not help.

      There is also instruction that gitlabCommitStatus can be used for multiple GitLab connections and projects, https://github.com/jenkinsci/gitlab-plugin#notify-specific-project-by-a-specific-gitlab-connection
      But updateGitlabCommitStatus doesn't contain such parameters and there is no other way to specify the GitLab project you want to update.

            jequals5 Marky Jackson
            gennady Gennady Krasnikov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: