Add Xray Audit insight to detect configuration mismatches

Created on 23 July 2025, 4 days ago

Problem/Motivation

Currently, there is no automated check within the Xray Audit module to detect discrepancies between site configuration files and their corresponding schema.yml definitions provided by modules. This can lead to issues where, after a module update or configuration schema change, the actual configuration stored in the system or within config splits becomes outdated, missing required keys, or no longer adheres to the defined schema.

This situation can cause unexpected errors, broken features, or difficulties during configuration imports/exports, especially in environments using Config Split for environment-specific overrides.

Proposed resolution

  • Retrieve all active config splits.
  • For each config split:
    • Load its configuration files.
    • Compare each configuration object against its schema.yml definition.
  • Identify:
    • Missing required keys.
    • Structural mismatches (e.g., wrong data types).
  • Initially, the feature will only support complete config splits. Handling partial splits and custom patches can be considered in a later phase.
  • Display an insight indicating which configurations are out of alignment.
  • Note: it is important point is to consider performance in advanced multisite environments.

Remaining tasks

  • Analyze how to load schema definitions programmatically for given config objects.
  • Implement the logic to compare config objects with their schema.
  • Integrate the comparison results into Xray Audit as a new insight.
  • Write automated tests for the new feature.
  • Document the functionality and usage.
Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇪🇸Spain lpeidro Madrid

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024