• Declarative - 1.2

      Jenkinsfile:

      pipeline {
          agent any
          stages {
              stage('Test') {
                  steps {
                      wrap([$class: 'org.boxboat.plugins.lxd.HelloWorldWrapper']) {
                          sh '''
                          ls /tmp
                          cat /tmp/jenkins'''
                      }
                  }
              }
              stage('Publish') {
                  steps {
                      wrap([$class: 'org.boxboat.plugins.lxd.HelloWorldWrapper']) {
                          sh '''
                          ls /tmp
                          cat /tmp/jenkins'''
                      }
                  }
              }
          } 
      }
      

      When I hit "Save and Run" in the Blue Ocean editor, it does nothing and gives no indication of an error. When I browse the network requests tab I see a request to `http://localhost:8080/jenkins/pipeline-model-converter/toJenkinsfile` that returned 200, but included a failure message:

      {
         "status":"ok",
         "data":{
            "result":"failure",
            "errors":[
               {
                  "location":[
                     "pipeline",
                     "stages",
                     "0",
                     "branches",
                     "0",
                     "steps",
                     "0",
                     "arguments",
                     "0",
                     "value"
                  ],
                  "error":"Expecting \"class jenkins.tasks.SimpleBuildWrapper\" for parameter \"delegate\" but got \"[$class: 'org.boxboat.plugins.lxd.HelloWorldWrapper']\" of type class java.lang.String instead"
               },
               {
                  "location":[
                     "pipeline",
                     "stages",
                     "1",
                     "branches",
                     "0",
                     "steps",
                     "0",
                     "arguments",
                     "0",
                     "value"
                  ],
                  "error":"Expecting \"class jenkins.tasks.SimpleBuildWrapper\" for parameter \"delegate\" but got \"[$class: 'org.boxboat.plugins.lxd.HelloWorldWrapper']\" of type class java.lang.String instead"
               }
            ]
         }
      }
      

       

          [JENKINS-44451] Cannot save pipeline with a wrapper

          James Dumay added a comment -

          michaelneale ping - heres another one.

          James Dumay added a comment - michaelneale ping - heres another one.

          Andrew Bayer added a comment -

          This looks to be an issue in validation not handling metasteps correctly. Will investigate.

          Andrew Bayer added a comment - This looks to be an issue in validation not handling metasteps correctly. Will investigate.

          Andrew Bayer added a comment -

          So yeah, the problem is that validation doesn't work for metasteps like wrap. I don't think it ever will work, but I'll improve the error messaging. And in the meantime, SimpleBuildWrapper classes can have a @Symbol added to their descriptor, so they can be invoked like normal steps.

          Andrew Bayer added a comment - So yeah, the problem is that validation doesn't work for metasteps like wrap . I don't think it ever will work, but I'll improve the error messaging. And in the meantime, SimpleBuildWrapper classes can have a @Symbol added to their descriptor, so they can be invoked like normal steps.

          Andrew Bayer added a comment -

          Ok, I'm wrong, it actually does work. And in fact, I can't reproduce this!

          Andrew Bayer added a comment - Ok, I'm wrong, it actually does work. And in fact, I can't reproduce this!

          Andrew Bayer added a comment -

          I believe the editor's JSON generation has improved since this was opened, because I can't reproduce it now. If you can reproduce it with Blue Ocean 1.3.1 or later and Declarative 1.2.4 or later, please reopen this.

          Andrew Bayer added a comment - I believe the editor's JSON generation has improved since this was opened, because I can't reproduce it now. If you can reproduce it with Blue Ocean 1.3.1 or later and Declarative 1.2.4 or later, please reopen this.

          I'm having the same issue. I can't add a delegate class through the text input field in the Blue Ocean UI.
          Whatever you enter is interpreted as String - not as a class.

           

          Max von Preuschen added a comment - I'm having the same issue. I can't add a delegate class through the text input field in the Blue Ocean UI. Whatever you enter is interpreted as String - not as a class.  

          using Blue Ocean 1.4.2

          Max von Preuschen added a comment - using Blue Ocean 1.4.2

          Reopening this issue, since it seems there is no possibility to enter a valid value into the "Delegate" text input field. 

          • Expecting "class jenkins.tasks.SimpleBuildWrapper" for parameter "delegate" but got "..." of type class java.lang.String instead

          Max von Preuschen added a comment - Reopening this issue, since it seems there is no possibility to enter a valid value into the "Delegate" text input field.  Expecting "class jenkins.tasks.SimpleBuildWrapper" for parameter "delegate" but got "..." of type class java.lang.String instead

          Andrew Bayer added a comment -

          madmax184 - please open a new JIRA in the blueocean component.

          Andrew Bayer added a comment - madmax184 - please open a new JIRA in the blueocean component.

          Liam Newman added a comment -

          Bulk closing resolved issues.

          Liam Newman added a comment - Bulk closing resolved issues.

            abayer Andrew Bayer
            caleblloyd Caleb Lloyd
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: