Skip to content

Optimize ListConfigVariablesService (prefill variables service) (retry)

What does this MR do and why?

This is the second step of optimizing Ci::ListConfigVariablesService.

Changing parameters in an calculate_reactive_cache method is like changing parameters in a Sidekiq worker. So, we need to follow the same rules;

Step Status
Add additional parameter to ListConfigVariables... (!163635 - merged)
Optimize ListConfigVariablesService (prefill va... (!163880 - merged)
Remove the default value TODO

Summary

Now, the main reason for this change:

We recently added two changes to this service;

  1. cd811a5a We started passing verify_project_sha to YamlProcessor to check the passed ref to avoid malicious sha's. (the ref parameter accepts a commit SHA as a value)

  2. d273ad95 We started passing the ref name to YamlProcessor when fetching prefill variables. The reason was this; When using $CI_COMMIT_REF_NAME in include:rules, the correct jobs but the wrong prefilled variables were included because $CI_COMMIT_REF_NAME were not available.

For 1; we first check whether the passed ref parameter is actually a ref in the project. If so, we don't need to verify the calculated sha.

For 2; we don't have to use RefFinder because we already have ref.

Related to #468827

Expected result

I am expecting that the duration of Ci::ListConfigVariablesService will be decreased.

https://log.gprd.gitlab.net/app/r/s/71r3H

Screenshot_2024-08-08_at_10.41.54

xx

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.

Edited by Furkan Ayhan

Merge request reports

Loading