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

Gerrit Trigger Plugin Should be a Source for Multibranch Pipeline

      I want to use the new Multibranch Pipeline features of Jenkins with Gerrit source control.

      I should be able to choose Gerrit as the source for a multibranch pipeline. I should be able to select one or more repositories from Gerrit that each have their own Jenkinsfile. The pipeline would run the Jenkinsfile from the patch set that was pushed to Gerrit.

      There is no known workaround for this issue because one core requirement is to see each gerrit branch and change request as a different sub-job with its own history. This is essential because it allow you to know the build status of the branch instead of seeing a long queue of builds made on various branches and CRs, most likely full of failures.

      The behaviour described in this ticket is almost identical with the GitHub Multibranch implementation, the difference is that instead of having GitHub branches and PRs as the data source, we want to have Gerrit.

          [JENKINS-38046] Gerrit Trigger Plugin Should be a Source for Multibranch Pipeline

          Mike Kasberg added a comment -

          The new plugin sounds wonderful. Thank you for your work - I'm excited to try it out!

          Mike Kasberg added a comment - The new plugin sounds wonderful. Thank you for your work - I'm excited to try it out!

          Sorin Sbarnea added a comment -

          lucamilanesio Where is the codebase of this new plugin? I am more than interested and willing to test it and to contribute back to it.

          The fact that Gerrit branches and CRs are not working similarly to Git multi-branch, is a huge PITA.

          Sorin Sbarnea added a comment - lucamilanesio Where is the codebase of this new plugin? I am more than interested and willing to test it and to contribute back to it. The fact that Gerrit branches and CRs are not working similarly to Git multi-branch, is a huge PITA.

          Eric Isakson added a comment -

          Any word on the new plugin? I am also interested in testing/contributing to help get it off the ground.

          Eric Isakson added a comment - Any word on the new plugin? I am also interested in testing/contributing to help get it off the ground.

          I would also be interested and willing to test/contribute to the project.

          Philippe McLean added a comment - I would also be interested and willing to test/contribute to the project.

          Jesse Glick added a comment -

          Jesse Glick added a comment - https://github.com/GerritForge/gerrit-plugin/  apparently.

          jglick the new plugin has now been renamed to ([Gerrit Code Review plugin](https://github.com/jenkinsci/gerrit-code-review-plugin) and is now available for installation through the Jenkins Plugin Manager.

          Luca Domenico Milanesio added a comment - jglick the new plugin has now been renamed to ( [Gerrit Code Review plugin] ( https://github.com/jenkinsci/gerrit-code-review-plugin)  and is now available for installation through the Jenkins Plugin Manager.

          Taylor Patton added a comment -

          Will this capability be added to gerrit-trigger-plugin? I am weary of installing another gerrit plugin and having 2 ways of configuring pipelines (multi-branch and regular).

          Taylor Patton added a comment - Will this capability be added to gerrit-trigger-plugin? I am weary of installing another gerrit plugin and having 2 ways of configuring pipelines (multi-branch and regular).

          Jose Sa added a comment -

          I'm using this trigger in multi-branch but seems to be ignored:

            triggers {
              gerrit(
                serverName: 'server-name',
                gerritProjects: [[
                  compareType: 'PLAIN',
                  pattern: '_REPO_',
                  branches: [[ compareType: 'ANT', pattern: 'refs/heads/*' ]],
                  filePaths: [[ compareType: 'ANT', pattern: "_MODULE_/**" ]],
                  disableStrictForbiddenFileVerification: false
                ]],
                triggerOnEvents: [
                  refUpdated()
                ]
              )
            }
          

          The only thing that makes build happen is the polling scheduled every 5 minutes (as workaround) checking for branch changes.

          Should I use something differently to get multibranch jobs triggered ?

          Jose Sa added a comment - I'm using this trigger in multi-branch but seems to be ignored: triggers { gerrit( serverName: 'server-name' , gerritProjects: [[ compareType: 'PLAIN' , pattern: '_REPO_' , branches: [[ compareType: 'ANT' , pattern: 'refs/heads/*' ]], filePaths: [[ compareType: 'ANT' , pattern: "_MODULE_/**" ]], disableStrictForbiddenFileVerification: false ]], triggerOnEvents: [ refUpdated() ] ) } The only thing that makes build happen is the polling scheduled every 5 minutes (as workaround) checking for branch changes. Should I use something differently to get multibranch jobs triggered ?

          Mike added a comment -

          austin_phillips
          thanks for your solution! It's not multi-branch but it is working well for me.

          Mike added a comment - austin_phillips thanks for your solution! It's not multi-branch but it is working well for me.

          Lars Berntzon added a comment -

          Any news on this? We need it for multibranch stage0 builds.

          Lars Berntzon added a comment - Any news on this? We need it for multibranch stage0 builds.

            lucamilanesio Luca Domenico Milanesio
            mkasberg Mike Kasberg
            Votes:
            48 Vote for this issue
            Watchers:
            57 Start watching this issue

              Created:
              Updated: