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

Determining Dependencies from Update Center json

    Details

    • Similar Issues:
    • Sprint:
      GSoC 2019. Coding Phase 2

      Description

      A plugin is downloaded from a url based on the following logic: 

            if a url is entered, download from that url 

            if "latest" version and there's a jenkins specific update center, download from cfg.getJenkinsUc()/jenkinsVersion/latest

            if experimental or incremental, download from experimental update center or incrementals mirror  repo 

            else: download from cfg.getJenkinsUc()/download/plugins/pluginName/pluginVersion/pluginName

       

      Previously, a plugin's dependencies would be resolved after a plugin was downloaded and the dependencies were determined from the manifest. 

      Now, a plugin's dependences are resolved by getting the update center json from cfg.getJenkinsUc() + "/update-center.actual.json" and parsing this. 

      However, this may not always result in the correct dependencies for the requested/downloaded plugin. 

      Example: 

      Suppose the Jenkins Version is 2.121 and the requested plugin is artifact-manager-s3:latest. 

      The plugin would be downloaded from: 

      https://updates.jenkins.io/2.121/latest/artifact-manager-s3.hpi

       

      The correct dependencies could be found from the version specific update center json: 

      https://updates.jenkins.io/2.121/update-center.actual.json

      However, instead the code would get the dependencies from the update center listed in the configuration file, ignoring the version specific update center json: 

      https://updates.jenkins.io/current/update-center.actual.json

       

      See attached picture. 

      The same issue could occur when there is no Jenkins specific update center and the user specifies the version of the plugin directly.

      Suppose the user wants to download artifact-manager-s3, version 1.3 and they are directed to https://updates.jenkins.io/download/plugins/artifact-manager-s3/1.3/artifact-manager-s3.hpi

      The dependencies it appears this version is dependent on are: 

      aws-global-configuration:1.2,workflow-api:2.33,ap
      ache-httpcomponents-client-4-api:4.5.5-3.0,aws-credentials:1.23,struc
      ts:1.17

      Currently the code would find the dependencies from the current update center json (https://updates.jenkins.io/current/update-center.actual.json), which has the following dependencies: aws-global-configuration:1.3, jaxb:2.3.0.1,workflow-api:2.33,apache-httpcomponents-client-4-api, 4.5.5-3.0, aws-credentials:1.26, structs:1.17

       

       

       

       

       

       

       

       

        Attachments

          Activity

          Hide
          stopalopa Natasha Stopa added a comment -

          Found https://updates.jenkins.io/current/plugin-versions.json and will use that to find the dependencies for each requested plugin.

          Show
          stopalopa Natasha Stopa added a comment - Found https://updates.jenkins.io/current/plugin-versions.json  and will use that to find the dependencies for each requested plugin.
          Show
          stopalopa Natasha Stopa added a comment - Created a PR:  https://github.com/jenkinsci/plugin-installation-manager-tool/pull/33
          Hide
          stopalopa Natasha Stopa added a comment -

          The last PR resulted in an error when the user requested an experimental or incrementals version. Because the experimental and incremental versions might require dependencies not yet released in the latest update center, resolving the dependencies based on the latest json or plugin-versions json might not be accurate. Another PR was created that should resolve these issues and although initially there was relunctance about getting json from multiple locations, it seemed that this was the only way to accurately resolve the dependencies.

          https://github.com/jenkinsci/plugin-installation-manager-tool/pull/35

          Show
          stopalopa Natasha Stopa added a comment - The last PR resulted in an error when the user requested an experimental or incrementals version. Because the experimental and incremental versions might require dependencies not yet released in the latest update center, resolving the dependencies based on the latest json or plugin-versions json might not be accurate. Another PR was created that should resolve these issues and although initially there was relunctance about getting json from multiple locations, it seemed that this was the only way to accurately resolve the dependencies. https://github.com/jenkinsci/plugin-installation-manager-tool/pull/35
          Hide
          stopalopa Natasha Stopa added a comment -

          Fix was merged

          Show
          stopalopa Natasha Stopa added a comment - Fix was merged

            People

            • Assignee:
              stopalopa Natasha Stopa
              Reporter:
              stopalopa Natasha Stopa
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: