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

Jython plugin no longer provides access to Jenkins internals

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Component/s: jython-plugin
    • Labels:
      None
    • Environment:
      Jython plugin 1.4 and newer
      Jenkins 1.5.9.1 Redhat
    • Similar Issues:

      Description

      In the original jython plugin, the script was running inside the master jvm and it was thus possible to access Hudson internals, like this:

      import hudson.model
      hudson = hudson.model.Hudson.getInstance()

      In jenkins this still works perfectly when downgrading the plugin to version 1.3, with the minor change below:

      import jenkins.model
      hudson = jenkins.model.Jenkins.getInstance()

      In version 1.4 the plugin was changed to execute the script in an external jvm, so Jenkins internals can no longer be accessed.

      I think the only good reason for having a Jython plugin, is to access Jenkins internals. If you can't do that, you might as well use a regular shell step. and start the jython interpreter yourself, which is a lot more flexible than using the plugin.

      Please provide an option to run the interpreter in the Jenkins master jvm (In my opinion this should be the default). If you want to get fancy, there shold be a check preventing setting the job to run on another node.

      I know this was a long time on the way, but I have had to use Hudson at work, and this still works in Hudson.

      Question: Why cant I pin the plugin version? The pin option only shows up for some plugins.

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              lhupfeldt Lars Nielsen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: