Commit be56c093 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'ck3g-remove-type-licensed-for-feature-flags' into 'master'

Remove `licensed` type from Feature Flags [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!52597
parents f699bbc9 0c0dbb85
...@@ -365,7 +365,7 @@ export default () => { ...@@ -365,7 +365,7 @@ export default () => {
toggleFocusMode(ModalStore, boardsStore); toggleFocusMode(ModalStore, boardsStore);
toggleLabels(); toggleLabels();
if (gon.features?.swimlanes) { if (gon.licensed_features?.swimlanes) {
toggleEpicsSwimlanes(); toggleEpicsSwimlanes();
} }
......
...@@ -61,9 +61,6 @@ export default { ...@@ -61,9 +61,6 @@ export default {
this.customState.integrationLevel === integrationLevels.GROUP this.customState.integrationLevel === integrationLevels.GROUP
); );
}, },
showJiraIssuesFields() {
return this.isJira && this.glFeatures.jiraIssuesIntegration;
},
showReset() { showReset() {
return this.isInstanceOrGroupLevel && this.propsSource.resetPath; return this.isInstanceOrGroupLevel && this.propsSource.resetPath;
}, },
...@@ -129,7 +126,7 @@ export default { ...@@ -129,7 +126,7 @@ export default {
v-bind="field" v-bind="field"
/> />
<jira-issues-fields <jira-issues-fields
v-if="showJiraIssuesFields" v-if="isJira"
:key="`${currentKey}-jira-issues-fields`" :key="`${currentKey}-jira-issues-fields`"
v-bind="propsSource.jiraIssuesProps" v-bind="propsSource.jiraIssuesProps"
/> />
......
...@@ -36,7 +36,7 @@ function mountJiraIssuesListApp() { ...@@ -36,7 +36,7 @@ function mountJiraIssuesListApp() {
} }
function mountIssuablesListApp() { function mountIssuablesListApp() {
if (!gon.features?.vueIssuablesList && !gon.features?.jiraIssuesIntegration) { if (!gon.features?.vueIssuablesList) {
return; return;
} }
......
export default (Vue) => { export default (Vue) => {
Vue.mixin({ Vue.mixin({
provide: { provide: {
glFeatures: { ...((window.gon && window.gon.features) || {}) }, glFeatures:
{
...window.gon?.features,
// TODO: extract into glLicensedFeatures https://gitlab.com/gitlab-org/gitlab/-/issues/322460
...window.gon?.licensed_features,
} || {},
}, },
}); });
}; };
...@@ -12,8 +12,6 @@ class Projects::ServicesController < Projects::ApplicationController ...@@ -12,8 +12,6 @@ class Projects::ServicesController < Projects::ApplicationController
before_action :set_deprecation_notice_for_prometheus_service, only: [:edit, :update] before_action :set_deprecation_notice_for_prometheus_service, only: [:edit, :update]
before_action :redirect_deprecated_prometheus_service, only: [:update] before_action :redirect_deprecated_prometheus_service, only: [:update]
before_action only: :edit do before_action only: :edit do
push_frontend_feature_flag(:jira_issues_integration, @project, type: :licensed, default_enabled: true)
push_frontend_feature_flag(:jira_vulnerabilities_integration, @project, type: :licensed, default_enabled: true)
push_frontend_feature_flag(:jira_for_vulnerabilities, @project, type: :development, default_enabled: :yaml) push_frontend_feature_flag(:jira_for_vulnerabilities, @project, type: :development, default_enabled: :yaml)
end end
......
...@@ -6,10 +6,6 @@ module Clusters ...@@ -6,10 +6,6 @@ module Clusters
Clusters::Cluster.instance_type Clusters::Cluster.instance_type
end end
def feature_available?(feature)
::Feature.enabled?(feature, type: :licensed, default_enabled: true)
end
def flipper_id def flipper_id
self.class.to_s self.class.to_s
end end
......
...@@ -6,7 +6,7 @@ export default { ...@@ -6,7 +6,7 @@ export default {
...gettersCE, ...gettersCE,
isSwimlanesOn: (state) => { isSwimlanesOn: (state) => {
return Boolean(gon?.features?.swimlanes && state.isShowingEpicsSwimlanes); return Boolean(gon?.licensed_features?.swimlanes && state.isShowingEpicsSwimlanes);
}, },
getListByTypeId: (state) => ({ assigneeId, labelId, milestoneId }) => { getListByTypeId: (state) => ({ assigneeId, labelId, milestoneId }) => {
......
...@@ -12,9 +12,9 @@ module EE ...@@ -12,9 +12,9 @@ module EE
def push_licensed_features def push_licensed_features
# This is pushing a licensed Feature to the frontend. # This is pushing a licensed Feature to the frontend.
push_frontend_feature_flag(:wip_limits, type: :licensed, default_enabled: true) if parent.feature_available?(:wip_limits) push_licensed_feature(:wip_limits) if parent.feature_available?(:wip_limits)
push_frontend_feature_flag(:swimlanes, type: :licensed, default_enabled: true) if parent.feature_available?(:swimlanes) push_licensed_feature(:swimlanes) if parent.feature_available?(:swimlanes)
push_frontend_feature_flag(:issue_weights, type: :licensed, default_enabled: true) if parent.feature_available?(:issue_weights) push_licensed_feature(:issue_weights) if parent.feature_available?(:issue_weights)
end end
end end
end end
...@@ -16,7 +16,6 @@ module Projects ...@@ -16,7 +16,6 @@ module Projects
before_action :check_issues_show_enabled!, only: :show before_action :check_issues_show_enabled!, only: :show
before_action do before_action do
push_frontend_feature_flag(:jira_issues_integration, project, type: :licensed, default_enabled: true)
push_frontend_feature_flag(:jira_issues_list, project, type: :development) push_frontend_feature_flag(:jira_issues_list, project, type: :development)
end end
......
...@@ -143,9 +143,6 @@ module EE ...@@ -143,9 +143,6 @@ module EE
# being licensed. # being licensed.
override :feature_available? override :feature_available?
def feature_available?(feature) def feature_available?(feature)
# This feature might not be behind a feature flag at all, so default to true
return false unless ::Feature.enabled?(feature, type: :licensed, default_enabled: true)
available_features = strong_memoize(:feature_available) do available_features = strong_memoize(:feature_available) do
Hash.new do |h, f| Hash.new do |h, f|
h[f] = load_feature_available(f) h[f] = load_feature_available(f)
......
...@@ -786,9 +786,6 @@ module EE ...@@ -786,9 +786,6 @@ module EE
end end
def licensed_feature_available?(feature, user = nil) def licensed_feature_available?(feature, user = nil)
# This feature might not be behind a feature flag at all, so default to true
return false unless ::Feature.enabled?(feature, user, type: :licensed, default_enabled: true)
available_features = strong_memoize(:licensed_feature_available) do available_features = strong_memoize(:licensed_feature_available) do
Hash.new do |h, f| Hash.new do |h, f|
h[f] = load_licensed_feature_available(f) h[f] = load_licensed_feature_available(f)
......
...@@ -428,9 +428,6 @@ class License < ApplicationRecord ...@@ -428,9 +428,6 @@ class License < ApplicationRecord
def feature_available?(feature) def feature_available?(feature)
return false if trial? && expired? return false if trial? && expired?
# This feature might not be behind a feature flag at all, so default to true
return false unless ::Feature.enabled?(feature, type: :licensed, default_enabled: true)
features.include?(feature) features.include?(feature)
end end
......
...@@ -8,7 +8,8 @@ module PersonalAccessTokens ...@@ -8,7 +8,8 @@ module PersonalAccessTokens
end end
def execute def execute
return unless ::Feature.enabled?(:personal_access_token_expiration_policy, type: :licensed, default_enabled: true) # TODO: Change to `project.feature_available?` https://gitlab.com/gitlab-org/gitlab/-/issues/323908
return unless ::License.feature_available?(:personal_access_token_expiration_policy)
return unless PersonalAccessToken.expiration_enforced? return unless PersonalAccessToken.expiration_enforced?
return unless expiration_date && user_affected? return unless expiration_date && user_affected?
......
...@@ -117,7 +117,7 @@ RSpec.describe Boards::ListsController do ...@@ -117,7 +117,7 @@ RSpec.describe Boards::ListsController do
context 'without licensed wip limits' do context 'without licensed wip limits' do
before do before do
stub_feature_flags(wip_limits: false) stub_licensed_features(wip_limits: false)
end end
it 'ignores max issue count' do it 'ignores max issue count' do
...@@ -141,7 +141,7 @@ RSpec.describe Boards::ListsController do ...@@ -141,7 +141,7 @@ RSpec.describe Boards::ListsController do
context 'without licensed wip limits' do context 'without licensed wip limits' do
before do before do
stub_feature_flags(wip_limits: false) stub_licensed_features(wip_limits: false)
end end
it 'ignores max issue count' do it 'ignores max issue count' do
...@@ -193,7 +193,7 @@ RSpec.describe Boards::ListsController do ...@@ -193,7 +193,7 @@ RSpec.describe Boards::ListsController do
context 'without licensed wip limits' do context 'without licensed wip limits' do
before do before do
stub_feature_flags(wip_limits: false) stub_licensed_features(wip_limits: false)
end end
it 'ignores limit metric setting' do it 'ignores limit metric setting' do
...@@ -467,7 +467,7 @@ RSpec.describe Boards::ListsController do ...@@ -467,7 +467,7 @@ RSpec.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_feature_flags(wip_limits: false) stub_licensed_features(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
......
...@@ -215,7 +215,7 @@ RSpec.describe 'issue boards', :js do ...@@ -215,7 +215,7 @@ RSpec.describe 'issue boards', :js do
login_as(user) login_as(user)
end end
context 'When license is available' do context 'when license is available' do
let!(:label) { create(:label, project: project, name: 'Brount') } let!(:label) { create(:label, project: project, name: 'Brount') }
let!(:list) { create(:list, board: board, label: label, position: 1) } let!(:list) { create(:list, board: board, label: label, position: 1) }
...@@ -346,7 +346,7 @@ RSpec.describe 'issue boards', :js do ...@@ -346,7 +346,7 @@ RSpec.describe 'issue boards', :js do
end end
end end
context 'When license is not available' do context 'when license is not available' do
before do before do
stub_licensed_features(wip_limits: false) stub_licensed_features(wip_limits: false)
visit project_boards_path(project) visit project_boards_path(project)
......
...@@ -6,7 +6,7 @@ import { createStore } from '~/boards/stores'; ...@@ -6,7 +6,7 @@ import { createStore } from '~/boards/stores';
describe('ee/BoardContent', () => { describe('ee/BoardContent', () => {
let wrapper; let wrapper;
let store; let store;
window.gon = { features: {} }; window.gon = { licensed_features: {} };
const createComponent = () => { const createComponent = () => {
wrapper = shallowMount(BoardContent, { wrapper = shallowMount(BoardContent, {
...@@ -30,19 +30,19 @@ describe('ee/BoardContent', () => { ...@@ -30,19 +30,19 @@ describe('ee/BoardContent', () => {
}); });
afterEach(() => { afterEach(() => {
window.gon.features = {}; window.gon.licensed_features = {};
wrapper.destroy(); wrapper.destroy();
}); });
describe.each` describe.each`
featureFlag | state | result licenseEnabled | state | result
${true} | ${{ isShowingEpicsSwimlanes: true }} | ${true} ${true} | ${{ isShowingEpicsSwimlanes: true }} | ${true}
${true} | ${{ isShowingEpicsSwimlanes: false }} | ${false} ${true} | ${{ isShowingEpicsSwimlanes: false }} | ${false}
${false} | ${{ isShowingEpicsSwimlanes: true }} | ${false} ${false} | ${{ isShowingEpicsSwimlanes: true }} | ${false}
${false} | ${{ isShowingEpicsSwimlanes: false }} | ${false} ${false} | ${{ isShowingEpicsSwimlanes: false }} | ${false}
`('with featureFlag=$featureFlag and state=$state', ({ featureFlag, state, result }) => { `('with licenseEnabled=$licenseEnabled and state=$state', ({ licenseEnabled, state, result }) => {
beforeEach(() => { beforeEach(() => {
gon.features.swimlanes = featureFlag; gon.licensed_features.swimlanes = licenseEnabled;
Object.assign(store.state, state); Object.assign(store.state, state);
createComponent(); createComponent();
}); });
......
...@@ -19,12 +19,12 @@ describe('EE Boards Store Getters', () => { ...@@ -19,12 +19,12 @@ describe('EE Boards Store Getters', () => {
describe('isSwimlanesOn', () => { describe('isSwimlanesOn', () => {
afterEach(() => { afterEach(() => {
window.gon = { features: {} }; window.gon = { licensed_features: {} };
}); });
describe('when swimlanes feature is true', () => { describe('when swimlanes feature is true', () => {
beforeEach(() => { beforeEach(() => {
window.gon = { features: { swimlanes: true } }; window.gon = { licensed_features: { swimlanes: true } };
}); });
describe('when isShowingEpicsSwimlanes is true', () => { describe('when isShowingEpicsSwimlanes is true', () => {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Gitlab::TreeSummary do RSpec.describe Gitlab::TreeSummary do
let_it_be(:project) { create(:project, :custom_repo, files: { 'a.txt' => '' }) } let_it_be_with_refind(:project) { create(:project, :custom_repo, files: { 'a.txt' => '' }) }
let_it_be(:path_lock) { create(:path_lock, project: project, path: 'a.txt') } let_it_be(:path_lock) { create(:path_lock, project: project, path: 'a.txt') }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
...@@ -21,7 +21,7 @@ RSpec.describe Gitlab::TreeSummary do ...@@ -21,7 +21,7 @@ RSpec.describe Gitlab::TreeSummary do
context 'when file_locks feature is unavailable' do context 'when file_locks feature is unavailable' do
before do before do
stub_feature_flags(file_locks: false) stub_licensed_features(file_locks: false)
end end
it 'does not fill lock labels' do it 'does not fill lock labels' do
......
...@@ -101,6 +101,10 @@ RSpec.describe List do ...@@ -101,6 +101,10 @@ RSpec.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
...@@ -109,7 +113,7 @@ RSpec.describe List do ...@@ -109,7 +113,7 @@ RSpec.describe List do
context 'with disabled wip_limits' do context 'with disabled wip_limits' do
before do before do
stub_feature_flags(wip_limits: false) stub_licensed_features(wip_limits: false)
end end
it 'returns the expected values' do it 'returns the expected values' do
......
...@@ -501,22 +501,6 @@ RSpec.describe Namespace do ...@@ -501,22 +501,6 @@ RSpec.describe Namespace do
end end
end end
end end
context 'when feature is disabled by a feature flag' do
it 'returns false' do
stub_feature_flags(feature => false)
is_expected.to eq(false)
end
end
context 'when feature is enabled by a feature flag' do
it 'returns true' do
stub_feature_flags(feature => true)
is_expected.to eq(true)
end
end
end end
describe '#feature_available?' do describe '#feature_available?' do
......
...@@ -254,7 +254,7 @@ RSpec.describe GroupMember do ...@@ -254,7 +254,7 @@ RSpec.describe GroupMember do
end end
context 'group member webhooks', :sidekiq_inline do context 'group member webhooks', :sidekiq_inline do
let_it_be(:group) { create(:group_with_plan, plan: :ultimate_plan) } let_it_be_with_refind(:group) { create(:group_with_plan, plan: :ultimate_plan) }
let_it_be(:group_hook) { create(:group_hook, group: group, member_events: true) } let_it_be(:group_hook) { create(:group_hook, group: group, member_events: true) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
...@@ -350,8 +350,8 @@ RSpec.describe GroupMember do ...@@ -350,8 +350,8 @@ RSpec.describe GroupMember do
expect(WebMock).not_to have_requested(:post, group_hook.url) expect(WebMock).not_to have_requested(:post, group_hook.url)
end end
it 'does not execute webhooks if feature flag is disabled' do it 'does not execute webhooks if license is disabled' do
stub_feature_flags(group_webhooks: false) stub_licensed_features(group_webhooks: false)
group.add_guest(user) group.add_guest(user)
......
...@@ -874,26 +874,6 @@ RSpec.describe License do ...@@ -874,26 +874,6 @@ RSpec.describe License do
end end
end end
end end
context 'when feature is disabled by a feature flag' do
it 'returns false' do
feature = license.features.first
stub_feature_flags(feature => false)
expect(license.features).not_to receive(:include?)
expect(license.feature_available?(feature)).to eq(false)
end
end
context 'when feature is enabled by a feature flag' do
it 'returns true' do
feature = license.features.first
stub_feature_flags(feature => true)
expect(license.feature_available?(feature)).to eq(true)
end
end
end end
def build_license_with_add_ons(add_ons, plan: nil) def build_license_with_add_ons(add_ons, plan: nil)
......
...@@ -885,14 +885,6 @@ RSpec.describe Project do ...@@ -885,14 +885,6 @@ RSpec.describe Project do
it 'returns true' do it 'returns true' do
is_expected.to eq(true) is_expected.to eq(true)
end end
context 'when feature is disabled by a feature flag' do
it 'returns false' do
stub_feature_flags(feature => false)
is_expected.to eq(false)
end
end
end end
context 'not allowed by Plan License but project and namespace are public' do context 'not allowed by Plan License but project and namespace are public' do
......
...@@ -1084,7 +1084,6 @@ RSpec.describe ProjectPolicy do ...@@ -1084,7 +1084,6 @@ RSpec.describe ProjectPolicy do
let(:current_user) { public_send(role) if role } let(:current_user) { public_send(role) if role }
before do before do
stub_feature_flags(feature => true)
stub_licensed_features(feature => true) stub_licensed_features(feature => true)
enable_admin_mode!(current_user) if admin_mode enable_admin_mode!(current_user) if admin_mode
end end
...@@ -1098,14 +1097,6 @@ RSpec.describe ProjectPolicy do ...@@ -1098,14 +1097,6 @@ RSpec.describe ProjectPolicy do
it { is_expected.to be_disallowed(policy) } it { is_expected.to be_disallowed(policy) }
end end
context 'when feature flag is disabled' do
before do
stub_feature_flags(feature => false)
end
it { is_expected.to be_disallowed(policy) }
end
end end
end end
end end
......
...@@ -74,7 +74,7 @@ RSpec.describe API::Boards do ...@@ -74,7 +74,7 @@ RSpec.describe API::Boards do
context 'without WIP limits license' do context 'without WIP limits license' do
before do before do
stub_feature_flags(wip_limits: false) stub_licensed_features(wip_limits: false)
get api(url, user) get api(url, user)
end end
......
...@@ -154,7 +154,7 @@ RSpec.describe 'EE::Boards::Lists::UpdateService' do ...@@ -154,7 +154,7 @@ RSpec.describe 'EE::Boards::Lists::UpdateService' do
context 'without licensed wip limits' do context 'without licensed wip limits' do
before do before do
stub_feature_flags(wip_limits: false) stub_licensed_features(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
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Boards::Lists::CreateService do RSpec.describe Boards::Lists::CreateService do
describe '#execute' do describe '#execute' do
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, group: group) } let_it_be_with_refind(:project) { create(:project, group: group) }
let_it_be(:board, refind: true) { create(:board, project: project) } let_it_be(:board, refind: true) { create(:board, project: project) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
...@@ -106,7 +106,7 @@ RSpec.describe Boards::Lists::CreateService do ...@@ -106,7 +106,7 @@ RSpec.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_feature_flags(wip_limits: wip_limits_enabled) stub_licensed_features(wip_limits: wip_limits_enabled)
end end
where(:params, :expected_max_issue_count, :expected_max_issue_weight, :expected_limit_metric) do where(:params, :expected_max_issue_count, :expected_max_issue_weight, :expected_limit_metric) do
......
...@@ -13,6 +13,10 @@ RSpec.describe PersonalAccessTokens::RevokeInvalidTokens do ...@@ -13,6 +13,10 @@ RSpec.describe PersonalAccessTokens::RevokeInvalidTokens do
let_it_be(:invalid_pat1) { create(:personal_access_token, expires_at: nil, user: user) } let_it_be(:invalid_pat1) { create(:personal_access_token, expires_at: nil, user: user) }
let_it_be(:invalid_pat2) { create(:personal_access_token, expires_at: 20.days.from_now, user: user) } let_it_be(:invalid_pat2) { create(:personal_access_token, expires_at: 20.days.from_now, user: user) }
before do
stub_licensed_features(personal_access_token_expiration_policy: true)
end
shared_examples 'user does not receive revoke notification email' do shared_examples 'user does not receive revoke notification email' do
it 'does not send any notification to user' do it 'does not send any notification to user' do
expect(Notify).not_to receive(:policy_revoked_personal_access_tokens_email).and_call_original expect(Notify).not_to receive(:policy_revoked_personal_access_tokens_email).and_call_original
...@@ -103,9 +107,9 @@ RSpec.describe PersonalAccessTokens::RevokeInvalidTokens do ...@@ -103,9 +107,9 @@ RSpec.describe PersonalAccessTokens::RevokeInvalidTokens do
end end
end end
context 'when the feature flag for personal access token policy is disabled' do context 'when the licensed feature for personal access token policy is disabled' do
before do before do
stub_feature_flags(personal_access_token_expiration_policy: false) stub_licensed_features(personal_access_token_expiration_policy: false)
end end
it_behaves_like 'user does not receive revoke notification email' it_behaves_like 'user does not receive revoke notification email'
......
...@@ -64,23 +64,10 @@ RSpec.shared_examples 'Insights page' do ...@@ -64,23 +64,10 @@ RSpec.shared_examples 'Insights page' do
end end
end end
end end
context 'when the feature flag is disabled globally' do
before do
stub_feature_flags(insights: false)
end
it 'returns 404' do
visit route
expect(page).to have_gitlab_http_status(:not_found)
end
end
end end
context 'without correct license' do context 'without correct license' do
before do before do
stub_feature_flags(insights: false)
stub_licensed_features(insights: false) stub_licensed_features(insights: false)
end end
......
...@@ -21,6 +21,10 @@ RSpec.describe PersonalAccessTokens::Groups::PolicyWorker, type: :worker do ...@@ -21,6 +21,10 @@ RSpec.describe PersonalAccessTokens::Groups::PolicyWorker, type: :worker do
described_class.new.perform(group.id) described_class.new.perform(group.id)
end end
before do
stub_licensed_features(personal_access_token_expiration_policy: true)
end
it_behaves_like 'an idempotent worker' do it_behaves_like 'an idempotent worker' do
let(:job_args) { [group.id] } let(:job_args) { [group.id] }
......
...@@ -9,6 +9,7 @@ RSpec.describe PersonalAccessTokens::Instance::PolicyWorker, type: :worker do ...@@ -9,6 +9,7 @@ RSpec.describe PersonalAccessTokens::Instance::PolicyWorker, type: :worker do
before do before do
stub_application_setting(max_personal_access_token_lifetime: instance_limit) stub_application_setting(max_personal_access_token_lifetime: instance_limit)
stub_licensed_features(personal_access_token_expiration_policy: true)
end end
context 'when a token is valid' do context 'when a token is valid' do
......
...@@ -37,18 +37,6 @@ class Feature ...@@ -37,18 +37,6 @@ class Feature
push_frontend_feature_flag(:my_ops_flag, project, type: :ops) push_frontend_feature_flag(:my_ops_flag, project, type: :ops)
EOS EOS
}, },
licensed: {
description: 'Permanent feature flags used to temporarily disable licensed features.',
deprecated: true,
optional: true,
rollout_issue: false,
ee_only: true,
default_enabled: true,
example: <<-EOS
project.feature_available?(:my_licensed_feature)
namespace.feature_available?(:my_licensed_feature)
EOS
},
experiment: { experiment: {
description: 'Short lived, used specifically to run A/B/n experiments.', description: 'Short lived, used specifically to run A/B/n experiments.',
optional: true, optional: true,
......
...@@ -265,16 +265,9 @@ RSpec.describe 'bin/feature-flag' do ...@@ -265,16 +265,9 @@ RSpec.describe 'bin/feature-flag' do
end end
describe '.read_ee_only' do describe '.read_ee_only' do
where(:type, :is_ee_only) do let(:options) { OpenStruct.new(name: 'foo', type: :development) }
:development | false
:licensed | true
end
with_them do
let(:options) { OpenStruct.new(name: 'foo', type: type) }
it { expect(described_class.read_ee_only(options)).to eq(is_ee_only) } it { expect(described_class.read_ee_only(options)).to eq(false) }
end
end end
end end
end end
...@@ -207,27 +207,6 @@ describe('IntegrationForm', () => { ...@@ -207,27 +207,6 @@ describe('IntegrationForm', () => {
expect(findJiraTriggerFields().exists()).toBe(true); expect(findJiraTriggerFields().exists()).toBe(true);
}); });
describe('featureFlag jiraIssuesIntegration is false', () => {
it('does not render JiraIssuesFields', () => {
createComponent({
customStateProps: { type: 'jira' },
featureFlags: { jiraIssuesIntegration: false },
});
expect(findJiraIssuesFields().exists()).toBe(false);
});
});
describe('featureFlag jiraIssuesIntegration is true', () => {
it('renders JiraIssuesFields', () => {
createComponent({
customStateProps: { type: 'jira' },
featureFlags: { jiraIssuesIntegration: true },
});
expect(findJiraIssuesFields().exists()).toBe(true);
});
});
}); });
describe('triggerEvents is present', () => { describe('triggerEvents is present', () => {
......
...@@ -11,6 +11,10 @@ describe('GitLab Feature Flags Plugin', () => { ...@@ -11,6 +11,10 @@ describe('GitLab Feature Flags Plugin', () => {
aFeature: true, aFeature: true,
bFeature: false, bFeature: false,
}, },
licensed_features: {
cFeature: true,
dFeature: false,
},
}; };
localVue.use(GlFeatureFlags); localVue.use(GlFeatureFlags);
...@@ -25,6 +29,8 @@ describe('GitLab Feature Flags Plugin', () => { ...@@ -25,6 +29,8 @@ describe('GitLab Feature Flags Plugin', () => {
expect(wrapper.vm.glFeatures).toEqual({ expect(wrapper.vm.glFeatures).toEqual({
aFeature: true, aFeature: true,
bFeature: false, bFeature: false,
cFeature: true,
dFeature: false,
}); });
}); });
...@@ -37,6 +43,8 @@ describe('GitLab Feature Flags Plugin', () => { ...@@ -37,6 +43,8 @@ describe('GitLab Feature Flags Plugin', () => {
expect(wrapper.vm.glFeatures).toEqual({ expect(wrapper.vm.glFeatures).toEqual({
aFeature: true, aFeature: true,
bFeature: false, bFeature: false,
cFeature: true,
dFeature: false,
}); });
}); });
}); });
...@@ -269,7 +269,7 @@ RSpec.describe Feature, stub_feature_flags: false do ...@@ -269,7 +269,7 @@ RSpec.describe Feature, stub_feature_flags: false do
end end
it 'when invalid type is used' do it 'when invalid type is used' do
expect { described_class.enabled?(:my_feature_flag, type: :licensed) } expect { described_class.enabled?(:my_feature_flag, type: :ops) }
.to raise_error(/The `type:` of/) .to raise_error(/The `type:` of/)
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