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

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

      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.

          [JENKINS-47560] JobDsl : Scripts not permitted to use method groovy.lang.GroovyObject

          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

           

           

           

          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      

          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 )

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

          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/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]

          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

          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.

          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/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
            tetradeus Thomas CARSUZAN
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: