Problem/Motivation

Purge module is very configurable and provides a number of different extension points and plugins.
The configuration for some of these parts are stored over multiple configuration files and in some cases logical separations of configuration are combined into a single config file.

Analogy

Imagine that views module stored the configuration for all the filters of all views in a single piece of configuration.
You'd have the configuration of logically many different things all mixed in together and it would become a bit of a nightmare to move these configurations around and work out what had changed etc.
If you wanted to get the config for an entire view, you'd have to consult many different config files and extract small snippets from each.

Examples in Purge

  • When adding and configuring a purger, this changes two bits of config, one is an specific piece of config for the purger, and another is a listing in purge.plugins.yml which matches up a purger plugin with its config and the order in the listing of purgers.
  • When changing the logging settings for Purge these settings are stored in a single config file: purge.logger_channels. I would argue that logically these settings should be held by the configuration of the individual things that will be sending the logs, rather than the thing doing the logging.

Decisions

A lot of the above comes down to where you draw the line on the logical separation of elements of the module. I suppose that if the logger really is the thing that should know about what possible channels it should print, then yeah, that config should be global. However, I'd argue that the config for an individual purger really should be a single file to facilitate sharing and tracking changes etc. Logically I don't think there really is a separation between the 'ID' of a purger, the 'Plugin' implementing it and the 'Config' for that instance of the purger. I would argue that should be a single logical element.

Proposed resolution

Re-work the purger plugins and config so that the logical separation outlined above is in config too.
I'd want to be able to deploy a single file of config to a site (or remove it) and for that purger functionality to be added (or removed) from the site. In the same way that I can do that with views etc.

Remaining tasks

Discuss (and then implement)

User interface changes

API changes

Data model changes

Comments

Steven Jones created an issue. See original summary.

nielsvm’s picture

Thank you for your issue.

I've read it and I'm not unsympathetic against the idea of reworking this into "deployable" units (except for the logger). However, this is a big change and one that will not only break the beta's big, it is also likely to introduce regressions which - at this stage - wouldn't be appreciated.

Please don't expect this for 8.x-3.0-beta5, but I might look into it further for 8.x-3.0-beta6. One thing is certain though, this wouldn't happen after the betas anymore.

Niels

Wim Leers’s picture

Priority: Normal » Major
Issue tags: +DX (Developer Experience)

This would affect long-term DX. Significantly so. So, bumping to Major. Tempted to mark it Critical, because whatever we end up shipping in RC/3.0 stable, is going to be in use for years.

I am no longer sufficiently familiar with Purge to write a useful/meaningful comment. But, nielsvm, if you want to, I'm happy to sit together with you and take a critical look at things. I think it's also in the long-term best interest in our mutual employer (Acquia).

Also note that this does NOT need to be painful for end users. I've worked on one the most complex config upgrade paths (#2308745: Remove rest.settings.yml, use rest_resource config entities) ever done so far in Drupal 8. It's a completely transparent change for end users.

Pasqualle’s picture

Issue tags: +Release blocker

The config structure must be changed..

mikelutz’s picture

The logger configs are causing me a headache as well, when dealing with different configuration environments. Particularly with config_split, and going from production back to development environments. I haven't had time to dig into the exact thing that's happening, but it seems like as the module is being disabled it writes the purge.logger_channels config in its death throes, and when I re-export, I get that file added into my config directory (which can then no longer be imported because the purge module isn't installed anymore).

I've been keeping it out of the projects' repositories with .gitignore, but I'm constantly deleting that file after backporting the production databases back to development.