Commit 7b8046ec authored by Shinya Maeda's avatar Shinya Maeda

Clenup deployments_finder_implicitly_enforce_ordering feature flag

This commit cleans up the
`deployments_finder_implicitly_enforce_ordering_for_updated_at_filter`
feature flag which has already been enabled by default.

Changelog: other
parent d4eaa4a8
...@@ -136,7 +136,7 @@ class DeploymentsFinder ...@@ -136,7 +136,7 @@ class DeploymentsFinder
# Implicitly enforce the ordering when filtered by `updated_at` column for performance optimization. # Implicitly enforce the ordering when filtered by `updated_at` column for performance optimization.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/325627#note_552417509. # See https://gitlab.com/gitlab-org/gitlab/-/issues/325627#note_552417509.
# We remove this in https://gitlab.com/gitlab-org/gitlab/-/issues/328500. # We remove this in https://gitlab.com/gitlab-org/gitlab/-/issues/328500.
if filter_by_updated_at? && implicitly_enforce_ordering_for_updated_at_filter? if filter_by_updated_at?
sort_params.replace('updated_at' => sort_direction) sort_params.replace('updated_at' => sort_direction)
end end
...@@ -170,15 +170,6 @@ class DeploymentsFinder ...@@ -170,15 +170,6 @@ class DeploymentsFinder
params[:order_by].to_s == 'finished_at' params[:order_by].to_s == 'finished_at'
end end
def implicitly_enforce_ordering_for_updated_at_filter?
return false unless params[:project].present?
::Feature.enabled?(
:deployments_finder_implicitly_enforce_ordering_for_updated_at_filter,
params[:project],
default_enabled: :yaml)
end
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def preload_associations(scope) def preload_associations(scope)
scope.includes( scope.includes(
......
---
name: deployments_finder_implicitly_enforce_ordering_for_updated_at_filter
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59771
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/329286
milestone: '13.12'
type: development
group: group::release
default_enabled: true
...@@ -81,16 +81,6 @@ RSpec.describe DeploymentsFinder do ...@@ -81,16 +81,6 @@ RSpec.describe DeploymentsFinder do
it 'returns deployments with matched updated_at' do it 'returns deployments with matched updated_at' do
is_expected.to match_array([deployment_2, deployment_1]) is_expected.to match_array([deployment_2, deployment_1])
end end
context 'when deployments_finder_implicitly_enforce_ordering_for_updated_at_filter feature flag is disabled' do
before do
stub_feature_flags(deployments_finder_implicitly_enforce_ordering_for_updated_at_filter: false)
end
it 'returns deployments with matched updated_at' do
is_expected.to match_array([deployment_1, deployment_2])
end
end
end end
context 'when the environment name is specified' do context 'when the environment name is specified' do
...@@ -244,20 +234,6 @@ RSpec.describe DeploymentsFinder do ...@@ -244,20 +234,6 @@ RSpec.describe DeploymentsFinder do
expect(subject.order_values.first.to_sql).to eq(Deployment.arel_table[:updated_at].asc.to_sql) expect(subject.order_values.first.to_sql).to eq(Deployment.arel_table[:updated_at].asc.to_sql)
expect(subject.order_values.second.to_sql).to eq(Deployment.arel_table[:id].asc.to_sql) expect(subject.order_values.second.to_sql).to eq(Deployment.arel_table[:id].asc.to_sql)
end end
context 'when deployments_finder_implicitly_enforce_ordering_for_updated_at_filter feature flag is disabled' do
before do
stub_feature_flags(deployments_finder_implicitly_enforce_ordering_for_updated_at_filter: false)
end
it 'sorts by only one column' do
expect(subject.order_values.size).to eq(1)
end
it 'sorts by `id`' do
expect(subject.order_values.first.to_sql).to eq(Deployment.arel_table[:id].asc.to_sql)
end
end
end end
context 'when filtering by finished time' do context 'when filtering by finished time' do
......
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