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

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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • workflow-cps-plugin
    • 2.86

      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) * * *'
          }
      ...
      }
      

       

       

          [JENKINS-64185] GerritTrigger.setTriggerOnEvents() expects class PluginGerritEvent but received class workflow.cps.DSL$NamedArgsAndClosure

          Renato Costallat created issue -
          Renato Costallat made changes -
          Description Original: 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}
           

           
          New: 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}
           

           
          Renato Costallat made changes -
          Labels New: gerrit-trigger pipeline
          Renato Costallat made changes -
          Labels Original: gerrit-trigger pipeline New: gerrit-trigger pipeline shared-libraries
          Christoph Kulla made changes -
          Priority Original: Major [ 3 ] New: Blocker [ 1 ]
          George Joseph made changes -
          Link New: This issue is duplicated by JENKINS-64245 [ JENKINS-64245 ]
          Carroll Chiou made changes -
          Released As New: 2.86
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Fixed but Unreleased [ 10203 ]
          Carroll Chiou made changes -
          Status Original: Fixed but Unreleased [ 10203 ] New: Resolved [ 5 ]
          Jesse Glick made changes -
          Link New: This issue is caused by JENKINS-63254 [ JENKINS-63254 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "workflow-cps-plugin #399 (Web Link)" [ 26317 ]
          Jesse Glick made changes -
          Assignee New: Carroll Chiou [ carroll ]

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

              Created:
              Updated:
              Resolved: