-
Notifications
You must be signed in to change notification settings - Fork 196
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
[JENKINS-58308] Add check for plugin and Jenkins version compatibility #65
Conversation
for (Plugin p : pluginsToBeDownloaded) { | ||
if (p.getJenkinsVersion() != null) { | ||
if (p.getJenkinsVersion().compareTo(jenkinsVersion) > 0) { | ||
System.out.println( |
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.
I would either fail or not add the check I think, how likely is that people would see this is in the logs?
newer jenkins core normally means newer apis are consumed so it wouldn't be safe to proceed anyway?
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.
Why did you first say you might not add the check at all?
Just that worried it will get lost in a sea of logging and not be beneficial, I would prefer it fails though
From: Natasha Stopa <notifications@github.com>
Reply to: jenkinsci/plugin-installation-manager-tool <reply@reply.github.com>
Date: Thursday, 8 August 2019 at 20:55
To: jenkinsci/plugin-installation-manager-tool <plugin-installation-manager-tool@noreply.github.com>
Cc: Tim Jacomb <T.Jacomb@kainos.com>, Review requested <review_requested@noreply.github.com>
Subject: Re: [jenkinsci/plugin-installation-manager-tool] [JENKINS-58308] Add check for plugin and Jenkins version compatibility (#65)
@stopalopa commented on this pull request.
________________________________
In plugin-management-library/src/main/java/io/jenkins/tools/pluginmanager/impl/PluginManager.java<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjenkinsci%2Fplugin-installation-manager-tool%2Fpull%2F65%23discussion_r312215934&data=02%7C01%7Ct.jacomb%40kainos.com%7C3d72461797304e42c61308d71c3a669a%7C7ed9bdc7964d4dc09084812b90e05c6d%7C0%7C0%7C637008909469739705&sdata=1NVvn99xBdKw08uFak%2B3hXqrN625qliAnlFaU2Fbbkc%3D&reserved=0>:
@@ -343,6 +344,27 @@ public boolean warningExists(Plugin plugin) {
return !securityWarnings.isEmpty();
}
+ /**
+ * Checks that required Jenkins version of all plugins to be downloaded is less than the Jenkins version in the
+ * user specified Jenkins war file
+ *
+ * @param pluginsToBeDownloaded
+ */
+ public void checkVersionCompatibility(List<Plugin> pluginsToBeDownloaded) {
+ if (jenkinsVersion != null && !StringUtils.isEmpty(jenkinsVersion.toString())) {
+ for (Plugin p : pluginsToBeDownloaded) {
+ if (p.getJenkinsVersion() != null) {
+ if (p.getJenkinsVersion().compareTo(jenkinsVersion) > 0) {
+ System.out.println(
Why did you first say you might not add the check at all?
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjenkinsci%2Fplugin-installation-manager-tool%2Fpull%2F65%3Femail_source%3Dnotifications%26email_token%3DAFBWQHSA3UCYKLRBMR2XGJ3QDR237A5CNFSM4IKNTRXKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCBBKI4Y%23discussion_r312215934&data=02%7C01%7Ct.jacomb%40kainos.com%7C3d72461797304e42c61308d71c3a669a%7C7ed9bdc7964d4dc09084812b90e05c6d%7C0%7C0%7C637008909469739705&sdata=GJp%2FFily%2BLEf09BaG2GVClCbWlUAJcZQTJXh2mePF3s%3D&reserved=0>, or mute the thread<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAFBWQHVADUT3DTHOPAKTJG3QDR237ANCNFSM4IKNTRXA&data=02%7C01%7Ct.jacomb%40kainos.com%7C3d72461797304e42c61308d71c3a669a%7C7ed9bdc7964d4dc09084812b90e05c6d%7C0%7C0%7C637008909469749703&sdata=vPwiMHkeK%2FBkCHlos%2BPgB6yN9unknsEmVp9PdASgJuE%3D&reserved=0>.
|
Should users actually be prevented from downloading plugins if there's a version incompatibility or should this just be a warning?
https://issues.jenkins-ci.org/browse/JENKINS-58308