Commit f8aee736 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'remove-avoid-cross-joins-environment-mr' into 'master'

Removes cross-joins FF in MergeRequest#environments

See merge request gitlab-org/gitlab!72884
parents 175d0cc9 48359ce1
......@@ -1409,7 +1409,6 @@ class MergeRequest < ApplicationRecord
def environments
return Environment.none unless actual_head_pipeline&.merge_request?
if ::Feature.enabled?(:avoid_cross_joins_environments_merge_request, default_enabled: :yaml)
build_for_actual_head_pipeline = Ci::Build.latest.where(pipeline: actual_head_pipeline)
environments = build_for_actual_head_pipeline.joins(:metadata)
......@@ -1419,9 +1418,6 @@ class MergeRequest < ApplicationRecord
.pluck(:expanded_environment_name)
Environment.where(project: project, name: environments)
else
actual_head_pipeline.environments
end
end
def fetch_ref!
......
---
name: avoid_cross_joins_environments_merge_request
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/71591
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/343236
milestone: '14.5'
type: development
group: group::sharding
default_enabled: false
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment