Commit bf965664 authored by Sean McGivern's avatar Sean McGivern

Merge branch '345921-remove-optimized-issue-neighbor-ff' into 'master'

Optimize query for issue neighbors

See merge request gitlab-org/gitlab!78443
parents 1a6eceff 1833947a
...@@ -233,8 +233,6 @@ class Issue < ApplicationRecord ...@@ -233,8 +233,6 @@ class Issue < ApplicationRecord
end end
def next_object_by_relative_position(ignoring: nil, order: :asc) def next_object_by_relative_position(ignoring: nil, order: :asc)
return super unless Feature.enabled?(:optimized_issue_neighbor_queries, project, default_enabled: :yaml)
array_mapping_scope = -> (id_expression) do array_mapping_scope = -> (id_expression) do
relation = Issue.where(Issue.arel_table[:project_id].eq(id_expression)) relation = Issue.where(Issue.arel_table[:project_id].eq(id_expression))
......
---
name: optimized_issue_neighbor_queries
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/76073
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/345921
milestone: '14.6'
type: development
group: group::project management
default_enabled: false
...@@ -1328,29 +1328,11 @@ RSpec.describe Issue do ...@@ -1328,29 +1328,11 @@ RSpec.describe Issue do
let_it_be(:issue1) { create(:issue, project: project, relative_position: nil) } let_it_be(:issue1) { create(:issue, project: project, relative_position: nil) }
let_it_be(:issue2) { create(:issue, project: project, relative_position: nil) } let_it_be(:issue2) { create(:issue, project: project, relative_position: nil) }
context 'when optimized_issue_neighbor_queries is enabled' do
before do
stub_feature_flags(optimized_issue_neighbor_queries: true)
end
it_behaves_like "a class that supports relative positioning" do
let_it_be(:project) { reusable_project }
let(:factory) { :issue }
let(:default_params) { { project: project } }
end
end
context 'when optimized_issue_neighbor_queries is disabled' do
before do
stub_feature_flags(optimized_issue_neighbor_queries: false)
end
it_behaves_like "a class that supports relative positioning" do it_behaves_like "a class that supports relative positioning" do
let_it_be(:project) { reusable_project } let_it_be(:project) { reusable_project }
let(:factory) { :issue } let(:factory) { :issue }
let(:default_params) { { project: project } } let(:default_params) { { project: project } }
end end
end
it 'is not blocked for repositioning by default' do it 'is not blocked for repositioning by default' do
expect(issue1.blocked_for_repositioning?).to eq(false) expect(issue1.blocked_for_repositioning?).to eq(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