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

Adding gitlab MR comment from Jenkinsfile does not work

    Details

    • Similar Issues:

      Description

      Adding comment from Jenkinsfile during building Merge Request in Gitlab does not work.

      Jenkins job is created using Gitlab Branch Source plugin. The job type is Gitlab Group.

      When

      addGitLabMRComment

      step is run gitlab MR comment is not added as expected and there is no error in build log.

      Sample Jenkinsfile to replicate this problem:

      pipeline {
        agent any
        stages {
          stage('Build') {
            steps {
              addGitLabMRComment comment: 'Test comment'
            }
          }
        }
      }
      

        Attachments

          Activity

          Hide
          baymac Parichay Barpanda added a comment -

          This pipeline step is not implemented in our plugin, it is a feature of gitlab-plugin. Is this feature important to your use? Can you share your use case?

          Show
          baymac Parichay Barpanda added a comment - This pipeline step is not implemented in our plugin, it is a feature of gitlab-plugin. Is this feature important to your use? Can you share your use case?
          Hide
          tkleszcz Tadeusz Kleszcz added a comment -

          It is important but not critical.

          Our use case:

          We are calculating code coverage during Jenkins build and also the difference between code coverage in source and target branch. Then we are using addGitLabMRComment to add a comment to the GitLab with code coverage statistics. It allows us to easily view of how code coverage will be affected during code review.

          Some time ago we have switched to Gitlab Branch Source plugin for easier job maintenance in Jenkins and from this time it stopped working.

          Show
          tkleszcz Tadeusz Kleszcz added a comment - It is important but not critical. Our use case: We are calculating code coverage during Jenkins build and also the difference between code coverage in source and target branch. Then we are using addGitLabMRComment to add a comment to the GitLab with code coverage statistics. It allows us to easily view of how code coverage will be affected during code review. Some time ago we have switched to Gitlab Branch Source plugin for easier job maintenance in Jenkins and from this time it stopped working.
          Hide
          ajcamilo André Camilo added a comment -

          I think it would be a great if we could use all gitlab-plugin actions with gitlab-branch-source jobs. Would this be difficult?

          (I also need the addGitLabMRComment above all other actions from gitlab-plugin)

          Show
          ajcamilo André Camilo added a comment - I think it would be a great if we could use all gitlab-plugin actions with gitlab-branch-source jobs. Would this be difficult? (I also need the addGitLabMRComment above all other actions from gitlab-plugin)

            People

            • Assignee:
              baymac Parichay Barpanda
              Reporter:
              tkleszcz Tadeusz Kleszcz
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: