jenkinsci / jenkinsci/script-security-plugin

[JENKINS-53302] Pipeline script from SCM: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods round, org.codehaus.groovy.runtime.DefaultGroovyMethods toFloat

Open
#809 0 comments 0 reactions 0 assignees View on GitHub
component:script-security-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
76
Forks
181
Avg merge
14h 55m
Merged PRs (30d)
3

Description

In our project requirement we are using groovy default methods "toFloat(), round()" while calculating next release version automatically, but it seems these methods are not whitelisted and requires manual approval from script Approval. Can these be added to whitelist by default ?

the sample code from pipeline script is below

 

node("xxxx"){

stage("get next version"){
def last_tag = "1.2.0"
def next_tag = (((last_tag.tokenize(".")[0] + "." + last_tag.tokenize(".")[1]).toFloat() + "0.1".toFloat()).round(2)) + "." + "0"
sh "echo " + next_tag
}
}

 

---
Originally reported by rgaduput, imported from: Pipeline script from SCM: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods round, org.codehaus.groovy.runtime.DefaultGroovyMethods toFloat


  • status: Open
  • priority: Minor
  • component(s): script-security-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-09

Raw content of original issue

In our project requirement we are using groovy default methods "toFloat(), round()" while calculating next release version automatically, but it seems these methods are not whitelisted and requires manual approval from script Approval. Can these be added to whitelist by default ?

the sample code from pipeline script is below

 



node("xxxx"){

stage("get next version"){
def last_tag = "1.2.0"
def next_tag = (((last_tag.tokenize(".")[0] + "." + last_tag.tokenize(".")[1]).toFloat() + "0.1".toFloat()).round(2)) + "." + "0"
sh "echo " + next_tag
}
}


 

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.