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

Script Security translates some groovy functions incorrectly/not as expected

    • Pipeline - July/August

      I have a custom class which I am using inside of some groovy functions with a list of custom methods. When I use that custom class inside of a script needed to be approved by script security it is being transformed differently than expected.

       

      When I try to do a for loop through an array and do `i++` it is being translated as i.next() instead of adding 1 and then when I am calling the creator method `def $ITEM` it is being created as a hashmap. Neither of those methods exists inside of my custom class so it is throwing errors like `No signature of method X.next()` and `unclassified new X java.util.LinkedHashMap`

       

      I would either like to get more visibility about hot the translation is happening or potentially have other default method calls.

       

      Let me know if I can provide more context here.

          [JENKINS-45776] Script Security translates some groovy functions incorrectly/not as expected

          Alex Taylor created issue -
          Andrew Bayer made changes -
          Assignee 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 #36 (Web Link)" [ 17323 ]
          Andrew Bayer made changes -
          Labels New: cloudbees-internal-pipeline
          Andrew Bayer made changes -
          Sprint New: Pipeline - July/August [ 371 ]
          Andrew Bayer made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]
          Peter Wiseman made changes -
          Link New: This issue is duplicated by JENKINS-46194 [ JENKINS-46194 ]
          CloudBees Inc. made changes -
          Remote Link New: This issue links to "CloudBees Internal CD-214 (Web Link)" [ 19066 ]

            abayer Andrew Bayer
            ataylor Alex Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: