Introduce Ci Persistent Rules to manage when to save incomplete pipelines
What does this MR do?
As outlined in #199397, there are some inconsistencies on save_on_errors
parameter.
This MR improves this behavior by introducing Chain::PersistentRules
domain. It checks a pipeline.source
(i.e. trigger event) and evaluate if it can be persisted on errors or skips.
By default, Chain::PersistentRules::Default
is chosen, and in this rule, all of the incomplete pipelines are persisted.
And you can extend the rule for a specific source
, for example, we don't persist if it's schedule
(pipeline schedule) source, so we define Chain::PersistentRules::Schedule
to override the default rule.
This allows us to resolve an issue like #30111 (closed) more flexibility and user-friendly. Chain::PersistentRules::MergeRequestEvent
defines that pipelines should be persisted on any errors except a config error. And always, skipped pipelines are recorded.
Closes #199397
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team