Commit f2b82762 authored by Igor Drozdov's avatar Igor Drozdov

Put target projects calculation behind FF

We received performance regression when we introduced it
Let's put it behind the FF until we solve this problem
parent 9c471988
......@@ -135,6 +135,8 @@ module CommitsHelper
end
def cherry_pick_projects_data(project)
return [] unless Feature.enabled?(:pick_into_project, project, default_enabled: :yaml)
target_projects(project).map do |project|
{
id: project.id.to_s,
......
......@@ -257,5 +257,15 @@ RSpec.describe CommitsHelper do
{ id: forked_project.id.to_s, name: forked_project.full_path, refsUrl: refs_project_path(forked_project) }
])
end
context 'pick_into_project is disabled' do
before do
stub_feature_flags(pick_into_project: false)
end
it 'does not calculate target projects' do
expect(helper.cherry_pick_projects_data(project)).to eq([])
end
end
end
end
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