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

Gerrit Trigger Plugin Should be a Source for Multibranch Pipeline

    Details

    • Similar Issues:

      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

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

            Jesse Glick 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.

            Show
            lucamilanesio lucamilanesio added a comment - Jesse Glick 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.
            Hide
            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).

            Show
            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).
            Hide
            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 ?

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

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

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

              People

              • Assignee:
                lucamilanesio lucamilanesio
                Reporter:
                mkasberg Mike Kasberg
              • Votes:
                43 Vote for this issue
                Watchers:
                53 Start watching this issue

                Dates

                • Created:
                  Updated: