Commit e5c04dd7 authored by Nick Thomas's avatar Nick Thomas

Merge branch...

Merge branch 'cleanup-deployments_finder_implicitly_enforce_ordering_for_updated_at_filter-feature-flag' into 'master'

Clenup deployments_finder_implicitly_enforce_ordering feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!63617
parents 39de793c 7b8046ec
......@@ -136,7 +136,7 @@ class DeploymentsFinder
# Implicitly enforce the ordering when filtered by `updated_at` column for performance optimization.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/325627#note_552417509.
# 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)
end
......@@ -170,15 +170,6 @@ class DeploymentsFinder
params[:order_by].to_s == 'finished_at'
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
def preload_associations(scope)
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
it 'returns deployments with matched updated_at' do
is_expected.to match_array([deployment_2, deployment_1])
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
context 'when the environment name is specified' 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.second.to_sql).to eq(Deployment.arel_table[:id].asc.to_sql)
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
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