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

Track and verify plugins mentioned in configuration XML


    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • core

      Many jobs or other model objects require certain plugins. This should be represented in the actual config.xml, e.g.

        <org.jenkinsci.plugins.hello.HelloWorldBuilder plugin="hello 1.5">

      (XML namespaces would in some ways be natural for this, but XStream probably is more comfortable with a simple attribute on the outermost element “owned” by a plugin.)

      Need to make XmlFile.write insert these attributes as it serializes configuration, perhaps by making it take some interface implemented by PluginManager mapping Class to String shortName × String version. JRubyXStreamConverter might be used for inspiration.

      onLoad can either ignore these attributes, or use them as hints—for example, silently ignoring deserialization failures from a section owned by a plugin which is not currently loaded.

      Web methods like doCreateItem and doConfigDotXml, and their corresponding Java methods like createProjectFromXML and updateByXml, can be left alone, but a caller needs some way of first checking whether all required plugins are present, and attempting to install them if not. So there needs to be a web method on Jenkins and a corresponding Java method which can be given an arbitrary XML file and will return:

      1. OK, if all plugins mentioned therein are present. (Perhaps also check versions.)
      2. A security error, if caller is missing ADMINISTER permission.
      3. Or a list of jobs given as UpdateCenterJob.id (introduced in a3e57da) indicating ongoing progress of installing (or updating?) plugins, and perhaps even restarting Jenkins (trackable as of 4bd0696) for those plugins which require it.

      May also want some higher-level convenience interface, e.g. in CLI, to validate XML and wait for all update center jobs to complete (including restart as of 9ae0ba0).

            jglick Jesse Glick
            jglick Jesse Glick
            0 Vote for this issue
            2 Start watching this issue