Refactor metadata usage in CI Rules entry
What does this MR do and why?
Entry::Rules
is shared between the Workflow
and Processable
entries.
Normally, we support only the if
, changes
, exists
, when
, and variables
keys in workflow:rules
. Yet, we accidentally allow start_in
,
allow_failure
, and needs
.
In this change, we don't aim to fix this, this will be done in Eliminate using `allowed_when` and `allow_keys` (#436473).
In this change, we aim to simplify and highlight this behavior by
adding allowed_keys
in the Rules
usage.
Also, in validations, we start using only allowed_when
and allowed_keys
,
we don't use the class constants anymore.
This step will help implementing workflow:rules:auto_cancel (#436467 - closed).
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.