-
Notifications
You must be signed in to change notification settings - Fork 203
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
Do not fail if optional plugin cannot be retrieved #317
base: master
Are you sure you want to change the base?
Conversation
…ot fail if an optional plugin cannot be retrieved
plugin-management-library/src/main/java/io/jenkins/tools/pluginmanager/impl/PluginManager.java
Outdated
Show resolved
Hide resolved
plugin-management-library/src/main/java/io/jenkins/tools/pluginmanager/impl/PluginManager.java
Outdated
Show resolved
Hide resolved
…ot fail if an optional plugin cannot be retrieved
@timja I followed your advice and modify the |
🤷 no real policy on it here. I'm not aware of any tools embedding this that would update without getting a compile time error, but you can just deprecate it and can remove them in a major version sweep at some point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assumption about optional plugins is not fully correct. We do care about the version if there is a conflict.
E.g. we may have plugins A depending on C:1.2:optional and B depending on C:1.1:mandatory. In this case dependency metadata download failure for A will lead to the installation of C:11 which might be binary incompatible with A and lead to the Jenkins startup failure.
I am fine with more relaxed rules for optional dependencies, but this one does not seem to be the best approach when enabled by default.
no options please, the current ones are confusing enough. if it's optional we can ignore it, not sure if you can set the version number to be 'optional'? |
@oleg-nenashev good point but I'm not sure how the case you mention could happen given that if C is not proposed by the UC you will never be able to resolve any version, right? So in this use case, the CLI will fail anyway when resolving the dependencies of B.
+1 :) |
Not sure I didn't read the whole codeline (yet :)) but I assume that if I return "latest", and there are two different versions to resolve at some point, the non latest one would win... so the proposed solution would be equivalent to specifying an optional version. |
@oleg-nenashev happy to improve this PR to get it over the finish line, would you mind giving me an example of what this PR would break, I'm not sure I can find one (see my previous answer for my reasoning: #317 (comment)). |
Sorry, I missed it |
…f an optional plugin cannot be retrieved
Swallow the
PluginNotFoundException
if the dependency is optional.Opening as a WIP PR, I'm not happy to have to do this this way but I'm not exactly sure how the optional dependencies are treated in the project, not sure why they are not skipped if they are causing trouble. Happy to discuss further to enhance the solution.
Once we agree on a solution I'll add tests.
Fixes #316