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

RFE determin if plugin that has hasUpdate true is als o compatible with jenkins version #8

Open
MalfuncEddie opened this issue Feb 24, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@MalfuncEddie
Copy link
Contributor

Hi,

We follow the lst version of jenkins and in a last update it updated plugins that have the followingw arning in the gui.

Warning: The new version of this plugin is marked as incompatible with the installed version. This is usually the case because its behavior changed, or because it uses a different settings format than the installed version. Jobs using this plugin may need to be reconfigured, and/or you may not be able to cleanly revert to the prior version without manually restoring old settings. Consult the plugin release notes for details.

Unfortunately the plugins got updated ad we got issues. It would be nice if the facts module would have a "compatible" field that prevents these kind of errors.

@tobias-richter
Copy link
Contributor

@MalfuncEddie that sounds like a good idea. I am afraid that this feature is currently out of our development scope of wcm-io-devops (but that may change in the future). The place to implement this feature would be https://github.com/wcm-io-devops/ansible-jenkins-facts/blob/master/scripts/groovy/gather_jenkins_facts.groovy so you are invited to create a PR for this.

@tobias-richter tobias-richter added the enhancement New feature or request label Feb 24, 2022
@MalfuncEddie
Copy link
Contributor Author

Been looking in the https://javadoc.jenkins.io/hudson/model/UpdateSite.Plugin.html

but it seems the isCompatible is restricted for now ;(

isCompatible @Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @Exported public boolean isCompatible() Returns true if the plugin and its dependencies are fully compatible with the current installation This is set to restricted for now, since it is only being used by Jenkins UI or Restful API at the moment. Since: 2.175

@MalfuncEddie
Copy link
Contributor Author

MalfuncEddie commented Feb 25, 2022

this should do it

line 56 to 66

` if (updateInfo != null) {
isCompatibleWithInstalledVersion = updateInfo.isCompatibleWithInstalledVersion()
}
Map tmpPlugin = [
version: plugin.getVersion(),
enabled: plugin.isEnabled(),
active: plugin.isActive(),
isCompatibleWithInstalledVersion: isCompatibleWithInstalledVersion,
hasUpdate: updateInfo != null

]`

will pr after the weekend .

@MalfuncEddie
Copy link
Contributor Author

Hmm, It seem I have solved a different problem than expected. Now plugins do not update when isCompatibleWithInstalledVersion is false but this is between plugin versions and not the jenkins version and plugin version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants