Skip to content

Draft: Resolve "Support conditional includes with changes like `include:rules:changes`"

Leaminn Ma requested to merge support-includes-rules-changes into master

Closed in favour of 2 separate MRs:

Refactor CI External::Rules to utilize Entry::I... (!129145 - merged)

Support CI config `include:rules:changes` (!129866 - merged)


What does this MR do and why?

This MR accomplishes 2 objectives:

  1. Refactored Config::External::Rules class:

Currently this class contains its own validation logic for the includes:rules config. However, it is redundant since we already have a validatable DSL module that performs these validations for us via the Entry::Include::Rules class. Moreover, the Entry classes contain the logic for formatting the config values as needed prior to fabricating the rules list.

As such, Config::External::Rules was refactored to utilize the existing functionality in Entry::Include::Rules. The validations are executed upon running .compose!. This also enables us to easily support new includes:rules subkeys in the future, and it produces more precise validation error messages.

  1. With the refactor from (1), we can now simply update Entry::Include::Rules::Rule with the changes entry definition. This enables the full use of rules:changes within include.

Resolves #342209 (closed)

How to set up and validate locally

TBD

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #342209 (closed)

Edited by Leaminn Ma

Merge request reports