Backend: Extract predefined variables builder from pipeline classes
Description
We want to optimize the workflow of calculating build variables, as per #213560 (closed) and #22520 (closed).
In order to make it easier to optimize calculating build variables, we might want to extract variables builder, to a separate class / module. This will make it easier to profile this code, and find deficiencies.
Proposal
Pipeline predefined variables still need to be moved into its separate class / module.
Expected improvements:
- we should have the logic to compute CI variables in one place
- easy to memoize variables for pipelines across multiple builds
- easy to profile and make further improvements when needed
Additional Context
Details can be found here
Edited by Laura Montemayor