Delete old pipelines
What does this MR do and why?
Allow users to set pipeline expiry times per project and delete expired pipelines.
This won't work effectively with millions of projects, but that's expected. We want to see how popular this feature is before investing more time into building a robust solution.
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.
How to set up and validate locally
- In rails console enable the experiment fully
Feature.enable(:ci_delete_old_pipelines)
- Visit any project CI/CD settings pages such as
http://127.0.0.1:3000/root/new-taggings/-/settings/ci_cd
- Fill in
Delete old pipelines
with a desired value - Wait till the cron worker is executed(11 minutes tops).
- Notice that 250 pipelines are gone.
Related to #498969
Edited by Marius Bobin