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

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

    Details

    • Similar Issues:

      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

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

          Show
          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]
          Hide
          tetradeus Thomas CARSUZAN added a comment -

          Thanks a lot Daniel.

          Show
          tetradeus Thomas CARSUZAN added a comment - Thanks a lot Daniel.
          Hide
          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

          Show
          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
          Hide
          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]

          Show
          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]
          Hide
          tetradeus Thomas CARSUZAN added a comment -

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

          Show
          tetradeus Thomas CARSUZAN added a comment - I also tried it and it works with given jenkins/plugins version once the script method is allowed. 
          Show
          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 )
          Hide
          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

           

           

           

          Show
          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      

            People

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

              Dates

              • Created:
                Updated:
                Resolved: