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

Adding gitlab MR comment from Jenkinsfile does not work

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins 2.190.1
      GitLab Plugin 1.5.13
      GitLab Branch Source Plugin 1.4.1

      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'
            }
          }
        }
      }
      

          [JENKINS-60530] Adding gitlab MR comment from Jenkinsfile does not work

          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?

          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?

          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.

          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.

          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)

          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)

          +1 to implement this feature. It could be very helpful to comment an MR within a pipeline with a simple method in order to post different links to test, qa or security reports or communicate about merge request test environment, etc...

          Victor Mikolajczyk added a comment - +1 to implement this feature. It could be very helpful to comment an MR within a pipeline with a simple method in order to post different links to test, qa or security reports or communicate about merge request test environment, etc...

            baymac Parichay Barpanda
            tkleszcz Tadeusz Kleszcz
            Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: