Safe ways to handle extraction of features into new plugins

21 views
Skip to first unread message

Chris Kilding

unread,
Sep 27, 2021, 7:18:01 AM9/27/21
to jenkin...@googlegroups.com
Hi,

I'm wondering what techniques people have used to safely extract features from existing plugins into new plugins.

At first glance a phased approach intuitively makes sense:

1. Plugin A exists.
2. Extract feature from A into new plugin B. Release B.
3. Delete feature code from A. Make A depend on B (to transitively inherit the feature). Release A.
4. Wait a while for adoption of new A version.
5. Remove the B dependency from A. Release A.

However there is a problem that some 3rd party Jenkins management tools (i.e. not Jenkins' own tools like Plugin Installation Manager CLI) do not download transitive plugin dependencies when they install a plugin.

One such example is the Puppet Jenkins module: https://forge.puppet.com/modules/puppet/jenkins#plugin-dependencies

These tools usually offer plugin version pinning which mitigates the worst effects. However it would seem that as soon as step 3 happens and the Jenkins admin updates A, the extracted feature effectively disappears on their installation, unless they have somehow learned that they should also install B. So for this group of users there is no phased migration.

(Yes, Jenkins admins using these tools *should* run a non-production copy of Jenkins to test their changes before deploying, and yes they *should* read release notes before incrementing any plugin version... but this doesn't always happen.)

Do we consider these use cases when extracting features? If so do we employ any techniques to help e.g. major version increments?

Chris

Daniel Beck

unread,
Sep 27, 2021, 7:28:19 AM9/27/21
to JenkinsCI Developers
On Mon, Sep 27, 2021 at 1:17 PM Chris Kilding <chris+...@chriskilding.com> wrote:
However there is a problem that some 3rd party Jenkins management tools (i.e. not Jenkins' own tools like Plugin Installation Manager CLI) do not download transitive plugin dependencies when they install a plugin.



These tools usually offer plugin version pinning which mitigates the worst effects. However it would seem that as soon as step 3 happens and the Jenkins admin updates A, the extracted feature effectively disappears on their installation, unless they have somehow learned that they should also install B.

This doesn't seem any different from adding a new feature or integration to a plugin with a new, non-optional dependency on another plugin, or is it? If you plugin fails to load because of an unsatisfied dependency, it doesn't matter whether the feature's code is present or not.

Chris Kilding

unread,
Sep 27, 2021, 7:53:28 AM9/27/21
to jenkin...@googlegroups.com
As long as both extracting a feature and adding a feature with a dependency would cause Jenkins to stop with an early initialisation error, so that the admin knows they've got to go and install the extra dependency, then yes I'd see them as equivalent.

Chris
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.

Daniel Beck

unread,
Sep 27, 2021, 9:35:28 AM9/27/21
to JenkinsCI Developers
On Mon, Sep 27, 2021 at 1:53 PM Chris Kilding <chris+...@chriskilding.com> wrote:
As long as both extracting a feature and adding a feature with a dependency would cause Jenkins to stop with an early initialisation error, so that the admin knows they've got to go and install the extra dependency, then yes I'd see them as equivalent.

Jenkins is more tolerant than that, but it will log errors and show admin monitors about failed plugins in both cases.

Jesse Glick

unread,
Sep 27, 2021, 10:31:09 AM9/27/21
to Jenkins Dev
On Mon, Sep 27, 2021 at 7:18 AM Chris Kilding <chris+...@chriskilding.com> wrote:
some 3rd party Jenkins management tools […] do not download transitive plugin dependencies when they install a plugin.

So fix them, or advise your users to avoid them? 
Reply all
Reply to author
Forward
0 new messages