Commit 460c1eb7 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'ss/fix-wip-limits-ff-issue' into 'master'

Convert all FF calls to beta_feature_available?

See merge request gitlab-org/gitlab!21518
parents 79959871 b7ba25a6
...@@ -9,7 +9,7 @@ module BoardsActions ...@@ -9,7 +9,7 @@ module BoardsActions
before_action :boards, only: :index before_action :boards, only: :index
before_action :board, only: :show before_action :board, only: :show
before_action :push_wip_limits, only: :index before_action :push_wip_limits, only: [:index, :show]
end end
def index def index
......
...@@ -11,9 +11,7 @@ module EE ...@@ -11,9 +11,7 @@ module EE
private private
def push_wip_limits def push_wip_limits
if parent.feature_available?(:wip_limits) push_frontend_feature_flag(:wip_limits, parent)
push_frontend_feature_flag(:wip_limits)
end
end end
end end
end end
...@@ -36,7 +36,7 @@ module EE ...@@ -36,7 +36,7 @@ module EE
private private
def wip_limits_available? def wip_limits_available?
board_parent.feature_available?(:wip_limits) board_parent.beta_feature_available?(:wip_limits)
end end
end end
end end
......
...@@ -38,7 +38,7 @@ module EE ...@@ -38,7 +38,7 @@ module EE
def wip_limits_available? def wip_limits_available?
strong_memoize(:wip_limits_available) do strong_memoize(:wip_limits_available) do
board.resource_parent.feature_available?(:wip_limits) board.resource_parent.beta_feature_available?(:wip_limits)
end end
end end
......
...@@ -69,7 +69,7 @@ module EE ...@@ -69,7 +69,7 @@ module EE
end end
def wip_limits_available? def wip_limits_available?
parent.feature_available?(:wip_limits) parent.beta_feature_available?(:wip_limits)
end end
end end
end end
......
- if current_board_parent.feature_available?(:wip_limits) - if current_board_parent.beta_feature_available?(:wip_limits)
%gl-button.no-drag.rounded-right{ type: "button", %gl-button.no-drag.rounded-right{ type: "button",
"v-if" => "isSettingsShown", "v-if" => "isSettingsShown",
"aria-label" => _("List Settings"), "aria-label" => _("List Settings"),
......
...@@ -70,10 +70,6 @@ describe Boards::ListsController do ...@@ -70,10 +70,6 @@ describe Boards::ListsController do
let(:label) { create(:group_label, group: group, name: 'Development') } let(:label) { create(:group_label, group: group, name: 'Development') }
context 'with licensed wip limits' do context 'with licensed wip limits' do
before do
stub_licensed_features(wip_limits: true)
end
it 'returns the created list' do it 'returns the created list' do
create_board_list user: user, board: board, label_id: label.id, params: { max_issue_count: 2 } create_board_list user: user, board: board, label_id: label.id, params: { max_issue_count: 2 }
...@@ -84,7 +80,7 @@ describe Boards::ListsController do ...@@ -84,7 +80,7 @@ describe Boards::ListsController do
context 'without licensed wip limits' do context 'without licensed wip limits' do
before do before do
stub_licensed_features(wip_limits: false) stub_feature_flags(wip_limits: false)
end end
it 'ignores max issue count' do it 'ignores max issue count' do
...@@ -100,10 +96,6 @@ describe Boards::ListsController do ...@@ -100,10 +96,6 @@ describe Boards::ListsController do
let(:label) { create(:group_label, group: group, name: 'Development') } let(:label) { create(:group_label, group: group, name: 'Development') }
context 'with licensed wip limits' do context 'with licensed wip limits' do
before do
stub_licensed_features(wip_limits: true)
end
it 'returns the created list' do it 'returns the created list' do
create_board_list user: user, board: board, label_id: label.id, params: { max_issue_weight: 3 } create_board_list user: user, board: board, label_id: label.id, params: { max_issue_weight: 3 }
...@@ -114,7 +106,7 @@ describe Boards::ListsController do ...@@ -114,7 +106,7 @@ describe Boards::ListsController do
context 'without licensed wip limits' do context 'without licensed wip limits' do
before do before do
stub_licensed_features(wip_limits: false) stub_feature_flags(wip_limits: false)
end end
it 'ignores max issue count' do it 'ignores max issue count' do
...@@ -174,7 +166,6 @@ describe Boards::ListsController do ...@@ -174,7 +166,6 @@ describe Boards::ListsController do
context 'when updating max limits' do context 'when updating max limits' do
before do before do
sign_in(user) sign_in(user)
stub_licensed_features(wip_limits: true)
end end
it 'returns a successful 200 response when max issue count should be updated' do it 'returns a successful 200 response when max issue count should be updated' do
...@@ -329,7 +320,7 @@ describe Boards::ListsController do ...@@ -329,7 +320,7 @@ describe Boards::ListsController do
context 'when wip limits are not licensed' do context 'when wip limits are not licensed' do
before do before do
stub_licensed_features(wip_limits: false) stub_feature_flags(wip_limits: false)
end end
it 'fails to update max issue count with expected status' do it 'fails to update max issue count with expected status' do
......
...@@ -174,10 +174,6 @@ describe 'issue boards', :js do ...@@ -174,10 +174,6 @@ describe 'issue boards', :js do
end end
context 'When FF is turned on' do context 'When FF is turned on' do
before do
stub_licensed_features(wip_limits: true)
end
context 'when max issue count is set' do context 'when max issue count is set' do
let(:total_development_issues) { "1" } let(:total_development_issues) { "1" }
...@@ -196,25 +192,20 @@ describe 'issue boards', :js do ...@@ -196,25 +192,20 @@ describe 'issue boards', :js do
let!(:list) { create(:list, board: board, label: label, position: 1) } let!(:list) { create(:list, board: board, label: label, position: 1) }
before do before do
stub_licensed_features(wip_limits: wip_limits)
project.add_developer(user) project.add_developer(user)
login_as(user) login_as(user)
visit project_boards_path(project) visit project_boards_path(project)
end end
context 'When FF is turned on' do context 'When FF is turned on' do
let(:wip_limits) { true }
it 'shows the list settings button' do it 'shows the list settings button' do
expect(page).to have_selector(:button, "List Settings") expect(page).to have_selector(:button, "List Settings")
end end
end end
context 'When FF is turned off' do context 'When FF is turned off' do
let(:wip_limits) { false } it 'does not show the list settings button' do
stub_licensed_features(wip_limits: false)
it 'shows the list settings button' do
expect(page).to have_no_selector(:button, "List Settings") expect(page).to have_no_selector(:button, "List Settings")
end end
end end
......
...@@ -71,10 +71,6 @@ describe List do ...@@ -71,10 +71,6 @@ describe List do
let!(:list2) { create(:list, board: board2) } let!(:list2) { create(:list, board: board2) }
context 'with enabled wip_limits' do context 'with enabled wip_limits' do
before do
stub_licensed_features(wip_limits: true)
end
it 'returns the expected values' do it 'returns the expected values' do
expect(list1.wip_limits_available?).to be_truthy expect(list1.wip_limits_available?).to be_truthy
expect(list2.wip_limits_available?).to be_truthy expect(list2.wip_limits_available?).to be_truthy
...@@ -83,7 +79,7 @@ describe List do ...@@ -83,7 +79,7 @@ describe List do
context 'with disabled wip_limits' do context 'with disabled wip_limits' do
before do before do
stub_licensed_features(wip_limits: false) stub_feature_flags(wip_limits: false)
end end
it 'returns the expected values' do it 'returns the expected values' do
......
...@@ -44,8 +44,6 @@ describe API::Boards do ...@@ -44,8 +44,6 @@ describe API::Boards do
context 'with WIP limits license' do context 'with WIP limits license' do
before do before do
stub_licensed_features(wip_limits: true)
get api(url, user) get api(url, user)
end end
...@@ -60,7 +58,7 @@ describe API::Boards do ...@@ -60,7 +58,7 @@ describe API::Boards do
context 'without WIP limits license' do context 'without WIP limits license' do
before do before do
stub_licensed_features(wip_limits: false) stub_feature_flags(wip_limits: false)
get api(url, user) get api(url, user)
end end
......
...@@ -9,10 +9,6 @@ describe 'EE::Boards::Lists::UpdateService' do ...@@ -9,10 +9,6 @@ describe 'EE::Boards::Lists::UpdateService' do
shared_examples 'board list update' do shared_examples 'board list update' do
context 'with licensed wip limits' do context 'with licensed wip limits' do
before do
stub_licensed_features(wip_limits: true)
end
it 'updates the list if max_issue_count is given' do it 'updates the list if max_issue_count is given' do
update_list_and_test_result(list, { max_issue_count: 42 }, { max_issue_count: 42 }) update_list_and_test_result(list, { max_issue_count: 42 }, { max_issue_count: 42 })
end end
...@@ -100,7 +96,7 @@ describe 'EE::Boards::Lists::UpdateService' do ...@@ -100,7 +96,7 @@ describe 'EE::Boards::Lists::UpdateService' do
context 'without licensed wip limits' do context 'without licensed wip limits' do
before do before do
stub_licensed_features(wip_limits: false) stub_feature_flags(wip_limits: false)
end end
it 'does not update the list even if max_issue_count is given' do it 'does not update the list even if max_issue_count is given' do
......
...@@ -50,7 +50,7 @@ describe Boards::Lists::CreateService do ...@@ -50,7 +50,7 @@ describe Boards::Lists::CreateService do
describe '#create_list_attributes' do describe '#create_list_attributes' do
shared_examples 'attribute provider for list creation' do shared_examples 'attribute provider for list creation' do
before do before do
stub_licensed_features(wip_limits: wip_limits_enabled) stub_feature_flags(wip_limits: wip_limits_enabled)
end end
where(:params, :expected_max_issue_count, :expected_max_issue_weight) do where(:params, :expected_max_issue_count, :expected_max_issue_weight) 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