Batch-load environments in EE pipelines
What does this MR do?
This fixes an N+1 in PipelineSerializer
(and possibly elsewhere) for EE clients that use protected environments.
Previously, this would re-load the environment
for every build being rendered. We realized that instead we can just make a call to Build#expanded_environment_name
, which does not incur a round-trip to the database.
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Related to #321788
Edited by Matthias Käppler