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

GerritTrigger.setTriggerOnEvents() expects class PluginGerritEvent but received class workflow.cps.DSL$NamedArgsAndClosure

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: workflow-cps-plugin
    • Environment:
    • Similar Issues:
    • Released As:
      2.86

      Description

      After upgrading to version 2.85, all my pipeline Jobs started to fail complaining on the Gerrit event step. I had to rollback to 2.84 and everything start to work again.

       

      My job uses a shared lib:

      Job:

      blahPipeline(
        project_id: 'bleh.blah',                  
        project_path: 'bleh/blah',                  
        project_branch: 'master',                  
        slave: 'blah'
      )
      

       

      And the shared lib that it's calling:

      def call(Map stageParams) {
        def PROJECT_ID = stageParams.project_id  
        def PROJECT_PATH = stageParams.project_path  
        def PROJECT_BRANCH = stageParams.project_branch  
        def SLAVE = stageParams.slave  
          
        pipeline {    
          triggers {      
            gerrit(        
              serverName: 'Gerrit',
              gerritProjects: [[pattern: "${PROJECT_PATH}",
                                compareType: "PLAIN",
                                branches: [[compareType: "REG_EXP", 
                                            pattern: ".*"]],
                                disableStrictForbiddenFileVerification: false]],
              triggerOnEvents: [patchsetCreated(excludeDrafts: true,
                                                excludeNoCodeChange: true),
                                draftPublished(),
                                changeMerged()]
            )
            cron 'H H(0-7) * * *'
          }
      ...
      }
      

       

       

        Attachments

          Issue Links

            Activity

            foot Renato Costallat created issue -
            foot Renato Costallat made changes -
            Field Original Value New Value
            Description After upgrading to version 2.85, all my pipeline Jobs started to fail complaining on the Gerrit event step. I had to rollback to 2.84 and everything start to work again.

             

            My job uses a shared lib:

            Job:

             

             
            {code:java}
            blahPipeline(
              project_id: 'bleh.blah',
              project_path: 'bleh/blah',
              project_branch: 'master',
              slave: 'blah'
            )
            {code}
             

            And the shared lib that it's calling

             

             
            {code:java}
            def call(Map stageParams) {
              def PROJECT_ID = stageParams.project_id
              def PROJECT_PATH = stageParams.project_path
              def PROJECT_BRANCH = stageParams.project_branch
              def SLAVE = stageParams.slave
                
              pipeline {
                triggers {
                  gerrit(
                    serverName: 'Gerrit',
                    gerritProjects: [[pattern: "${PROJECT_PATH}",
                                      compareType: "PLAIN",
                                      branches: [[compareType: "REG_EXP",
                                                  pattern: ".*"]],
                                      disableStrictForbiddenFileVerification: false]],
                    triggerOnEvents: [patchsetCreated(excludeDrafts: true,
                                                      excludeNoCodeChange: true),
                                      draftPublished(),
                                      changeMerged()]
                  )
                  cron 'H H(0-7) * * *'
                }
            {code}
             

             
            After upgrading to version 2.85, all my pipeline Jobs started to fail complaining on the Gerrit event step. I had to rollback to 2.84 and everything start to work again.

             

            My job uses a shared lib:

            Job:
            {code:java}
            blahPipeline(
              project_id: 'bleh.blah',
              project_path: 'bleh/blah',
              project_branch: 'master',
              slave: 'blah'
            )
            {code}
             

            And the shared lib that it's calling:
            {code:java}
            def call(Map stageParams) {
              def PROJECT_ID = stageParams.project_id
              def PROJECT_PATH = stageParams.project_path
              def PROJECT_BRANCH = stageParams.project_branch
              def SLAVE = stageParams.slave
                
              pipeline {
                triggers {
                  gerrit(
                    serverName: 'Gerrit',
                    gerritProjects: [[pattern: "${PROJECT_PATH}",
                                      compareType: "PLAIN",
                                      branches: [[compareType: "REG_EXP",
                                                  pattern: ".*"]],
                                      disableStrictForbiddenFileVerification: false]],
                    triggerOnEvents: [patchsetCreated(excludeDrafts: true,
                                                      excludeNoCodeChange: true),
                                      draftPublished(),
                                      changeMerged()]
                  )
                  cron 'H H(0-7) * * *'
                }
            ...
            }
            {code}
             

             
            foot Renato Costallat made changes -
            Labels gerrit-trigger pipeline
            foot Renato Costallat made changes -
            Labels gerrit-trigger pipeline gerrit-trigger pipeline shared-libraries
            ckullabosch Christoph Kulla made changes -
            Priority Major [ 3 ] Blocker [ 1 ]
            Hide
            ckullabosch Christoph Kulla added a comment - - edited

            Same issue here, probably caused by the change in JENKINS-63254

            Show
            ckullabosch Christoph Kulla added a comment - - edited Same issue here, probably caused by the change in JENKINS-63254
            gtjoseph George Joseph made changes -
            Link This issue is duplicated by JENKINS-64245 [ JENKINS-64245 ]
            Hide
            foot Renato Costallat added a comment -

            Carroll Chiou tested it here and it's working (workflow-cps-2.86-rc2569.b828472cff3a.hpi)!

             

            Tks!!

            Show
            foot Renato Costallat added a comment - Carroll Chiou tested it here and it's working ( workflow-cps-2.86-rc2569.b828472cff3a.hpi )!   Tks!!
            carroll Carroll Chiou made changes -
            Released As 2.86
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Fixed but Unreleased [ 10203 ]
            carroll Carroll Chiou made changes -
            Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]
            jglick Jesse Glick made changes -
            Link This issue is caused by JENKINS-63254 [ JENKINS-63254 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-cps-plugin #399 (Web Link)" [ 26317 ]
            jglick Jesse Glick made changes -
            Assignee Carroll Chiou [ carroll ]
            jglick Jesse Glick made changes -
            Labels gerrit-trigger pipeline shared-libraries gerrit-trigger regression shared-libraries

              People

              Assignee:
              carroll Carroll Chiou
              Reporter:
              foot Renato Costallat
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: