Commit 428de648 authored by Florie Guibert's avatar Florie Guibert

Clean up :epic_boards feature flag

Clean up FF, tests and update docs
Changelog: other
parent a9e59d22
......@@ -12,10 +12,8 @@ import BoardColumnDeprecated from './board_column_deprecated.vue';
export default {
components: {
BoardAddNewColumn,
BoardColumn:
gon.features?.graphqlBoardLists || gon.features?.epicBoards
? BoardColumn
: BoardColumnDeprecated,
BoardColumn,
BoardColumnDeprecated,
BoardContentSidebar: () => import('~/boards/components/board_content_sidebar.vue'),
EpicBoardContentSidebar: () =>
import('ee_component/boards/components/epic_board_content_sidebar.vue'),
......@@ -65,6 +63,11 @@ export default {
return this.canDragColumns ? options : {};
},
boardColumnComponent() {
return this.glFeatures.graphqlBoardLists || this.isSwimlanesOn || this.isEpicBoard
? BoardColumn
: BoardColumnDeprecated;
},
},
methods: {
...mapActions(['moveList', 'unsetError']),
......@@ -102,7 +105,8 @@ export default {
class="boards-list gl-w-full gl-py-5 gl-px-3 gl-white-space-nowrap"
@end="handleDragOnEnd"
>
<board-column
<component
:is="boardColumnComponent"
v-for="(list, index) in boardListsToUse"
:key="index"
ref="board"
......
......@@ -161,22 +161,3 @@ To edit the scope of an epic board:
- Show or hide the Open and Closed columns.
- Select other labels as the board's scope.
1. Select **Save changes**.
## Enable or disable epic boards
Epic boards are under development but ready for production use.
It is deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can disable it.
To disable it:
```ruby
Feature.disable(:epic_boards)
```
To enable it:
```ruby
Feature.enable(:epic_boards)
```
......@@ -8,9 +8,6 @@ class Groups::EpicBoardsController < Groups::ApplicationController
before_action :redirect_to_recent_board, only: [:index]
before_action :assign_endpoint_vars
before_action do
push_frontend_feature_flag(:epic_boards, group, default_enabled: :yaml)
end
track_redis_hll_event :index, :show, name: 'g_project_management_users_viewing_epic_boards'
......@@ -70,6 +67,6 @@ class Groups::EpicBoardsController < Groups::ApplicationController
end
def authorize_read_board!
access_denied! unless Feature.enabled?(:epic_boards, group, default_enabled: :yaml) && can?(current_user, :read_epic_board, group)
access_denied! unless can?(current_user, :read_epic_board, group)
end
end
......@@ -50,10 +50,6 @@ module Mutations
board = authorized_find!(id: args[:board_id])
epic = authorized_find!(id: args[:epic_id])
unless Feature.enabled?(:epic_boards, board.resource_parent, default_enabled: :yaml)
raise Gitlab::Graphql::Errors::ResourceNotAvailable, 'epic_boards feature is disabled'
end
move_epic(board, epic, move_list_arguments(args).merge(board_id: board.id))
{
......
......@@ -24,10 +24,6 @@ module Mutations
def resolve(**args)
board = authorized_find!(id: args[:id])
unless Feature.enabled?(:epic_boards, board.resource_parent, default_enabled: :yaml)
raise Gitlab::Graphql::Errors::ResourceNotAvailable, 'epic_boards feature is disabled'
end
::Boards::EpicBoards::UpdateService.new(board.resource_parent, current_user, args).execute(board)
{
......
......@@ -16,7 +16,6 @@ module Resolvers
alias_method :group, :object
def resolve(id: nil)
return unless Feature.enabled?(:epic_boards, group, default_enabled: :yaml)
return unless group.licensed_feature_available?(:epics)
authorize!
......
......@@ -8,7 +8,7 @@ module Boards
override :can_create_board?
def can_create_board?
Feature.enabled?(:epic_boards, parent, default_enabled: :yaml)
true
end
override :parent_board_collection
......
......@@ -7,10 +7,6 @@ module Boards
override :execute
def execute(board)
unless Feature.enabled?(:epic_boards, board.group, default_enabled: :yaml)
return ServiceResponse.error(message: 'Epic boards feature is not enabled.')
end
super
end
end
......
......@@ -11,10 +11,6 @@ module Boards
return ServiceResponse.error(message: 'Epics feature is not available.')
end
unless Feature.enabled?(:epic_boards, list.board.group, default_enabled: :yaml)
return ServiceResponse.error(message: 'Epic boards feature is not enabled.')
end
unless can?(current_user, :admin_epic_board_list, list)
return ServiceResponse.error(message: 'The epic board list that you are attempting to destroy does not '\
'exist or you don\'t have permission to perform this action')
......
......@@ -42,7 +42,7 @@ module Boards
end
def available?
group.licensed_feature_available?(:epics) && Feature.enabled?(:epic_boards, parent, default_enabled: :yaml)
group.licensed_feature_available?(:epics)
end
def allowed?
......
......@@ -20,10 +20,9 @@
= link_to group_epics_path(group), title: 'List' do
%span= _('List')
- if Feature.enabled?(:epic_boards, group, default_enabled: :yaml)
= nav_link(path: ['epic_boards#index', 'epic_boards#show'], html_options: { class: "home" }) do
= link_to group_epic_boards_path(group), title: 'Boards' do
%span= _('Boards')
= nav_link(path: ['epic_boards#index', 'epic_boards#show'], html_options: { class: "home" }) do
= link_to group_epic_boards_path(group), title: 'Boards' do
%span= _('Boards')
= nav_link(path: 'roadmap#show', html_options: { class: 'home' }) do
= link_to group_roadmap_path(group), title: 'Roadmap' do
......
---
name: epic_boards
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48893
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/290039
milestone: '13.7'
type: development
group: group::product planning
default_enabled: true
......@@ -80,28 +80,6 @@ RSpec.describe 'Group navbar' do
end
context 'when epics are available' do
before do
stub_licensed_features(epics: true)
stub_feature_flags(epic_boards: false)
insert_after_nav_item(
_('Group information'),
new_nav_item: {
nav_item: _('Epics'),
nav_sub_items: [
_('List'),
_('Roadmap')
]
}
)
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
context 'when epics and epic boards are available' do
before do
stub_licensed_features(epics: true)
......
......@@ -27,10 +27,9 @@ RSpec.describe ::Mutations::Boards::EpicBoards::Create do
it { is_expected.to have_graphql_fields(:epic_board).at_least }
end
context 'with epic feature enabled and epic_boards feature flag enabled' do
context 'with epic feature enabled' do
before do
stub_licensed_features(epics: true)
stub_feature_flags(epic_boards: true)
end
context 'when user does not have permission to create epic board' do
......@@ -52,14 +51,6 @@ RSpec.describe ::Mutations::Boards::EpicBoards::Create do
end
end
context 'with epic_boards feature flag disabled' do
before do
stub_feature_flags(epic_boards: false)
end
it_behaves_like 'epic board creation error'
end
context 'with epic feature disabled' do
before do
stub_licensed_features(epics: false)
......
......@@ -42,7 +42,6 @@ RSpec.describe ::Mutations::Boards::EpicBoards::EpicMoveList do
describe '#resolve' do
before do
stub_licensed_features(epics: true)
stub_feature_flags(epic_boards: true)
end
context 'when user does not have permissions' do
......
......@@ -27,10 +27,9 @@ RSpec.describe ::Mutations::Boards::EpicBoards::Update do
it { is_expected.to have_graphql_fields(:epic_board).at_least }
end
context 'with epic feature enabled and epic_boards feature flag enabled' do
context 'with epic feature enabled' do
before do
stub_licensed_features(epics: true)
stub_feature_flags(epic_boards: true)
end
context 'when user does not have permission to update epic board' do
......@@ -50,14 +49,6 @@ RSpec.describe ::Mutations::Boards::EpicBoards::Update do
expect(result[:epic_board].hide_backlog_list).to be_truthy
end
end
context 'with epic_boards feature flag disabled' do
before do
stub_feature_flags(epic_boards: false)
end
it_behaves_like 'epic board update error'
end
end
describe '#ready?' do
......
......@@ -18,7 +18,6 @@ RSpec.describe Mutations::Boards::Epics::Create do
before do
stub_licensed_features(epics: true)
stub_feature_flags(epic_boards: true)
end
let(:mutation) { described_class.new(object: nil, context: { current_user: user }, field: nil) }
......@@ -108,16 +107,6 @@ RSpec.describe Mutations::Boards::Epics::Create do
end
end
context 'with epic boards disabled' do
before do
stub_feature_flags(epic_boards: false)
end
it 'returns an error' do
expect(subject[:errors]).to include 'This feature is not available'
end
end
context 'with epics not available' do
before do
stub_licensed_features(epics: false)
......
......@@ -46,16 +46,6 @@ RSpec.describe Resolvers::Boards::EpicBoardsResolver do
.to contain_exactly(epic_board2, epic_board1)
.and be_sorted.asc.by(&:name)
end
context 'when epic_boards flag is disabled' do
before do
stub_feature_flags(epic_boards: false)
end
it 'returns nil' do
expect(result).to be_nil
end
end
end
end
end
......
......@@ -69,18 +69,5 @@ RSpec.describe 'get list of epic boards' do
expect(graphql_data.dig('group', 'epicBoard', 'hideClosedList')).to eq board1.hide_closed_list
end
end
context 'when epic_boards flag is disabled' do
before do
stub_feature_flags(epic_boards: false)
end
it 'returns nil epic_boards' do
post_graphql(pagination_query, current_user: current_user)
boards = graphql_data.dig('group', 'epicBoards')
expect(boards).to be_nil
end
end
end
end
......@@ -34,24 +34,9 @@ RSpec.describe 'Reposition and move epic between board lists' do
subject { post_graphql_mutation(mutation(params), current_user: current_user) }
context 'when epic_boards are disabled' do
context 'when epics are available' do
before do
stub_licensed_features(epics: true)
stub_feature_flags(epic_boards: false)
group.add_developer(current_user)
end
it 'raises feature not available error' do
subject
expect(graphql_errors).to include(a_hash_including('message' => 'epic_boards feature is disabled'))
end
end
context 'when epic_boards are enabled' do
before do
stub_licensed_features(epics: true)
stub_feature_flags(epic_boards: true)
end
context 'when user does not have permissions to admin the board' do
......
......@@ -44,7 +44,6 @@ RSpec.describe Mutations::Boards::Epics::Create do
before do
group.add_reporter(current_user)
stub_licensed_features(epics: true)
stub_feature_flags(epic_boards: true)
end
context 'when all arguments are given' do
......
......@@ -10,24 +10,8 @@ RSpec.describe Boards::EpicBoards::CreateService, services: true do
let_it_be(:user) { create(:user) }
let(:parent) { create(:group) }
let(:epic_boards_enabled) { false }
before do
stub_feature_flags(epic_boards: epic_boards_enabled)
end
context 'with epic boards feature not available' do
it 'does not create a board' do
service = described_class.new(parent, user)
expect(service.execute.payload).not_to be_nil
expect { service.execute }.not_to change(parent.epic_boards, :count)
end
end
context 'with epic boards feature available' do
let(:epic_boards_enabled) { true }
context 'create epic board' do
it_behaves_like 'create a board', :epic_boards
it 'tracks epic board creation' do
......
......@@ -12,17 +12,4 @@ RSpec.describe Boards::EpicLists::CreateService do
create(:epic_list, params.merge(epic_board: board))
end
end
context 'when epic_boards feature flag is disabled' do
before do
stub_feature_flags(epic_boards: false)
end
it 'returns an error' do
response = described_class.new(parent, nil).execute(board)
expect(response.success?).to eq(false)
expect(response.errors).to include("Epic boards feature is not enabled.")
end
end
end
......@@ -18,7 +18,6 @@ RSpec.describe Boards::EpicLists::DestroyService do
before do
stub_licensed_features(epics: true)
stub_feature_flags(epic_boards: true)
end
context 'when user does not have permission' do
......@@ -50,18 +49,5 @@ RSpec.describe Boards::EpicLists::DestroyService do
expect(response.errors).to include("Epics feature is not available.")
end
end
context 'when epic_boards feature flag is disabled' do
before do
stub_feature_flags(epic_boards: false)
end
it 'returns an error' do
response = described_class.new(parent, nil).execute(list)
expect(response).to be_error
expect(response.errors).to include("Epic boards feature is not enabled.")
end
end
end
end
......@@ -76,13 +76,5 @@ RSpec.describe Boards::Epics::CreateService do
context 'when epics feature is not available' do
it_behaves_like 'epic creation error', /does not exist or you don't have permission/
end
context 'when epic boards feature flag is not enabled' do
before do
stub_feature_flags(epic_boards: false)
end
it_behaves_like 'epic creation error', /not available/
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