Verifying your Drupal site’s configuration against changes from dependency updates

Matt Glaman
4 min readFeb 12, 2024

Previously, I wrote about leveraging Dependabot to automate dependency updates for my Drupal projects. Automating dependency updates saves a lot of time. However, Drupal core or contributed modules may perform updates that modify the configuration state of your Drupal site that needs to be re-exported. A standard continuous integration pipeline that only performs code linting and tests will miss these changes. For my projects, I have a job that runs the update process for the Drupal site and fails if the configuration has been modified at runtime by these updates. This lets me know I have to perform a manual action locally to update the exported configuration.

I primarily use GitHub Actions nowadays, and this post will walk through the steps in that format. But it is easily translatable to any CI system. I’ll provide a more generic alternative example at the end.

Defining the config_verification job

First, we define the basics of the job.

jobs:
config_verification:
name: Verify configuration changes
runs-on: ubuntu-latest

I’m adding a MySQL service to the job so that I can install the Drupal site.

services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: ci
ports:
- 3306
options: --health-cmd="mysqladmin ping"

--

--

Matt Glaman
Matt Glaman

Written by Matt Glaman

PHP software engineer, open source contributor, and speaker

No responses yet