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

Add a configurable switch on job that causes CPS to silently not continue on non-serializable code

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Minor Minor
    • pipeline
    • None

      Allow the addition of a configurable switch on the job that causes CPS to silently not continue on non-serializable code, and a closure that allows you to place arbitrary non-serializable code inline (rather than a method annotation).
      Example:

      def myString = 'adsfasdf'
      def firstTwoLetters = null
      unsafe {
      def matcher = (myString ~= /([a-z]

      {2}

      ).*/)
      if(matcher.matches()){
      firstTwoLetters = matcher.group(1)
      }
      }
      println(firstTwoLetters)

          [JENKINS-37475] Add a configurable switch on job that causes CPS to silently not continue on non-serializable code

          Dan Tranter created issue -
          Andrew Bayer made changes -
          Component/s New: pipeline-general [ 21692 ]
          Andrew Bayer made changes -
          Component/s Original: workflow-plugin [ 18820 ]

          Jesse Glick added a comment -

          This is two unrelated RFEs. Please file separate issues in separate tickets.

          The first is a duplicate. The second is unimplementable.

          Jesse Glick added a comment - This is two unrelated RFEs. Please file separate issues in separate tickets. The first is a duplicate. The second is unimplementable.
          Jesse Glick made changes -
          Link New: This issue duplicates JENKINS-33761 [ JENKINS-33761 ]
          Jesse Glick made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            jglick Jesse Glick
            dtranter Dan Tranter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: