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

Wrappers provided by plugins not working correctly

      I was going through how to use wrappers in Declarative Pipeline https://github.com/jenkinsci/pipeline-model-definition-plugin/wiki/Advanced looking how to use the timestamper plugin specifically. Initially I used the wrap() syntax around the classname, which provided this rather helpful error message

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: 9: Invalid wrapper type 'wrap'. Valid wrapper types: [ansiColor, catchError, gitlabBuilds, gitlabCommitStatus, lock, node, podTemplate, retry, script, timeout, timestamps, waitUntil, withContext, withEnv, ws] @ line 9, column 9.
      wrap([$class: 'TimestamperBuildWrapper'])
      ^

      So there it was, I just needed to use 'timestamps' and it should work, as declarative pipeline identified it as an available wrapper.

      Unfortunately when trying to do that, I received the following error

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: 9: Expected a wrapper @ line 9, column 9.
      timestamps
      ^

      To see if it was an issue with the timestamper plugin, I also tried it with ansiColor, which again showed above as an available wrapper

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: 9: Expected a wrapper @ line 9, column 9.
      ansiColor
      ^

      It seems Declarative pipeline is identifying them as available wrappers, but unable to use them as wrappers

          [JENKINS-40721] Wrappers provided by plugins not working correctly

          Tom Larrow created issue -
          Tom Larrow made changes -
          Description Original: I was going through how to use wrappers in Declarative Pipeline https://github.com/jenkinsci/pipeline-model-definition-plugin/wiki/Advanced looking how to use the timestamper plugin specifically. Initially I used the wrap() syntax around the classname, which provided this rather helpful error message

          {{org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
          WorkflowScript: 9: Invalid wrapper type 'wrap'. Valid wrapper types: [ansiColor, catchError, gitlabBuilds, gitlabCommitStatus, lock, node, podTemplate, retry, script, timeout, timestamps, waitUntil, withContext, withEnv, ws] @ line 9, column 9.
                     wrap([$class: 'TimestamperBuildWrapper'])
                     ^}}

          So there it was, I just needed to use 'timestamps' and it should work, as declarative pipeline identified it as an available wrapper.

          Unfortunately when trying to do that, I received the following error
          {{org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
          WorkflowScript: 9: Expected a wrapper @ line 9, column 9.
                     timestamps
                     ^
          }}

          To see if it was an issue with the timestamper plugin, I also tried it with ansiColor, which again showed above as an available wrapper

          {{org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
          WorkflowScript: 9: Expected a wrapper @ line 9, column 9.
                     ansiColor
                     ^}}

          It seems Declarative pipeline is identifying them as available wrappers, but unable to use them as wrappers
          New: I was going through how to use wrappers in Declarative Pipeline https://github.com/jenkinsci/pipeline-model-definition-plugin/wiki/Advanced looking how to use the timestamper plugin specifically. Initially I used the wrap() syntax around the classname, which provided this rather helpful error message

          org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
          WorkflowScript: 9: Invalid wrapper type 'wrap'. Valid wrapper types: [ansiColor, catchError, gitlabBuilds, gitlabCommitStatus, lock, node, podTemplate, retry, script, timeout, timestamps, waitUntil, withContext, withEnv, ws] @ line 9, column 9.
                     wrap([$class: 'TimestamperBuildWrapper'])
                     ^

          So there it was, I just needed to use 'timestamps' and it should work, as declarative pipeline identified it as an available wrapper.

          Unfortunately when trying to do that, I received the following error

          org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
          WorkflowScript: 9: Expected a wrapper @ line 9, column 9.
                     timestamps
                     ^

          To see if it was an issue with the timestamper plugin, I also tried it with ansiColor, which again showed above as an available wrapper

          org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
          WorkflowScript: 9: Expected a wrapper @ line 9, column 9.
                     ansiColor
                     ^

          It seems Declarative pipeline is identifying them as available wrappers, but unable to use them as wrappers
          Robby Pocase made changes -
          Assignee Original: Andrew Bayer [ abayer ] New: Robby Pocase [ rpocase ]
          Robby Pocase made changes -
          Assignee Original: Robby Pocase [ rpocase ] New: Andrew Bayer [ abayer ]
          Andrew Bayer made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Andrew Bayer made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Andrew Bayer made changes -
          Remote Link New: This issue links to "PR #82 (Web Link)" [ 15171 ]
          Andrew Bayer made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]
          CloudBees Inc. made changes -
          Remote Link New: This issue links to "CloudBees Internal OSS-1785 (Web Link)" [ 18573 ]
          Liam Newman made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

            abayer Andrew Bayer
            tomlarrow Tom Larrow
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: