Problem/Motivation

The farm/settings/modules form provides a simplified UI for privileged roles to enable farmOS modules.

We recently added the ability to enable "contrib" modules as well: #3220609: Add a mechanism for detecting/displaying contrib farmOS modules in /farm/settings/modules

However it isn't always clear what a contrib module adds/includes, which makes it a bit of a guessing game to enable modules (unless you search elsewhere in the community to discover what the module does).

Further, it is not possible to disable modules through this UI (yet) - so once it's enabled you're stuck with it.

Proposed resolution

We talked about potentially looking to the module's *.info.yml or composer.json files and including relevant information from there.

I think using composer.json would be easier, because they already include information like project URL, alongside description, etc. We could also consider adding some custom properties.

Or to take it even further... maybe we could add some auto-detection of specific types of code that the module provides. For example, it would be great if we could easily see which asset, log, plan types the module adds... or which flags, etc. These could potentially be detected from the module's config/install directory.

Remaining tasks

TBD

User interface changes

Show more information about farmOS contrib modules in farm/settings/modules.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#7 module_descriptions.png136.51 KBpaul121
#3 farm_packages.png80.34 KBpaul121

Issue fork farm-3243336

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

Issue tags: +stable blocker

Another question to consider: do we do the same thing with farmOS core modules? I think we should. But those don't have composer.json files...

paul121’s picture

FileSize
80.34 KB

Thinking about this a bit..

I think using composer.json would be easier, because they already include information like project URL, alongside description, etc. We could also consider adding some custom properties.

Notably, *.info.yml has a description as well! And it seems like we can toss custom properties in there. Also there's already a Drupal service provided for loading this module info, and we're already using it which makes it a bit more convenient: https://github.com/farmOS/farmOS/blob/1a7582b8abb719828d5a7f707780248974...

do we do the same thing with farmOS core modules? I think we should. But those don't have composer.json files...

Also submodules from a contrib module! These wouldn't have composer.json either. I think *.info.yml is our best bet.

For example, it would be great if we could easily see which asset, log, plan types the module adds... or which flags, etc. These could potentially be detected from the module's config/install directory.

Should we consider re-structuring the fieldsets to be the different high-level farmOS packages, instead of a core/contrib distinction? Each module could have (Core) or (Contrib) appended to its name in different colors to differentiate the two types. I'm attaching a screenshot of what these packages look like right now in the admin/modules page. I guess it largely depends on the user, but this type of navigation seems like it would be more effective than clicking through individual modules to see what they provide. For example, I like that "farmOS Maps" has it's own category. This is really intuitive! (maybe we drop the "farmOS" prefix and only have a subset of the current ones?)

I guess when it comes to flags, id tags, categories... higher level fieldsets would be excessive. But maybe a hybrid of more high-level categories, with "tags" for these different config entities they provide?

Of course it's possible for a module to provide multiple of these different entity types... but maybe this helps encourage separating such features into distinct modules? A module could always choose to be a part of a more general "farmOS Contrib" package as well and use the "tags" to show what all it provides. Could we allow contrib modules to create their own categories too?

So... what if we added new farm_module_link and farm_module_category properties to *.info.yml. These could be used instead of the current module package to show more info about core & contrib modules?

m.stenta’s picture

Notably, *.info.yml has a description as well! And it seems like we can toss custom properties in there. Also there's already a Drupal service provided for loading this module info, and we're already using it which makes it a bit more convenient

Also submodules from a contrib module! These wouldn't have composer.json either. I think *.info.yml is our best bet.

Ah those are really good points! Ok - *.info.yml it is. :-)

Should we consider re-structuring the fieldsets to be the different high-level farmOS packages, instead of a core/contrib distinction?

I'm not sure I like this. My gut tells me we want to keep the package more internal/administrative - and always use "farmOS Contrib" as the mechanism for finding modules that should be included in this list. Contrib will always be less granular than core too. We break things up into very specific modules by the type of thing they provide in core, but contrib will probably tend to put lots of different types of things in the same module - categorizing more on the subject matter than the granular data types. I don't think we need to discourage this.

maybe we could add some auto-detection of specific types of code that the module provides. For example, it would be great if we could easily see which asset, log, plan types the module adds... or which flags, etc

This is probably too ambitious for now... but could potentially be added in the future.

What if we just keep this super simple for now and just add the description text next to the module's name? Then it's up to the module maintainers to make sure their descriptions are decent?

paul121’s picture

Status: Active » Needs review

What if we just keep this super simple for now and just add the description text next to the module's name? Then it's up to the module maintainers to make sure their descriptions are decent?

Done! This is a pretty simple change. I made it so the core module descriptions are used as well, but we still use the special names we have given them. Attached is a screenshot of what this looks like.

Contrib will always be less granular than core too. We break things up into very specific modules by the type of thing they provide in core, but contrib will probably tend to put lots of different types of things in the same module - categorizing more on the subject matter than the granular data types. I don't think we need to discourage this.

Good points, I agree. Maybe it would be worth while having those "subjects" be high-level categories just under the farmOS Contrib fieldset. But easy to let that be TBD and add later once there are more contrib modules and a need to organize them.

paul121’s picture

FileSize
136.51 KB

Adding descriptions nearly doubles the length of the list. It seems that descriptions might not be needed for *all* of the core modules, but I think it is good to have for others.

m.stenta’s picture

Thanks @paul121 - this looks great IMO! I don't mind the long list. We can address that later if we need to.

I added one commit, which moves all the description loading logic into FarmSettingsModulesForm::moduleOptions(), and out of farm_modules(), so we can keep that clean/simple.

What do you think? I think this is ready to merge otherwise!

  • m.stenta committed 30530be on 2.x
    Issue #3243336 by paul121, m.stenta: Show farmOS contrib module info in...
m.stenta’s picture

Status: Needs review » Fixed

(Spoke with @paul121 in chat.) Merged!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.