Closed (fixed)
Project:
Hosting
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
26 May 2013 at 02:30 UTC
Updated:
21 Jun 2013 at 05:10 UTC
When I started looking into #2004188: Feature reverse dependencies are not enforced, I noticed that we're inconsistent with our use of 'hosting features'. For example, we have a 'Server administration' feature from hosting_server (in hosting_server.module rather than hosting.feature.server.inc, btw), but no equivalent for hosting_site or hosting_platform. Also, rather then declaring itself HOSTING_FEATURE_REQUIRED, it just omits to associate itself with a module (which has a similar effect of making the checkbox disabled in the features form.)
I'm going to clean this up, and add a collapsed 'required' fieldset at the top, similar Drupal 'core - required' on the modules page.
Comments
Comment #1
ergonlogicIn the dev/features_cleanup branch, I've added a 'required' fieldset to the features form, and added features for the modules that were missing them, all of which are required. My reasoning here is to make things more consistent and discoverable.
I also discovered an odd behaviour when enabling a feature that has dependencies. We get the following status message:
Along with the following error:
Comment #2
ergonlogicAlso, we're polluting the variables table with a bunch of useless entries, since we do this:
when system_settings_form_submit() already does the same thing, but without the 'hosting_feature_' prefix. We could clear up this duplication by adding that prefix to our form array keys.
Comment #3
ergonlogicI added an update hook to cleanup this junk from the variables table.
Documentation for enable/disable callback functions was wrong. I fixed the docs, and provided examples. We should test for this, at some point too.
Re. #1, we seem to be trying to be too clever, and enable/disable in the same foreach loop. I think we should build our array of modules to enable/disable first, along with dependencies. Then we can enable/disable those, and run our callbacks.
Comment #4
jon pughAlso, hook_hosting_features() doesn't really respect "group". If you add "group" => "anything" it puts it in the "Experimental" group.
Comment #5
anarcat commentedIt would be nice to group things in that page. As contrib grows, it may become useful to have "Aegir core", "Aegir contrib", "Devshop" or "Barracuda" groups...
But I agree we need to separate experimental from builtin from optional...
Comment #6
ergonlogicOne idea that came up in discussion, was to sub-divide the fieldsets by the module groupings on the modules page. That way, the existing fieldsets, which represent the a status remain, but we have flexibility to group together features within (i.e. devshop, aegir_contrib, etc.)
Comment #7
jon pugh+1 to using Drupal module packages to organize these.
-1 to combining that with the existing aegir "status" grouping.... this would just increase confusion I think.
It's a bit presumptuous for us to assume that all aegir contrib modules are "experimental", isn't it?
Comment #8
ergonlogic'Experimental" is just the default. It can be overridden by just listing your relevant feature(s) in the 'optional' group, or even 'required' (though I wouldn't recommend it).
Comment #9
jon pughAhhh then this is also a documentation issue! I never knew that "optional" was ... an option.
Comment #10
ergonlogicI've merged my dev branch into 6.x-2.x.
We now display dependencies, and lock features required by others (just like on the modules page). I also added grouping by module package, along with a minor update to Eldir to distinguish a fieldset within fieldset. Finally, I fixed up the enable/disable logic.
On a related note, I've mentioned before that I think our Hosting Features functionality should just be replaced by Features, but I think the two issues are orthogonal. While Features would make exporting other Drupal config easier (Views is a good example), I think Hosting Features still has its place. First off, it gives us a 'administer hosting features' permission, that makes it possible for a user not to have to have full site admin access to manage Aegir features.
Secondly, we may want to consider implementing either/or-type dependencies. Right now, to Nginx you need to enable Apache support, and likewise Apache SSL support for Nginx SSL. Eventually, we'll probably have #585796: postgresql backend support, and still need MySQL enabled (if if we fix #548882: PostgreSQL frontend support). While we'd need to pull Apache out of Web Server, and so on, I think it might be worthwhile.
Comment #11
anarcat commentedCan you open a separate issue about either/or dependencies? Possibly with core itself, if it's not already there?
Comment #12
ergonlogicI had added #2013719: Separate default implementations from services, as a follow-up to my second argument. I have reconsidered the need for either/or dependencies, but I'll document it in that (active) issue.