Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
48359ce1
Commit
48359ce1
authored
Oct 22, 2021
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes cross-joins FF in MergeRequest#environements
Changelog: changed
parent
5ead4e2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
19 deletions
+7
-19
app/models/merge_request.rb
app/models/merge_request.rb
+7
-11
config/feature_flags/development/avoid_cross_joins_environments_merge_request.yml
...elopment/avoid_cross_joins_environments_merge_request.yml
+0
-8
No files found.
app/models/merge_request.rb
View file @
48359ce1
...
...
@@ -1409,19 +1409,15 @@ 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
)
build_for_actual_head_pipeline
=
Ci
::
Build
.
latest
.
where
(
pipeline:
actual_head_pipeline
)
environments
=
build_for_actual_head_pipeline
.
joins
(
:metadata
)
.
where
.
not
(
'ci_builds_metadata.expanded_environment_name'
=>
nil
)
.
distinct
(
'ci_builds_metadata.expanded_environment_name'
)
.
limit
(
100
)
.
pluck
(
:expanded_environment_name
)
environments
=
build_for_actual_head_pipeline
.
joins
(
:metadata
)
.
where
.
not
(
'ci_builds_metadata.expanded_environment_name'
=>
nil
)
.
distinct
(
'ci_builds_metadata.expanded_environment_name'
)
.
limit
(
100
)
.
pluck
(
:expanded_environment_name
)
Environment
.
where
(
project:
project
,
name:
environments
)
else
actual_head_pipeline
.
environments
end
Environment
.
where
(
project:
project
,
name:
environments
)
end
def
fetch_ref!
...
...
config/feature_flags/development/avoid_cross_joins_environments_merge_request.yml
deleted
100644 → 0
View file @
5ead4e2f
---
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment