Consider broadening the module#enable() API

Description

As per a discussion in Slack with there may be some benefit in allowing an installer (or API) to specify some more information when calling enable.

  • Potentially the Plugin ID (with perhaps distinguishing names for the IdP and for the Moduke Command

  • A “reason” which might be an enumeration legacy/install/reenable/commandline

It feels like this can be done in 5.2 with a default implementation in the interface.

Environment

None

Activity

Scott Cantor 
March 24, 2025 at 6:43 PM

Looks like the installer tools are injecting the various states into the API so yeah, should be done re: the IdP.

Rod Widdowson 
March 24, 2025 at 10:46 AM

I think the work items here are

  • To add sub tasks for each plugin. This will require rolling the plugin min IDP to 5.2 so may be less than ideal

  • To do the work for the IdP plugins.

In all cases this feels like something we will only need when we need it (a specific file has a specific need which depends on know what is going on outside).

So maybe we can mark this as resolved?

Rod Widdowson 
November 22, 2024 at 2:26 PM

I’ve done the infrastructural changes. I’ll leave this unassigned for someone to pick up and make changes to the module implementations as the mood takes them

Scott Cantor 
November 21, 2024 at 3:22 PM

I think the crux of what I was after was to think about how to make the implicit behavior of the installers known to the module steps so they know what’s really going on in special/weird cases.

That way they can tell how to clean up files in certain edge cases without us needing to be really super careful about how we define resources if we change module IDs.

Rod Widdowson 
November 21, 2024 at 3:16 PM

OK. So a break for lunch and some contemplation has persuaded me that I am conflating two very different things

  • What is the user doing? (plugin install, plugin upgrade, install, plugin uninstall, command line).

  • If this is an installer is this an initial enable or a reenable as part of the standard upgrade.

The first very obviously goes into the context, the second may not be knowable and is done per module (so in an upgrade there may well be a mix of enable and re-enable). I think that this goes onto (a second, defaulted) enable call.

At this stage I do not completely grock where each might be useful, but I was going mad trying to conflate two orthogonal issues.

I’ll do the installer/api side of this and we can loop back and see how to use it

Completed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Created October 29, 2024 at 10:16 AM
Updated March 25, 2025 at 8:40 AM
Resolved March 25, 2025 at 8:40 AM