Extend job archival mechanism to the whole pipeline
What does this MR do and why?
This merge request extends the job archival mechanism to the whole pipeline. It introduces the following changes:
- Adds an
archived?method to theCi::Pipelinemodel to check if a pipeline is archived based on thearchive_builds_in_secondssetting. - Updates the
archived?method in theCi::BuildandCommitStatusmodels to consider the pipeline's archived status. - Updates the pipeline policy to prevent
pipeline_updatepermission if the pipeline is archived. - Adds checks in various services to prevent modifications to archived pipelines following defense-in-depth
These changes are implemented to address the issue of long-running pipelines becoming stale and potentially causing performance issues. By extending the archival mechanism to the entire pipeline, we ensure that old pipelines are properly archived and cannot be modified, improving system performance and data consistency.
This implementation also maintains backwards compatibility by creating new pipelines for commit statuses when the existing pipeline is archived, instead of returning an error.
Related to #271614 (closed)
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
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.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
Related to #271614 (closed)