Skip to content

Cache CI variables used for rules evaluation

Marius Bobin requested to merge ci-cache-predefined-variables into master

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)):

  1. Cache predefined project variables:

image

  1. 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.

image

  1. Contextable#secret_group_variables seems to take most of the time now, but it's already using some sort of memory caching:

image

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.

Edited by Marius Bobin

Merge request reports

Loading