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

JobDsl : Scripts not permitted to use method groovy.lang.GroovyObject

    XMLWordPrintable

Details

    Description

      When using job dsl with :

      pipelineJob('xxx') {
        triggers { 
          snapshotDependencies()
        }
      }

      I get the following error :

      ERROR: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (javaposse.jobdsl.dsl.helpers.triggers.TriggerContext snapshotDependencies java.lang.Boolean)

      It is recommended to not allow this call in script-approvals.

      Is this something "fixable" ?

      Thanks.

      Attachments

        Activity

          tetradeus Thomas CARSUZAN created issue -
          tetradeus Thomas CARSUZAN made changes -
          Field Original Value New Value
          Description When using job dsl with :(

          pipelineJob('xxx') \{triggers \{
           snapshotDependencies(true)
          }
          When using job dsl with :
          {code:java}
          pipelineJob('xxx') {
            triggers { 
              snapshotDependencies(true)
            }
          }{code}
          I get the following error :
          ERROR: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (javaposse.jobdsl.dsl.helpers.triggers.TriggerContext snapshotDependencies java.lang.Boolean)
          It is recommended to not allow this call in script-approvals.

          Is this something "fixable" ?

          Thanks.
          Labels job-dsl job-dsl-plugin maven pipeline pipeline-maven script
          tetradeus Thomas CARSUZAN made changes -
          Description When using job dsl with :
          {code:java}
          pipelineJob('xxx') {
            triggers { 
              snapshotDependencies(true)
            }
          }{code}
          I get the following error :
          ERROR: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (javaposse.jobdsl.dsl.helpers.triggers.TriggerContext snapshotDependencies java.lang.Boolean)
          It is recommended to not allow this call in script-approvals.

          Is this something "fixable" ?

          Thanks.
          When using job dsl with :
          {code:java}
          pipelineJob('xxx') {
            triggers { 
              snapshotDependencies(true)
            }
          }{code}
          I get the following error :
          {code:java}
          ERROR: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (javaposse.jobdsl.dsl.helpers.triggers.TriggerContext snapshotDependencies java.lang.Boolean){code}
          It is recommended to not allow this call in script-approvals.

          Is this something "fixable" ?

          Thanks.
          daspilker Daniel Spilker made changes -
          Component/s job-dsl-plugin [ 16720 ]
          Component/s pipeline-maven-plugin [ 21669 ]

          snapshotDependencies is only available for the Maven job type, but not for Pipeline jobs.

          See https://jenkinsci.github.io/job-dsl-plugin/#path/mavenJob-triggers-snapshotDependencies

           

           

           

          daspilker Daniel Spilker added a comment - snapshotDependencies is only available for the Maven job type, but not for Pipeline jobs. See https://jenkinsci.github.io/job-dsl-plugin/#path/mavenJob-triggers-snapshotDependencies      
          daspilker Daniel Spilker made changes -
          Assignee Alvaro Lobato [ alobato ] Daniel Spilker [ daspilker ]
          Resolution Not A Defect [ 7 ]
          Status Open [ 1 ] Resolved [ 5 ]
          tetradeus Thomas CARSUZAN added a comment - This is not what is written here : https://wiki.jenkins.io/display/JENKINS/Pipeline+Maven+Plugin#PipelineMavenPlugin-Triggerdownstreampipelinewhenasnapshotisbuilt(since3.0.0 )
          tetradeus Thomas CARSUZAN made changes -
          Resolution Not A Defect [ 7 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          tetradeus Thomas CARSUZAN made changes -
          Description When using job dsl with :
          {code:java}
          pipelineJob('xxx') {
            triggers { 
              snapshotDependencies(true)
            }
          }{code}
          I get the following error :
          {code:java}
          ERROR: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (javaposse.jobdsl.dsl.helpers.triggers.TriggerContext snapshotDependencies java.lang.Boolean){code}
          It is recommended to not allow this call in script-approvals.

          Is this something "fixable" ?

          Thanks.
          When using job dsl with :
          {code:java}
          pipelineJob('xxx') {
            triggers { 
              snapshotDependencies()
            }
          }{code}
          I get the following error :
          {code:java}
          ERROR: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (javaposse.jobdsl.dsl.helpers.triggers.TriggerContext snapshotDependencies java.lang.Boolean){code}
          It is recommended to not allow this call in script-approvals.

          Is this something "fixable" ?

          Thanks.

          I also tried it and it works with given jenkins/plugins version once the script method is allowed. 

          tetradeus Thomas CARSUZAN added a comment - I also tried it and it works with given jenkins/plugins version once the script method is allowed. 

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          docs/Home.md
          job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/JobDslWhitelist.groovy
          job-dsl-plugin/src/test/groovy/javaposse/jobdsl/plugin/ExecuteDslScriptsSpec.groovy
          http://jenkins-ci.org/commit/job-dsl-plugin/f65d986bd38c87faac4fc3ed0a42bd4d048db1b0
          Log:
          fixed support for Automatically Generated DSL when using script security sandbox

          [FIXES JENKINS-47560]

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: docs/Home.md job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/JobDslWhitelist.groovy job-dsl-plugin/src/test/groovy/javaposse/jobdsl/plugin/ExecuteDslScriptsSpec.groovy http://jenkins-ci.org/commit/job-dsl-plugin/f65d986bd38c87faac4fc3ed0a42bd4d048db1b0 Log: fixed support for Automatically Generated DSL when using script security sandbox [FIXES JENKINS-47560]
          scm_issue_link SCM/JIRA link daemon made changes -
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Resolved [ 5 ]

          I wasn't aware of the new feature in Pipeline Maven Integration plugin...

          Support for Automatically Generated DSL is broken when using the script security sandbox. I opened a PR to fix that: https://github.com/jenkinsci/job-dsl-plugin/pull/1080

          daspilker Daniel Spilker added a comment - I wasn't aware of the new feature in Pipeline Maven Integration plugin... Support for Automatically Generated DSL is broken when using the script security sandbox. I opened a PR to fix that:  https://github.com/jenkinsci/job-dsl-plugin/pull/1080

          Thanks a lot Daniel.

          tetradeus Thomas CARSUZAN added a comment - Thanks a lot Daniel.

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          docs/Home.md
          job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/JobDslWhitelist.groovy
          job-dsl-plugin/src/test/groovy/javaposse/jobdsl/plugin/ExecuteDslScriptsSpec.groovy
          http://jenkins-ci.org/commit/job-dsl-plugin/00fbb57546e080b7ef19127788ef8c291d913f25
          Log:
          fixed support for Automatically Generated DSL when using script security sandbox

          [FIXES JENKINS-47560]

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: docs/Home.md job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/JobDslWhitelist.groovy job-dsl-plugin/src/test/groovy/javaposse/jobdsl/plugin/ExecuteDslScriptsSpec.groovy http://jenkins-ci.org/commit/job-dsl-plugin/00fbb57546e080b7ef19127788ef8c291d913f25 Log: fixed support for Automatically Generated DSL when using script security sandbox [FIXES JENKINS-47560]
          daspilker Daniel Spilker made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

          People

            daspilker Daniel Spilker
            tetradeus Thomas CARSUZAN
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: