Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

config_patch

386 sites Security covered
View on drupal.org

With strict configuration management, config always moves from development to production as part of an automated deployment process. But this ideal can fall apart quickly in the real world. If a sitebuilder makes a quick configuration change on production, how do we make sure this change is propagated back to the source repository and not overwritten by the next deployment?

This module provides a framework for creating and applying patches for config (the differences between active configuration and sync configuration). This allows sitebuilders to make changes to configuration in the UI and push a button to create a patch which may then be committed back to source. The framework is extensible, so additional output plugins may provide integrations with e.g., cloud source control providers. For instance, submodules listed below can be used to create PRs on Github or MRs on Gitlab.

Since patches reference config yml file paths, the base path of these files is configurable. If your synchronized config is stored in drupal/config in your source repo, you might configure drupal/config as your base config path in config_patch. If on the other hand, your various repositories and environments all follow the same Drupal path structure, insert something like the following into settings.php for zero module configuration:

$config['config_patch.settings']['config_base_path'] = 'web/' . $settings['config_sync_directory'];

(below where config_sync directory has been defined).

When installed, config_patch provides an additional tab Patch on the admin config synchronization pages listing config that's out of sync and providing a button to output the patch in various forms. The action of the button is controlled by the currently selected output plugin.

A helpful widget will also appear in the toolbar revealing the number of config items differing between sync and active storage. Clicking the widget will take you to the config sync Patch tab.

Available output plugins

  • Text: (included with config_patch) provides text output of a unified diff patch
  • Gitlab: provides submission to Gitlab repositories using MR-by-email functionality.
  • Gitlab API: create an MR in Gitlab directly using their API
  • Gitea: create an PR on Gitea
  • Azure API: push config to any Azure instance by using the Azure DevOps API.
  • Github API: create a PR on Github

Similar modules

  • Config Partial Export: export a tarball of config ymls that differ between sync and active
  • Config PR: very similar to this module; make a PR in Github, Gitlab, or Bitbucket based on a config patchset

Works with

  • Config Ignore: config_patch will respect config_ignore settings

Drush integration

drush config:patch PLUGIN_ID  # create a patch via a plugin
drush config:patch:list       # list files that have changed

If you have a drush alias (or similar way to run drush on a remote site), you can easily apply config changes from that site to your local repo:

drush cpatch text|patch -p1

Activity

Total releases
3
First release
Feb 2025
Latest release
9 months ago
Release cadence
63 days
Stability
100% stable

Release Timeline

Releases

Version Type Release date
3.0.6 Stable Jun 23, 2025
3.0.5 Stable Feb 25, 2025
3.0.4 Stable Feb 17, 2025