Stop using `build.expanded_environment_name`
Problem
When Ci::Build
gets an associated environment record, it works like
-
Expand environment name with secret variables
-
Find a relevant environment record with the expanded name This leaves us a significant ~performance issue. When users see a pipeline list via
../pipeline.json
endpoint, all build records have to expand variables at first in order to get the environment instance, in the result, it takes long time to forge the complete result and present it to users.
Since we changed the life cycle of Deployment
in %11.5, today we can find environment records much more efficient way without expanding scoped variables.
Proposal
- Avoid using
build.environment
- Avoid using
build.expanded_environment_name