task: #3621480 Keep the Ultimate Cron job configuration removed from the recipes as optional config in the profile

Issue: #3621480

Follow-up on the same issue. !81 (merged) kept the packages; this keeps the configuration that went with one of them.

Removing Ultimate Cron from Varbase Performance Base (#3621493) and Varbase Search Base (#3621494) deleted seventeen ultimate_cron.job.* config files, because a recipe imports everything in its config/ directory and those imports would fail once the module is gone. Nothing else now ships them, so the tuned schedules, lock timeouts and log retention would be lost.

What changed

Added the seventeen deleted files to config/optional/, byte-identical to what was removed:

  • sixteen from Varbase Performance Base: captcha, content_lock_timeout, field, file, honeypot, layout_builder, node, password_policy, persistent_login, redirect_404, scheduler, simple_sitemap, system, ultimate_cron, update, webform
  • one from Varbase Search Base: search_api

Why config/optional and not config/install

config/install is created unconditionally at install time, which would fail: Ultimate Cron is not installed, so the ultimate_cron_job entity type does not exist.

config/optional is the opposite. ConfigInstaller::installOptionalConfig() filters the list down to config whose entity type resolves, with the comment "is a configuration entity (this also excludes config that has an implicit dependency on modules that are not yet installed)", and then drops anything whose declared dependencies are unmet. So while Ultimate Cron is absent these files do nothing at all, and the moment somebody enables Ultimate Cron on a Varbase site, Drupal creates every job whose own module is present.

That is the behaviour we want: nothing changes for a site today, and the configuration comes back by itself when the module does.

The files are unmodified, including that they do not name ultimate_cron in dependencies.module. A config entity does not declare its own provider; the provider comes from the ultimate_cron.job. prefix, which is exactly the implicit dependency the installer filters on.

Checkpoints

  • Addition/Change/Update/Fix
  • Testing to ensure no regression
  • Reviewed by a human
  • Code review by maintainers
  • Release

This work was done with the help of AI, and reviewed by a human. Per the Drupal AI policy.

Edited by Rajab Natshah

Merge request reports

Loading