Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional dependencies should not fail an installation when unfindable #294

Closed
mbarbero opened this issue Mar 2, 2021 · 3 comments · Fixed by #296
Closed

Optional dependencies should not fail an installation when unfindable #294

mbarbero opened this issue Mar 2, 2021 · 3 comments · Fixed by #296

Comments

@mbarbero
Copy link
Contributor

mbarbero commented Mar 2, 2021

Since 2.6.0, I am unable to download a plugin installation with this single plugin requested: email-ext

❯ java -jar jenkins-plugin-manager-2.6.0.jar --plugins email-ext --list --no-download --plugin-download-directory "$(mktemp -d)"
Unable to open /usr/share/jenkins/jenkins.war
Unable to get Jenkins version from the WAR file /usr/share/jenkins/jenkins.war
War not found, installing all plugins: /usr/share/jenkins/jenkins.war
Unable to find plugin analysis-core in update center https://updates.jenkins.io/update-center.json

While it works properly with 2.5.0.

❯ java -jar jenkins-plugin-manager-2.5.0.jar --plugins email-ext --no-download --list --plugin-download-directory "$(mktemp -d)"
Unable to open /usr/share/jenkins/jenkins.war
Unable to get Jenkins version from the WAR file /usr/share/jenkins/jenkins.war
War not found, installing all plugins: /usr/share/jenkins/jenkins.war

Installed plugins:

Bundled plugins:

All requested plugins:
bootstrap4-api 4.6.0-2
checks-api 1.5.0
display-url-api 2.3.4
echarts-api 4.9.0-4
email-ext 2.81
font-awesome-api 5.15.2-2
jackson2-api 2.12.1
jquery3-api 3.5.1-3
junit 1.48
mailer 1.32.1
matrix-project 1.18
plugin-util-api 2.0.0
popper-api 1.16.1-2
scm-api 2.6.4
script-security 1.76
snakeyaml-api 1.27.0
structs 1.22
token-macro 2.15
workflow-api 2.41
workflow-job 2.40
workflow-step-api 2.23
workflow-support 3.7

Plugins that will be downloaded:
bootstrap4-api 4.6.0-2
checks-api 1.5.0
display-url-api 2.3.4
echarts-api 4.9.0-4
email-ext 2.81
font-awesome-api 5.15.2-2
jackson2-api 2.12.1
jquery3-api 3.5.1-3
junit 1.48
mailer 1.32.1
matrix-project 1.18
plugin-util-api 2.0.0
popper-api 1.16.1-2
scm-api 2.6.4
script-security 1.76
snakeyaml-api 1.27.0
structs 1.22
token-macro 2.15
workflow-api 2.41
workflow-job 2.40
workflow-step-api 2.23
workflow-support 3.7

Resulting plugin list:
bootstrap4-api 4.6.0-2
checks-api 1.5.0
display-url-api 2.3.4
echarts-api 4.9.0-4
email-ext 2.81
font-awesome-api 5.15.2-2
jackson2-api 2.12.1
jquery3-api 3.5.1-3
junit 1.48
mailer 1.32.1
matrix-project 1.18
plugin-util-api 2.0.0
popper-api 1.16.1-2
scm-api 2.6.4
script-security 1.76
snakeyaml-api 1.27.0
structs 1.22
token-macro 2.15
workflow-api 2.41
workflow-job 2.40
workflow-step-api 2.23
workflow-support 3.7
Done

In the current update-center.json, email-ext declares its dependency to analysis-core like this:

{
  "name": "analysis-core",
  "optional": true,
  "version": "1.54"
}

But analysis-core is not (anymore) in update-center.json. As the dependency is optional, I would expect the install to not fail.

My guess is that it is a regression from the new handling of optional dependencies.

@timja
Copy link
Member

timja commented Mar 2, 2021

cc @yabberyabber is this something you could take a look at?

@yabberyabber
Copy link
Contributor

Good catch! I had not considered this edge case

Here's a quickfix for the issue #296 - mbarbero's command works fine using this patch (though it does print a warning to stderr)

@mbarbero
Copy link
Contributor Author

mbarbero commented Mar 3, 2021

Thanks for the quick fix and the quick release. Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants