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

[JENKINS-69487] prevent uninstalled detached plugins get reinstalled #8634

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

mawinter69
Copy link
Contributor

@mawinter69 mawinter69 commented Oct 22, 2023

when a detached plugin gets uninstalled a marker file is created so that on next startup it will not be installed again.
e.g. the javax-mail-api plugin is loaded frequently but usually not needed by most older plugins.

See JENKINS-69487
also JENKINS-72195

Testing done

added unit tests validating the behaviour

Proposed changelog entries

  • JENKINS-XXXXX, human-readable text

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

when a detached plugin gets uninstalled a marker file is created so that
on next startup it will not be installed again.
e.g. the javax-mail-api plugin is loaded frequently but usually not
needed by most older plugins.
@mawinter69
Copy link
Contributor Author

Some questions:

  • Should the behaviour always be active or should this depend on a systemproperty maybe
  • Would it make sense to have also an approach where one can specify the detached plugins not to install via another systemproperty (thinking of helm charts or dockerized, so that you can avoid the plugins from the beginning)

@NotMyFault NotMyFault added the rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Oct 23, 2023
@NotMyFault NotMyFault requested a review from a team October 23, 2023 14:24
@timja
Copy link
Member

timja commented Oct 23, 2023

  • Should the behaviour always be active or should this depend on a systemproperty maybe

Looks fine to be always active

  • Would it make sense to have also an approach where one can specify the detached plugins not to install via another systemproperty (thinking of helm charts or dockerized, so that you can avoid the plugins from the beginning)

it would be nice yeah in these systems plugins are generally not touched manually and are fully defined in code.

@daniel-beck daniel-beck self-requested a review October 23, 2023 20:55
@daniel-beck
Copy link
Member

Thanks for looking into this!

How does it behave when you're installing new plugins, or just updating existing plugins, with implicit dependencies? At least in the new plugin case, I'd expect the implicit dependency to get installed (otherwise too unsafe, admin's decision can be assumed to be scoped to the set of plugins installed when they decided to uninstall), but if it behaves the same when updating an existing plugin, it'll get annoying quickly if plugins with slightly older core dependencies are actively maintained.

@mawinter69
Copy link
Contributor Author

Thanks for looking into this!

How does it behave when you're installing new plugins, or just updating existing plugins, with implicit dependencies? At least in the new plugin case, I'd expect the implicit dependency to get installed (otherwise too unsafe, admin's decision can be assumed to be scoped to the set of plugins installed when they decided to uninstall), but if it behaves the same when updating an existing plugin, it'll get annoying quickly if plugins with slightly older core dependencies are actively maintained.

At the moment the plugin would always be ignored. Maybe we can show a message after installing new plugins, that there are plugins that have been uninstalled and which where not installed. Though such a message might be missed when one directly leaves the page with the installation status.
At least we could show a warning when uninstalling such a plugin, that it will be ignored and that this can lead to issues when plugins get installed that implicitly depend on it.
Distinguishing between updates and new installs might be tricky. e.g. when I have installed plugin A in version 1 that has an implied dep to javax-mail-api. Assume there is already a version 2 of plugin A that still has the implied dep. Further assume I now install plugin B (not having implied dep to anything) that requires plugin A version 2.
I'm not sure if it's worth the effort, the candidates for this feature are most likely the javax-mail-api (where having it can lead to problems) and the oracle JDK plugins.

@daniel-beck
Copy link
Member

I'm not sure if it's worth the effort, the candidates for this feature are most likely the javax-mail-api (where having it can lead to problems) and the oracle JDK plugins.

We don't know what we'll remove in the future. There are Jira issue suggesting we rip out FreeStyleProject, for example.

Maybe we can show a message after installing new plugins, that there are plugins that have been uninstalled and which where not installed. Though such a message might be missed when one directly leaves the page with the installation status.

AdministrativeError could be used for this (even if not nice), or another new (possibly ad-hoc instantiated, depending on the behavior we want) subclass of AdministrativeMonitor.

/**
* List of detached plugins that should not be installed as implied dependency.
*/
@SuppressFBWarnings(value = "MS_MUTABLE_COLLECTION_PKGPROTECT", justification = "for script console")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be private if that's the problem, the script console doesn't care about visibility.

@daniel-beck daniel-beck self-requested a review November 13, 2023 22:17
@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Dec 4, 2023
Copy link
Contributor

github-actions bot commented Dec 4, 2023

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot removed the unresolved-merge-conflict There is a merge conflict with the target branch. label Dec 4, 2023
@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Jul 19, 2024
Copy link
Contributor

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot removed the unresolved-merge-conflict There is a merge conflict with the target branch. label Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants