Article

Config Management (CMI): move configuration through Git

CPalius core now ships CMI: it exports settings and field definitions as deterministic YAML. cp:config export | status | import.

· ZemoCA · 1 min read

The problem Drupal's CMI solves is clear: if configuration lives in the database, you have to sync dev and prod by hand. CPalius now moves configuration into code.

Provider model

ConfigProviderInterface defines multi-document export / diff / import. The first two providers:

  • SettingsConfigProvider — settings.yaml. Upsert only; translatable settings are written as a locale map and comparison is semantic (JSON escaping differences do not produce drift).
  • FieldConfigProvider — field.{bundle}.yaml. Authoritative: it removes fields that exist only in the DB and not in YAML.

Deterministic YAML

ConfigFile applies a recursive ksort and writes atomically; the same configuration always produces a byte-for-byte identical file, so git diff stays clean.

Commands

cp:config export writes the files. cp:config status shows drift. cp:config import applies inside a single transaction — a dry-run without --force. Providers only persist, never flush; import is all-or-nothing.

The first export produced cp-content/config/sync/settings.yaml. Roles and workflows were already in YAML; now settings and fields are too.

Comments (0)

No comments yet. Be the first to write one.

Leave a comment

Your comment will appear after it is reviewed.

Related Posts