Problem/Motivation

Currently there is no handling of dependencies between features.

Proposed resolution

  • Analyze package configuration and introduce inter-feature dependencies based on configuration dependencies. Example: if feature A provides a content type required by a field instance in feature B, feature B has a dependency on feature A.
  • Only assign dependencies on features that are either (a) already exported and enabled on the site or (b) part of a set of features being generated.

Remaining tasks

These should be either dropped or moved to follow-up issues.

  • Dependency management will need to include removing superfluous dependencies. E.g. if both feature A and feature B have a dependency on the 'example' feature and we introduce a new dependency of feature B on feature A, feature B no longer needs an explicit dependency on the 'example' module.
  • To maintain interoperability, special handling may be needed for the 'core' package. That is, many features will have a dependency on the 'core' package, e.g., for providing field definitions. However, we should avoid introducing a dependency on that particular feature, since doing so would prevent combining features from multiple feature sets. Proposed resolution: skip the 'core' module when assigning dependencies and instead make 'core' a dependency of the install profile, if one is created. See also #2447703: Integrate with Configuration Share and Compatible.

User interface changes

API changes

Comments

nedjo’s picture

Title: Assign inter-package dependencies » Assign inter-feature dependencies
Project: Configuration Packager » Features
Version: 8.x-1.x-dev » 8.x-3.x-dev
Issue summary: View changes
Related issues: +#2447703: Integrate with Configuration Share and Compatible
nedjo’s picture

Priority: Normal » Major

Raising priority. This currently prevents auto generating installable distributions.

mpotter’s picture

Can you explain more about how this is blocking creating distributions?

From experience with Features in D7, handling the module dependency is a pretty huge effort and can have lots of problems. I had thought in D8 we only needed to worry about actual config dependencies, which CMI is already handling for us.

Example: if feature A provides a content type required by a field instance in feature B, feature B has a dependency on feature A.

In that case, the field_instance in feature B has a config dependency on the content_type in feature A. It doesn't matter what actual module provides this config. As long as the config exists then it's fine. The config is created when a module is enabled. But the config could also be satisfied by importing the config via CMI or by creating the content-type manually. It doesn't necessarily need a hard dependency on module A.

nedjo’s picture

Here's a concrete example that I just hit:

  • Install a site with the Standard install profile.
  • Create a bundle and generate all auto-assigned features.
  • Try to enable all features on a new site. The 'article' feature will fail to install with an error message. This is because the comment field on article requires the comment type to be present. So there is a dependency on the 'comment' feature.

So, while it's true that theoretically a given piece of configuration could end up on a site without having been installed, in practice, I'm thinking features are going to have to depend on other features to be sure that the required configuration is available.

  • nedjo committed 5af0ad9 on 8.x-3.x
    Issue #2401073 by nedjo: Assign inter-feature dependencies.
    
nedjo’s picture

Issue summary: View changes
nedjo’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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