Commit b4944c18 authored by Luke Duncalfe's avatar Luke Duncalfe

Remove design_management_todos_api feature flag

https://gitlab.com/gitlab-org/gitlab/issues/32492
parent 2e08c928
...@@ -18,16 +18,6 @@ module EE ...@@ -18,16 +18,6 @@ module EE
def authorize_can_read! def authorize_can_read!
authorize!(:read_epic, epic) authorize!(:read_epic, epic)
end end
override :find_todos
def find_todos
todos = super
return todos if ::Feature.enabled?(:design_management_todos_api, default_enabled: true)
# Exclude Design Todos if the feature is disabled
todos.where.not(target_type: ::DesignManagement::Design.name) # rubocop: disable CodeReuse/ActiveRecord
end
end end
resource :groups, requirements: ::API::API::NAMESPACE_OR_PROJECT_REQUIREMENTS do resource :groups, requirements: ::API::API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
......
...@@ -75,39 +75,24 @@ describe API::Todos do ...@@ -75,39 +75,24 @@ describe API::Todos do
get api('/todos', personal_access_token: pat) get api('/todos', personal_access_token: pat)
end end
context 'when the feature is enabled' do before do
before do api_request
api_request end
end
it_behaves_like 'an endpoint that responds with success'
it 'avoids N+1 queries', :request_store do it_behaves_like 'an endpoint that responds with success'
control = ActiveRecord::QueryRecorder.new { api_request }
create_todo_for_mentioned_in_design it 'avoids N+1 queries', :request_store do
control = ActiveRecord::QueryRecorder.new { api_request }
expect { api_request }.not_to exceed_query_limit(control) create_todo_for_mentioned_in_design
end
it 'includes the Design Todo in the response' do expect { api_request }.not_to exceed_query_limit(control)
expect(json_response).to include(
a_hash_including('id' => design_todo.id)
)
end
end end
context 'when the feature is disabled' do it 'includes the Design Todo in the response' do
before do expect(json_response).to include(
stub_feature_flags(design_management_todos_api: false) a_hash_including('id' => design_todo.id)
api_request )
end
it_behaves_like 'an endpoint that responds with success'
it 'does not include the Design Todo in the response' do
expect(json_response).to be_empty
end
end end
end end
end end
......
...@@ -13,13 +13,6 @@ module API ...@@ -13,13 +13,6 @@ module API
'issues' => ->(iid) { find_project_issue(iid) } 'issues' => ->(iid) { find_project_issue(iid) }
}.freeze }.freeze
helpers do
# EE::API::Todos would override this method
def find_todos
TodosFinder.new(current_user, params).execute
end
end
params do params do
requires :id, type: String, desc: 'The ID of a project' requires :id, type: String, desc: 'The ID of a project'
end end
...@@ -48,6 +41,10 @@ module API ...@@ -48,6 +41,10 @@ module API
resource :todos do resource :todos do
helpers do helpers do
def find_todos
TodosFinder.new(current_user, params).execute
end
def issuable_and_awardable?(type) def issuable_and_awardable?(type)
obj_type = Object.const_get(type, false) obj_type = Object.const_get(type, 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