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

Gerrit Trigger Plugin Should be a Source for Multibranch Pipeline

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            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.

            lucamilanesio 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.
            taylorp36 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).

            taylorp36 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).
            josesa 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 ?

            josesa 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 ?
            munkyboy Mike added a comment -

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

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

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

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

            People

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

              Dates

                Created:
                Updated: