Assignment plugins may set configuration as optional, but when generating the Features package modules dependencies get set to packages containing a configuration item's dependencies.

This is occurring due to FeaturesManager::assignInterPackageDependencies processing all config items as if they are required and setting dependencies to the packages.

Comments

kerasai created an issue. See original summary.

kerasai’s picture

Status: Active » Needs review
StatusFileSize
new847 bytes

Attached is a patch to address the issue.

I'm not too fond of breaking out of foreach loops, but this is probably the simplest/safest solution.

It would be great to refactor this a bit into smaller, easier to digest (and test) methods but that's beyond the scope of fixing this.

nedjo’s picture

Issue tags: +Needs tests

Thanks, this looks good.

We should update the tests to cover this bug. That should be relatively straightforward, starting with setting the subdirectory for items in FeaturesManagerTest::getAssignInterPackageDependenciesConfigCollection().

nedjo’s picture

Here's a tests-only patch that should fail.

Status: Needs review » Needs work

The last submitted patch, 4: features-optional-dependency-2902966-4-tests-only.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

nedjo’s picture

Status: Needs work » Needs review

And with a fix.

#2 was testing the dependent item for InstallStorage::CONFIG_OPTIONAL_DIRECTORY. However, it's the other side of the dependency that we need to test. We add the dependency only if the required config item is in InstallStorage::CONFIG_INSTALL_DIRECTORY.

nedjo’s picture

  • nedjo committed a41d1d6 on 8.x-3.x
    Issue #2902966 by nedjo, kerasai: Inter-Package Dependencies Set for...
nedjo’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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