Skip to content
代码片段 群组 项目
未验证 提交 cf2a4f3c 编辑于 作者: Jarka Košanová's avatar Jarka Košanová 提交者: GitLab
浏览文件

Merge branch '443568-bulk-assignment-feature-flag' into 'master'

Ability to check for duo pro bulk assignment in SM instances

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/156779



Merged-by: default avatarJarka Košanová <jarka@gitlab.com>
Approved-by: default avatarShreyas Agarwal <sagarwal@gitlab.com>
Approved-by: default avatarJarka Košanová <jarka@gitlab.com>
Co-authored-by: default avatarDivya <dmahadevan@gitlab.com>
No related branches found
No related tags found
无相关合并请求
---
name: sm_duo_pro_bulk_user_assignment
feature_issue_url: https://gitlab.com/groups/gitlab-org/-/epics/12959
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/156779
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/443570
milestone: '17.2'
group: group::provision
type: development
default_enabled: false
......@@ -15,7 +15,11 @@ def gitlab_duo_available?(namespace = nil)
def duo_pro_bulk_user_assignment_available?(namespace = nil)
return false unless gitlab_duo_available?(namespace)
Feature.enabled?(:gitlab_com_duo_pro_bulk_user_assignment, namespace) if gitlab_com_subscription?
if gitlab_com_subscription?
Feature.enabled?(:gitlab_com_duo_pro_bulk_user_assignment, namespace)
else
Feature.enabled?(:sm_duo_pro_bulk_user_assignment)
end
end
def add_duo_pro_seats_url(subscription_name)
......
......@@ -120,14 +120,30 @@
end
end
context 'when GitLab is not .com' do
context 'when GitLab is self managed' do
before do
stub_saas_features(gitlab_com_subscriptions: false)
end
context 'when duo pro is available' do
it 'returns false' do
expect(helper.duo_pro_bulk_user_assignment_available?).to be_falsey
context 'when sm feature flag is enabled' do
before do
stub_feature_flags(sm_duo_pro_bulk_user_assignment: true)
end
it 'returns true' do
expect(helper.duo_pro_bulk_user_assignment_available?).to be_truthy
end
end
context 'when sm feature flag is disabled' do
before do
stub_feature_flags(sm_duo_pro_bulk_user_assignment: false)
end
it 'returns false' do
expect(helper.duo_pro_bulk_user_assignment_available?).to be_falsey
end
end
end
......@@ -136,6 +152,26 @@
stub_feature_flags(self_managed_code_suggestions: false)
end
context 'when sm feature flag is enabled' do
before do
stub_feature_flags(sm_duo_pro_bulk_user_assignment: true)
end
it 'returns false' do
expect(helper.duo_pro_bulk_user_assignment_available?).to be_falsey
end
end
context 'when sm feature flag is disabled' do
before do
stub_feature_flags(sm_duo_pro_bulk_user_assignment: false)
end
it 'returns false' do
expect(helper.duo_pro_bulk_user_assignment_available?).to be_falsey
end
end
it 'returns false' do
expect(helper.duo_pro_bulk_user_assignment_available?).to be_falsey
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册