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

Check for varargs in script-security plugin fails

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: script-security-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.46, script-security-plugin 1.35-SNAPSHOT
    • Similar Issues:

      Description

      This is my script (not a pipeline  - just system groovy script):

      params = [new StringParameterValue ('GIT_PUSH_USER','builder'), new StringParameterValue ("SHA1",'9df4d51934c3f39663c5dbc1e08c09775b45c61f'),
      , new BooleanParameterValue('TEST_ONLY_CHANGED',false)]

      parmAction = new ParametersAction(params)

       

      Causes failure with:

      org.codehaus.groovy.runtime.typehandling.GroovyCastException
      : Cannot cast object '[(StringParameterValue) GIT_PUSH_USER='builder', (StringParameterValue) SHA1='9df4d51934c3f39663c5dbc1e08c09775b45c61f' (BooleanParameterValue) TEST_ONLY_CHANGED='false']' with class 'java.util.ArrayList' to class 'hudson.model.ParameterValue' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: hudson.model.ParameterValue(hudson.model.StringParameterValue, hudson.model.StringParameterValue,hudson.model.BooleanParameterValue)
      at
      org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnSAM(DefaultTypeTransformation.java:403)
      at
      org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnNumber(DefaultTypeTransformation.java:319)
      at
      org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:232)
      at
      org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToVargsArray(DefaultTypeTransformation.java:881)
      at
      org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovyCallSiteSelector.parametersForVarargs(GroovyCallSiteSelector.java:103)
      at
      org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovyCallSiteSelector.matches(GroovyCallSiteSelector.java:52)
      at
      org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovyCallSiteSelector.constructor(GroovyCallSiteSelector.java:164)
      at
      org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onNewInstance(SandboxInterceptor.java:142)
      at
      org.kohsuke.groovy.sandbox.impl.Checker$3.call(Checker.java:195)
      at
      org.kohsuke.groovy.sandbox.impl.Checker.checkedConstructor(Checker.java:200)
      at org.kohsuke.groovy.sandbox.impl.Checker$checkedConstructor.callStatic(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:214)
      at Script1.run(Script1.groovy:13)
      at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.run(GroovySandbox.java:141)
      at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript.evaluate(SecureGroovyScript.java:165)
      at hudson.plugins.groovy.SystemGroovy.run(SystemGroovy.java:95)
      at hudson.plugins.groovy.SystemGroovy.perform(SystemGroovy.java:59)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      at hudson.model.Build$BuildExecution.build(Build.java:205)
      at hudson.model.Build$BuildExecution.doRun(Build.java:162)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      at hudson.model.Run.execute(Run.java:1741)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)

        Attachments

          Issue Links

            Activity

            antweiss Anton Weiss created issue -
            antweiss Anton Weiss made changes -
            Field Original Value New Value
            Issue Type Task [ 3 ] Bug [ 1 ]
            Assignee Anton Weiss [ antweiss ]
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ]
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "PR #156 (Web Link)" [ 17793 ]
            antweiss Anton Weiss made changes -
            Link This issue is related to JENKINS-44557 [ JENKINS-44557 ]
            abayer Andrew Bayer made changes -
            Link This issue relates to JENKINS-37527 [ JENKINS-37527 ]
            abayer Andrew Bayer made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                antweiss Anton Weiss
              • Votes:
                3 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: