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
b173add5
Commit
b173add5
authored
Jan 13, 2022
by
Bala Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove FF custom_preloader_for_deployments
Changelog: changed
parent
c7673c25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
32 deletions
+5
-32
app/serializers/environment_serializer.rb
app/serializers/environment_serializer.rb
+5
-9
config/feature_flags/development/custom_preloader_for_deployments.yml
...re_flags/development/custom_preloader_for_deployments.yml
+0
-8
spec/serializers/environment_serializer_spec.rb
spec/serializers/environment_serializer_spec.rb
+0
-15
No files found.
app/serializers/environment_serializer.rb
View file @
b173add5
...
...
@@ -52,17 +52,13 @@ class EnvironmentSerializer < BaseSerializer
end
def
batch_load
(
resource
)
if
::
Feature
.
enabled?
(
:custom_preloader_for_deployments
,
default_enabled: :yaml
)
resource
=
resource
.
preload
(
environment_associations
.
except
(
:last_deployment
,
:upcoming_deployment
))
resource
=
resource
.
preload
(
environment_associations
.
except
(
:last_deployment
,
:upcoming_deployment
))
Preloaders
::
Environments
::
DeploymentPreloader
.
new
(
resource
)
.
execute_with_union
(
:last_deployment
,
deployment_associations
)
Preloaders
::
Environments
::
DeploymentPreloader
.
new
(
resource
)
.
execute_with_union
(
:last_deployment
,
deployment_associations
)
Preloaders
::
Environments
::
DeploymentPreloader
.
new
(
resource
)
.
execute_with_union
(
:upcoming_deployment
,
deployment_associations
)
else
resource
=
resource
.
preload
(
environment_associations
)
end
Preloaders
::
Environments
::
DeploymentPreloader
.
new
(
resource
)
.
execute_with_union
(
:upcoming_deployment
,
deployment_associations
)
resource
.
all
.
to_a
.
tap
do
|
environments
|
environments
.
each
do
|
environment
|
...
...
config/feature_flags/development/custom_preloader_for_deployments.yml
deleted
100644 → 0
View file @
c7673c25
---
name
:
custom_preloader_for_deployments
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75767
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/348289
milestone
:
'
14.7'
type
:
development
group
:
group::release
default_enabled
:
false
spec/serializers/environment_serializer_spec.rb
View file @
b173add5
...
...
@@ -204,21 +204,6 @@ RSpec.describe EnvironmentSerializer do
json
end
# Including for test coverage pipeline failure, remove along with feature flag.
context
'when custom preload feature is disabled'
do
before
do
Feature
.
disable
(
:custom_preloader_for_deployments
)
end
it
'avoids N+1 database queries'
do
control_count
=
ActiveRecord
::
QueryRecorder
.
new
{
json
}.
count
create_environment_with_associations
(
project
)
expect
{
json
}.
not_to
exceed_query_limit
(
control_count
)
end
end
end
def
create_environment_with_associations
(
project
)
...
...
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