jenkinsci / jenkinsci/plugin-installation-manager-tool
When resolving dependencies using manifest, do not fail if an optional plugin cannot be retrieved
- Dominant language
- Java
- Stars
- 463
- Forks
- 228
- Avg merge
- 31m
- Merged PRs (30d)
- 15
Description
### Version report
Jenkins and plugins versions report:
(FWIW version doesn't matter)
```
Jenkins: 2.249.3.1
OS: Mac OS X - 10.16
---
trilead-api:1.0.8
jdk-tool:1.4
command-launcher:1.4
script-security:1.75
echarts-api:4.9.0-1
structs:1.20
apache-httpcomponents-client-4-api:4.5.10-2.0
operations-center-server:2.249.0.8
support-core:2.70
cloudbees-analytics:1.27
mailer:1.32.1
bootstrap4-api:4.5.2-1
jquery3-api:3.5.1-1
command-launcher:1.4
workflow-api:2.40
jackson2-api:2.11.2
credentials:2.3.13
operations-center-agent:2.249.0.1
cloudbees-assurance:2.138.0.21
operations-center-context:2.249.0.3
bouncycastle-api:2.18
operations-center-license:2.249.0.1
variant:1.3
async-http-client:1.7.24.3
cloudbees-license:9.47
cloudbees-administrative-monitors:1.0.1
cloudbees-ha:4.25
jaxb:2.3.0.1
cloudbees-uc-data-api:4.43
font-awesome-api:5.14.0-1
token-macro:2.12
script-security:1.75
nectar-license:8.28
snakeyaml-api:1.27.0
node-iterator-api:1.5.0
workflow-step-api:2.22
metrics:4.0.2.6
plugin-util-api:1.2.5
popper-api:1.16.0-6
trilead-api:1.0.8
jdk-tool:1.4
cloudbees-folder:6.14
cloudbees-folders-plus:3.10
junit:1.37
mock-security-realm:1.4
scm-api:2.6.4
display-url-api:2.3.3
cloudbees-monitoring:2.10
cloudbees-support:3.25
mapdb-api:1.0.9.0
google-login:1.6
```
- What Operating System are you using (both controller, and any agents involved in the problem)?
```
masOS Big Sur
```
### Reproduction steps
You will need an Update Center referencing a plugin that declares an optional plugin that is not in said Update Center.
1. For reproduction purposes, let's use this CloudBees Update Center: https://jenkins-updates.cloudbees.com/update-center/envelope-core-oc/update-center.json?version=2.249.3.1/update-center.json
2. Try to run the tool on a plugin that declares an optional dependency that is not in this Update Center, eg in our case `operations-center-context:2.249.0.3` (make sure to specify the version so that the resolution is done from the MANIFEST of the hpi).
### Results
Expected result:
Success
Actual result:
Failure because the optional plugin cannot be downloaded:
```
Plugin operations-center-context:2.249.0.3 unable to find dependant plugin cloudbees-template in update center https://jenkins-updates.cloudbees.com/update-center/envelope-core-oc/update-center.json?version=2.249.3.1/update-center.json
at io.jenkins.tools.pluginmanager.impl.PluginManager.start(PluginManager.java:200)
at io.jenkins.tools.pluginmanager.impl.PluginManager.start(PluginManager.java:149)
at io.jenkins.tools.pluginmanager.cli.Main.main(Main.java:70)
Suppressed: io.jenkins.tools.pluginmanager.impl.PluginNotFoundException: Plugin operations-center-sso:2.249.0.2 (via operations-center-context:2.249.0.3) unable to find dependant plugin cloudbees-template in update center https://jenkins-updates.cloudbees.com/update-center/envelope-core-oc/update-center.json?version=2.249.3.1/update-center.json
at io.jenkins.tools.pluginmanager.impl.PluginManager.getLatestPluginVersion(PluginManager.java:848)
at io.jenkins.tools.pluginmanager.impl.PluginManager.resolveDependenciesFromManifest(PluginManager.java:910)
at io.jenkins.tools.pluginmanager.impl.PluginManager.resolveDirectDependencies(PluginManager.java:1013)
at io.jenkins.tools.pluginmanager.impl.PluginManager.resolveRecursiveDependencies(PluginManager.java:1047)
at io.jenkins.tools.pluginmanager.impl.PluginManager.findPluginsAndDependencies(PluginManager.java:627)
at io.jenkins.tools.pluginmanager.impl.PluginManager.start(PluginManager.java:192)
... 2 more
```
Contributor guide
Research direction
Start in PluginManager.java, especially getLatestPluginVersion, resolveDependenciesFromManifest, resolveDirectDependencies, and resolveRecursiveDependencies, then reproduce the operations-center-context case with the linked Update Center. Done means manifest resolution succeeds when an optional plugin is absent from that Update Center, without failing the requested plugin.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100