Problem/Motivation

This issue is similar to #2883813: Move File/Image media type into Standard once Media is stable.

Having configuration in the module folder is always problematic for distributions. Distributions normally ship their config in different sub-modules. Overwriting module configurations like the workflow is only possible from the profile config directory. But that doesn't work, if the overridden config is now depending on a sub-module.

Proposed resolution

So please move the config into the standard profile to make it easier for install profiles to ship their own configuration.

Comments

chr.fritsch created an issue. See original summary.

timmillwood’s picture

This is a good point.

I've queued a test because there are a number of tests which depend on the editorial workflow. I guess we could add this config to the testing profile too? or change the tests to have their own config?

chr.fritsch’s picture

Status: Needs review » Needs work

I don't think we are adding things like this to the testing profile.

Maybe introducing a ContentModerationTestTrait that provides a method to create the workflow?

timmillwood’s picture

Right, I think a trait might be the best solution here.

chr.fritsch’s picture

Status: Needs work » Needs review
StatusFileSize
new32.27 KB

Let's see how far we get with this...

Status: Needs review » Needs work

The last submitted patch, 5: 2952307-5.patch, failed testing. View results

timmillwood’s picture

Thanks @chr.fritsch, looking good so far, 25 is better than 57.

chr.fritsch’s picture

Status: Needs work » Needs review
StatusFileSize
new40.17 KB
new10.29 KB

Next try. Hopefully, we come even closer...

Status: Needs review » Needs work

The last submitted patch, 8: 2952307-8.patch, failed testing. View results

chr.fritsch’s picture

Status: Needs work » Needs review
StatusFileSize
new39.79 KB
new1.7 KB

All the tests are fixed now

timmillwood’s picture

Two nit picks:

  • The trait is in the Functional namespace, but also used in Kernel tests, maybe we should put it in \Drupal\Tests\content_moderation\ContentModerationTestTrait or \Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait?
  • We're not testing the editorial workflow is added by the standard profile. Maybe that can just be assumed though?

Otherwise, looks good!

chr.fritsch’s picture

StatusFileSize
new41.88 KB
new17.42 KB

Thanks for reviewing @timmillwood!

I moved the trait into a "Trait" folder and added a check to Drupal\Tests\standard\Functional\StandardTest

timmillwood’s picture

Status: Needs review » Reviewed & tested by the community

Awesome, thanks, looks great!

larowlan’s picture

Status: Reviewed & tested by the community » Needs review

This is going to break people custom tests and contrib tests.

Are we sure it is the right approach?

Profiles can duplicate configuration provided by modules and their configuration will take precedence over that defined in the module.

E.g. we have in core

core/profiles/demo_umami/config/install/automated_cron.settings.yml
core/profiles/standard/config/install/automated_cron.settings.yml
core/modules/automated_cron/config/install/automated_cron.settings.yml

Is there a reason why your profile can't have its own version in config/optional?

berdir’s picture

You can override existing configuration, but you can't prevent it from being installed at all. Another problem with overriding is dependencies, it's a pain to for example to override default views that are provided by modules because they are installed when the module is installed (required configuration is, optional is different) and it is for example impossible to add a configurable field/filter to them as that doesn't exist yet at that point.

I'd prefer to have almost all config entities in standard, but I also see the argument that it breaks existing install profiles and other modules depending on that specific configuration.

I did feel quite strongly about the related media issue as it was quite a lot of config there that also created bundles and fields which then created tables. This is just a single file, no big deal to delete that in hook_install() if you want to have workflow(s) with different name(s) I think.

timmillwood’s picture

Issue tags: +Needs change record

I don't believe enforcing config on sites is right, which is why I had supported this issue.

I'm not to worried about breaking people's tests, they can just make use of the trait @chr.fritsch added. I've added a "Needs change record" tag to make sure we have a change record which notifies people about this change and the new trait to use.

I'm more concerned about existing install profiles which depend on the editorial workflow config. I think we'd need to study the backwards compatibility documentation to see if this is even a change we can make. If it's ok to make we can just note it in the change record and 8.6.0 release notes.

chr.fritsch’s picture

I agree with @timmillwood. Creating a change record makes total sense.

https://www.drupal.org/core/d8-bc-policy doesn't say anything about configuration objects and we did that change for media at a point where it was marked as "stable" as well. It doesn't matter if it's one config file or 10.

alexpott’s picture

+1 for a change record and +1 for the patch. We really should have very little config in core modules. Every piece of non-required configuration makes it more difficult to build products on top of Drupal. We should add something into the experimental module docs to say that a requirement to going stable is to move config to standard's optional directory.

alexpott’s picture

Issue tags: +8.6.0 release notes

Just tagging with the release notes mention tag in case this lands - so we don't forget.

alexpott’s picture

Also this is something release managers need to make a decision on.

chr.fritsch’s picture

sam152’s picture

Adding a related issue created by someone with the same problem.

sam152’s picture

Having read through this, I agree we have a need for this based on not being able to "override but delete". It immediately felt a bit like the "libraries-override" feature that themes have but for the relationship install profiles have to module dependencies, but I have no reason to believe something like that would be any better than simply moving non-essential configuration to standard. So all in all +1.

sam152’s picture

StatusFileSize
new1.7 KB
new42 KB

Rerolling this one. Given this one has been sitting in the queue for a while, my intention was to tentatively RTBC this and hope it landed on @catch's desk for sign off and commit. I did a quick git log of the standard profile "config" folder and couldn't find anything recent which indicated how these kind of issues usually play out.

I also tested this manually by installing minimal and verifying:

  • Content can be created after CM has been enabled, with no workflows present.
  • Content can be created after a new empty workflow has been created and assigned to a content type.
sam152’s picture

Status: Needs review » Reviewed & tested by the community

RTBC with the caveat @alexpott wanted a release manager to review it before commit.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 24: 2952307-14.patch, failed testing. View results

chr.fritsch’s picture

Status: Needs work » Reviewed & tested by the community

Testbot hickup

catch’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs release manager review

I think the change is fine. It might require modules to update, but the trait is there for tests, and copying one configuration file is not bad.

Committed 34637de and pushed to 8.6.x. Thanks!

  • catch committed 34637de on 8.6.x
    Issue #2952307 by chr.fritsch, Sam152, timmillwood: Move workflow config...

Status: Fixed » Closed (fixed)

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