Configuration diff
Creating pull request

Config Pull Request lets site builders and stakeholders turn Drupal configuration changes made in the admin UI into a pull request on GitHub or GitLab — with no command line and no Git knowledge.

It is built for two situations: people who need to export configuration but do not use Git on the command line, and sites where configuration is imported automatically on deployment, so UI changes are silently reverted unless someone commits them.

Works with Drupal 10, 11 and 12.

How it works

  1. Make your configuration changes in the admin UI as usual.
  2. Go to the Configuration synchronization page and open the Pull Request tab.
  3. Select the configuration you want to keep, confirm the repository, add a title and description, and submit.
  4. The module authenticates against the repository and opens the pull request. It can also notify developers.
  5. A code reviewer reviews, comments, accepts or rejects it.

Note: you do not need a local repository on your Live or Staging environment. This module pushes directly to the repository using APIs.

Case study

Some changes are needed to the Google Analytics configuration.

With this module:

  1. The Audience Dev team makes the tweaks on Staging.
  2. They go to the Config Pull Request page, select the configuration they want to keep, and issue a pull request.
  3. They create a ticket and assign it to the pull request.
  4. The developers review, test and merge.
  5. The ticket is deployed.
  6. The Audience Dev team gets exactly what they asked for.

Without it, the workflow is usually:

  1. Audience Dev requests changes to the Google Analytics module.
  2. A product manager writes a ticket — and not every requirement makes it in.
  3. A developer implements the ticket — and may misunderstand what was wanted.
  4. A tester checks it — and, being human, can miss what the developer missed.
  5. The ticket goes live.
  6. Audience Dev finds a problem.
  7. Back to step 1.

Pros

  • Speeds up exporting last minute or urgent changes
  • Lets stakeholders tweak configuration quickly and keep the changes
  • Helps site builders export configuration without the command line
  • Keeps the intent, the author and the discussion in the pull request

Supported repositories

  • GitHub, including GitHub Enterprise
  • GitLab, including self-managed GitLab
  • BitBucket (in development)

Installation

composer require 'drupal/config_pr:^3.0'

Enable the main module and the sub-module for your host. GitHub support works straight away. For GitLab, also require the client library:

composer require m4tthumphrey/php-gitlab-api:^12

Then add a repository access token on your user profile, and set the repository owner and name in the module settings. Each module and sub-module has a README listing its Composer dependencies.

Your repository needs at least one configuration export already committed before the first pull request can be created.

Security

Access tokens are stored per user rather than site-wide, so everyone acts as themselves on the repository and the audit trail stays accurate. Both forms are permission-controlled, and the token field is hidden from users without the relevant permission. Give tokens the narrowest scope that still allows creating branches and pull requests.

Similar modules

Config Patch — provides a framework for generating patch files for configuration, that is, the differences between active and sync configuration.

Screenshots

The Pull Request tab listing changed Drupal configuration, with checkboxes to include each item

Entering a title and description before creating the pull request

Demo

Watch the Config Pull Request demo video on YouTube

Contributing

Bug reports and feature requests are welcome in the issue queue.

Supporting organizations: 
Sponsored development
Sponsored development
Sponsored development
AttachmentSize
Config PR Youtube.jpg133.68 KB

Project information

Releases