Cache CI variables used for rules evaluation
What does this MR do and why?
I've imported https://gitlab.com/gitlab-org/gitlab/ locally and used request profiling to figure out some slow points during pipeline creation.
It looks like we're building the variables collection hundreds of times when creating the pipelines(This might explain #343225 (comment 706397676)):
- Cache predefined project variables:
-
Ci::Pipeline#feeze_period?
seems to take of the time from predefined pipeline variables, so we cache it and also cache some of the variables.
-
Contextable#secret_group_variables
seems to take most of the time now, but it's already using some sort of memory caching:
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Marius Bobin