Investigate transaction usage in Deployments::UpdateEnvironmentService
Problem
Deployments::UpdateEnvironmentService runs via a worker after a deployment job completes, and updates various attributes on the associated environment. This logic is wrapped in an explicit transaction, and includes complex logic to generate the updated environment attributes (for example, expanding CI variables). This is potentially problematic because we want transactions to be as short as possible.
Proposal
Investigate if it is possible to move as much logic as possible out of the transaction, or alternatively remove the transaction entirely.
Edited by 🤖 GitLab Bot 🤖