Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Config Patch

377 sites Security covered Drupal 10–11
View on drupal.org

This module helps manage configuration changes made directly on a live site by allowing you to create patches for those differences. These patches can then be committed back to your code repository, ensuring your configuration stays in sync. It integrates with various code hosting services like GitHub and GitLab for easier collaboration.

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

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

1 tracked project depends on this one

Activity

Tracked releases
3
Tracked since
Feb 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 3
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
3.0.6 Stable 10–11 Jun 23, 2025
3.0.5 Stable 10–11 Feb 25, 2025
3.0.4 Stable 10–11 Feb 17, 2025