DecisionConfirm Drupal site configuration is always in a default state

accepted

Configuration should never be in an overridden state after configuration import(s) have been completed.

Table Of Contents

When there is overridden configuration it indicates that code and database are not in sync. This creates confusion as to if a branch is safe to merge or a release is safe to deploy.

Overridden configuration can be caused by module updates that alter existing configuration. These are easily overlooked when using an automated package updater like Dependabot or Violinist.io.

Decision

After running the standard Drupal build steps we should follow up with drush config:status and check the results of that command for No differences. If differences are found we should fail the build.

Example: [[ $(vendor/bin/drush config:status --format=json --state=Different) == '[]' ]] || exit 1

Consequences

When configuration status checks fail, developers will need to determine how to resolve the error, which often might be as simple as re-exporting configuration and committing the changes.

For example:

  • If a module was updated and introduced new configuration, a developer will need to re-export configuration to capture the changes.
  • If a developer missed adding configuration changes to their pull request, they will need to re-create and export the configuration locally and push again.

Andrew Berry, David Burns, Marcos Cano, Mateu Aguiló Bosch, Matthew Tift

Decided on