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

Refuse to load a plugin if dependencies are disabled or outdated

      According to jglick, Jenkins lets a plugin start even if some of its dependencies are missing.

      Since missing dependencies might only get much later (for example during builds), it's better to let those plugins fail earlier than later.

      Combined with JENKINS-21485, this will make Jenkins boot more reliable and help administrators catch problems more quickly.

          [JENKINS-21486] Refuse to load a plugin if dependencies are disabled or outdated

          Code changed in jenkins
          User: Vincent Latombe
          Path:
          core/src/main/java/hudson/PluginWrapper.java
          core/src/main/resources/hudson/Messages.properties
          core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message.jelly
          http://jenkins-ci.org/commit/jenkins/6bf02d514d80e806f108290fbea06ac6f6064798
          Log:
          JENKINS-21486 Fix up messages and show plugin version

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vincent Latombe Path: core/src/main/java/hudson/PluginWrapper.java core/src/main/resources/hudson/Messages.properties core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message.jelly http://jenkins-ci.org/commit/jenkins/6bf02d514d80e806f108290fbea06ac6f6064798 Log: JENKINS-21486 Fix up messages and show plugin version

          Code changed in jenkins
          User: Vincent Latombe
          Path:
          core/src/main/java/hudson/PluginManager.java
          core/src/main/resources/hudson/PluginManager/PluginCycleDependenciesMonitor/message.jelly
          http://jenkins-ci.org/commit/jenkins/d8f3bfc8ed0f88e5bff757c0eec921d6c135d5b4
          Log:
          JENKINS-21486 Cycle monitor should display plugin long name and
          version

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vincent Latombe Path: core/src/main/java/hudson/PluginManager.java core/src/main/resources/hudson/PluginManager/PluginCycleDependenciesMonitor/message.jelly http://jenkins-ci.org/commit/jenkins/d8f3bfc8ed0f88e5bff757c0eec921d6c135d5b4 Log: JENKINS-21486 Cycle monitor should display plugin long name and version

          Code changed in jenkins
          User: Vincent Latombe
          Path:
          core/src/main/java/hudson/PluginManager.java
          http://jenkins-ci.org/commit/jenkins/8e3c9dadc1b09406ab6e77af33518ee3168470d4
          Log:
          JENKINS-21486 Mention both long name, short name and version in console

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vincent Latombe Path: core/src/main/java/hudson/PluginManager.java http://jenkins-ci.org/commit/jenkins/8e3c9dadc1b09406ab6e77af33518ee3168470d4 Log: JENKINS-21486 Mention both long name, short name and version in console

          Code changed in jenkins
          User: Vincent Latombe
          Path:
          test/src/test/java/hudson/model/UsageStatisticsTest.java
          http://jenkins-ci.org/commit/jenkins/dff8e806b9466652a351dd7fb7f742b6698140db
          Log:
          JENKINS-21486 Only consider plugins detached before the current
          version

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vincent Latombe Path: test/src/test/java/hudson/model/UsageStatisticsTest.java http://jenkins-ci.org/commit/jenkins/dff8e806b9466652a351dd7fb7f742b6698140db Log: JENKINS-21486 Only consider plugins detached before the current version

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/java/hudson/PluginManager.java
          core/src/main/java/hudson/PluginWrapper.java
          core/src/main/resources/hudson/Messages.properties
          core/src/main/resources/hudson/PluginManager/PluginCycleDependenciesMonitor/message.jelly
          core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message.jelly
          test/src/test/java/hudson/PluginManagerTest.java
          test/src/test/java/hudson/PluginManagerUtil.java
          test/src/test/java/hudson/PluginWrapperTest.java
          test/src/test/java/hudson/model/UsageStatisticsTest.java
          test/src/test/resources/plugins/dependee-0.0.2.hpi
          test/src/test/resources/plugins/depender-0.0.2.hpi
          test/src/test/resources/plugins/mandatory-depender-0.0.2.hpi
          http://jenkins-ci.org/commit/jenkins/b27b15025748b37b018351256d2bc1d21e1b460a
          Log:
          Merge pull request #2487 from Vlatombe/JENKINS-21486

          JENKINS-21486 Fix plugin dependencies resolution, second round.

          Compare: https://github.com/jenkinsci/jenkins/compare/86e14ddffc5e...b27b15025748

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/PluginManager.java core/src/main/java/hudson/PluginWrapper.java core/src/main/resources/hudson/Messages.properties core/src/main/resources/hudson/PluginManager/PluginCycleDependenciesMonitor/message.jelly core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message.jelly test/src/test/java/hudson/PluginManagerTest.java test/src/test/java/hudson/PluginManagerUtil.java test/src/test/java/hudson/PluginWrapperTest.java test/src/test/java/hudson/model/UsageStatisticsTest.java test/src/test/resources/plugins/dependee-0.0.2.hpi test/src/test/resources/plugins/depender-0.0.2.hpi test/src/test/resources/plugins/mandatory-depender-0.0.2.hpi http://jenkins-ci.org/commit/jenkins/b27b15025748b37b018351256d2bc1d21e1b460a Log: Merge pull request #2487 from Vlatombe/ JENKINS-21486 JENKINS-21486 Fix plugin dependencies resolution, second round. Compare: https://github.com/jenkinsci/jenkins/compare/86e14ddffc5e...b27b15025748

          James Nord added a comment -

          This fix seems to cause a regression when using optional dependencies and the variant plugin.
          previously when tagged with OptionalExtension you could use a class that was only in a specific version of a plugin and then the code that depended on the "newer" plugin than was installed would not activate.

          Whilst this is ok for the main running of Jenkins - it causes a massive headache when running tests and depending on a version of a plugin that is using newer optional dependencies than provided by Jenkins (ie previously bundled).

          James Nord added a comment - This fix seems to cause a regression when using optional dependencies and the variant plugin. previously when tagged with OptionalExtension you could use a class that was only in a specific version of a plugin and then the code that depended on the "newer" plugin than was installed would not activate. Whilst this is ok for the main running of Jenkins - it causes a massive headache when running tests and depending on a version of a plugin that is using newer optional dependencies than provided by Jenkins (ie previously bundled).

          Daniel Beck added a comment -

          teilo Does this apply to (at)Extension(optional = true) the same way?

          Daniel Beck added a comment - teilo Does this apply to (at)Extension(optional = true) the same way?

          teilo see this thread for the full background of the implementation regarding dealing with obsolete optional dependencies.

          Vincent Latombe added a comment - teilo see this thread for the full background of the implementation regarding dealing with obsolete optional dependencies.

          James Nord added a comment -

          danielbeck yes - but the (at)Extension(optional = true) has no way to infer a version.
          (infact I can forsee a version of the Variant plugin that allows to specify a specific version of a plugin.)

          Mainly a headache at the moment due to what appears to be a bug in JenkinsRule (or the hpi plugin) and not loading the optional dependencies correctly for dependant plugins. (e.g. something like JENKINS-20412) - but to be investigated and filed separately.

          James Nord added a comment - danielbeck yes - but the (at)Extension(optional = true) has no way to infer a version. (infact I can forsee a version of the Variant plugin that allows to specify a specific version of a plugin.) Mainly a headache at the moment due to what appears to be a bug in JenkinsRule (or the hpi plugin) and not loading the optional dependencies correctly for dependant plugins. (e.g. something like JENKINS-20412 ) - but to be investigated and filed separately.

          Jesse Glick added a comment -

          JenkinsRule (or the hpi plugin) and not loading the optional dependencies correctly for dependant plugins

          I think all you are seeing is that Maven does not traverse transitive dependencies past <optional>true</optional>.

          Anyway I am not sure I am following what issue you are seeing.

          newer optional dependencies than provided by Jenkins (ie previously bundled)

          Are you referring to split plugins, à la ClassicPluginStrategy.DETACHED_LIST? Or what? It is up to the person defining tests to ensure that the plugins available in Maven’s test classpath are mutually compatible; if something is too old, you are obliged to either add <exclusions> for inappropriate dependency trails, or add explicit dependencies on a newer version. Now we may want to provide a friendlier system in the future, but for now that is how it is.

          Jesse Glick added a comment - JenkinsRule (or the hpi plugin) and not loading the optional dependencies correctly for dependant plugins I think all you are seeing is that Maven does not traverse transitive dependencies past <optional>true</optional> . Anyway I am not sure I am following what issue you are seeing. newer optional dependencies than provided by Jenkins (ie previously bundled) Are you referring to split plugins, à la ClassicPluginStrategy.DETACHED_LIST ? Or what? It is up to the person defining tests to ensure that the plugins available in Maven’s test classpath are mutually compatible; if something is too old, you are obliged to either add <exclusions> for inappropriate dependency trails, or add explicit dependencies on a newer version. Now we may want to provide a friendlier system in the future, but for now that is how it is.

            vlatombe Vincent Latombe
            kohsuke Kohsuke Kawaguchi
            Votes:
            6 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: