Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0c0dbb85
Commit
0c0dbb85
authored
Mar 10, 2021
by
Vitali Tatarintev
Committed by
Bob Van Landuyt
Mar 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove `type: :licensed`
Removes `type: :licensed` from feature flags
parent
f0acac26
Changes
36
Show whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
68 additions
and
166 deletions
+68
-166
app/assets/javascripts/boards/index.js
app/assets/javascripts/boards/index.js
+1
-1
app/assets/javascripts/integrations/edit/components/integration_form.vue
...scripts/integrations/edit/components/integration_form.vue
+1
-4
app/assets/javascripts/issues_list/index.js
app/assets/javascripts/issues_list/index.js
+1
-1
app/assets/javascripts/vue_shared/gl_feature_flags_plugin.js
app/assets/javascripts/vue_shared/gl_feature_flags_plugin.js
+6
-1
app/controllers/projects/services_controller.rb
app/controllers/projects/services_controller.rb
+0
-2
app/models/clusters/instance.rb
app/models/clusters/instance.rb
+0
-4
ee/app/assets/javascripts/boards/stores/getters.js
ee/app/assets/javascripts/boards/stores/getters.js
+1
-1
ee/app/controllers/concerns/ee/boards_actions.rb
ee/app/controllers/concerns/ee/boards_actions.rb
+3
-3
ee/app/controllers/projects/integrations/jira/issues_controller.rb
...ntrollers/projects/integrations/jira/issues_controller.rb
+0
-1
ee/app/models/ee/namespace.rb
ee/app/models/ee/namespace.rb
+0
-3
ee/app/models/ee/project.rb
ee/app/models/ee/project.rb
+0
-3
ee/app/models/license.rb
ee/app/models/license.rb
+0
-3
ee/app/services/personal_access_tokens/revoke_invalid_tokens.rb
.../services/personal_access_tokens/revoke_invalid_tokens.rb
+2
-1
ee/spec/controllers/boards/lists_controller_spec.rb
ee/spec/controllers/boards/lists_controller_spec.rb
+4
-4
ee/spec/features/boards/boards_spec.rb
ee/spec/features/boards/boards_spec.rb
+2
-2
ee/spec/frontend/boards/components/board_content_spec.js
ee/spec/frontend/boards/components/board_content_spec.js
+9
-9
ee/spec/frontend/boards/stores/getters_spec.js
ee/spec/frontend/boards/stores/getters_spec.js
+2
-2
ee/spec/lib/gitlab/tree_summary_spec.rb
ee/spec/lib/gitlab/tree_summary_spec.rb
+2
-2
ee/spec/models/ee/list_spec.rb
ee/spec/models/ee/list_spec.rb
+5
-1
ee/spec/models/ee/namespace_spec.rb
ee/spec/models/ee/namespace_spec.rb
+0
-16
ee/spec/models/group_member_spec.rb
ee/spec/models/group_member_spec.rb
+3
-3
ee/spec/models/license_spec.rb
ee/spec/models/license_spec.rb
+0
-20
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+0
-8
ee/spec/policies/project_policy_spec.rb
ee/spec/policies/project_policy_spec.rb
+0
-9
ee/spec/requests/api/boards_spec.rb
ee/spec/requests/api/boards_spec.rb
+1
-1
ee/spec/services/boards/lists/update_service_spec.rb
ee/spec/services/boards/lists/update_service_spec.rb
+1
-1
ee/spec/services/ee/boards/lists/create_service_spec.rb
ee/spec/services/ee/boards/lists/create_service_spec.rb
+2
-2
ee/spec/services/personal_access_tokens/revoke_invalid_tokens_spec.rb
...ices/personal_access_tokens/revoke_invalid_tokens_spec.rb
+6
-2
ee/spec/support/shared_examples/features/insights_shared_examples.rb
...port/shared_examples/features/insights_shared_examples.rb
+0
-13
ee/spec/workers/personal_access_tokens/groups/policy_worker_spec.rb
...rkers/personal_access_tokens/groups/policy_worker_spec.rb
+4
-0
ee/spec/workers/personal_access_tokens/instance/policy_worker_spec.rb
...ers/personal_access_tokens/instance/policy_worker_spec.rb
+1
-0
lib/feature/shared.rb
lib/feature/shared.rb
+0
-12
spec/bin/feature_flag_spec.rb
spec/bin/feature_flag_spec.rb
+2
-9
spec/frontend/integrations/edit/components/integration_form_spec.js
...end/integrations/edit/components/integration_form_spec.js
+0
-21
spec/frontend/vue_shared/gl_feature_flags_plugin_spec.js
spec/frontend/vue_shared/gl_feature_flags_plugin_spec.js
+8
-0
spec/lib/feature_spec.rb
spec/lib/feature_spec.rb
+1
-1
No files found.
app/assets/javascripts/boards/index.js
View file @
0c0dbb85
...
...
@@ -351,7 +351,7 @@ export default () => {
toggleFocusMode
(
ModalStore
,
boardsStore
);
toggleLabels
();
if
(
gon
.
features
?.
swimlanes
)
{
if
(
gon
.
licensed_
features
?.
swimlanes
)
{
toggleEpicsSwimlanes
();
}
...
...
app/assets/javascripts/integrations/edit/components/integration_form.vue
View file @
0c0dbb85
...
...
@@ -61,9 +61,6 @@ export default {
this
.
customState
.
integrationLevel
===
integrationLevels
.
GROUP
);
},
showJiraIssuesFields
()
{
return
this
.
isJira
&&
this
.
glFeatures
.
jiraIssuesIntegration
;
},
showReset
()
{
return
this
.
isInstanceOrGroupLevel
&&
this
.
propsSource
.
resetPath
;
},
...
...
@@ -129,7 +126,7 @@ export default {
v-bind="field"
/>
<jira-issues-fields
v-if=
"
showJiraIssuesFields
"
v-if=
"
isJira
"
:key=
"`$
{currentKey}-jira-issues-fields`"
v-bind="propsSource.jiraIssuesProps"
/>
...
...
app/assets/javascripts/issues_list/index.js
View file @
0c0dbb85
...
...
@@ -36,7 +36,7 @@ function mountJiraIssuesListApp() {
}
function
mountIssuablesListApp
()
{
if
(
!
gon
.
features
?.
vueIssuablesList
&&
!
gon
.
features
?.
jiraIssuesIntegration
)
{
if
(
!
gon
.
features
?.
vueIssuablesList
)
{
return
;
}
...
...
app/assets/javascripts/vue_shared/gl_feature_flags_plugin.js
View file @
0c0dbb85
export
default
(
Vue
)
=>
{
Vue
.
mixin
({
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
,
}
||
{},
},
});
};
app/controllers/projects/services_controller.rb
View file @
0c0dbb85
...
...
@@ -12,8 +12,6 @@ class Projects::ServicesController < Projects::ApplicationController
before_action
:set_deprecation_notice_for_prometheus_service
,
only:
[
:edit
,
:update
]
before_action
:redirect_deprecated_prometheus_service
,
only:
[
:update
]
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
)
end
...
...
app/models/clusters/instance.rb
View file @
0c0dbb85
...
...
@@ -6,10 +6,6 @@ module Clusters
Clusters
::
Cluster
.
instance_type
end
def
feature_available?
(
feature
)
::
Feature
.
enabled?
(
feature
,
type: :licensed
,
default_enabled:
true
)
end
def
flipper_id
self
.
class
.
to_s
end
...
...
ee/app/assets/javascripts/boards/stores/getters.js
View file @
0c0dbb85
...
...
@@ -5,7 +5,7 @@ export default {
...
gettersCE
,
isSwimlanesOn
:
(
state
)
=>
{
return
Boolean
(
gon
?.
features
?.
swimlanes
&&
state
.
isShowingEpicsSwimlanes
);
return
Boolean
(
gon
?.
licensed_
features
?.
swimlanes
&&
state
.
isShowingEpicsSwimlanes
);
},
getIssuesByEpic
:
(
state
,
getters
)
=>
(
listId
,
epicId
)
=>
{
return
getters
...
...
ee/app/controllers/concerns/ee/boards_actions.rb
View file @
0c0dbb85
...
...
@@ -12,9 +12,9 @@ module EE
def
push_licensed_features
# 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_
frontend_feature_flag
(
:swimlanes
,
type: :licensed
,
default_enabled:
true
)
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
(
:wip_limits
)
if
parent
.
feature_available?
(
:wip_limits
)
push_
licensed_feature
(
:swimlanes
)
if
parent
.
feature_available?
(
:swimlanes
)
push_
licensed_feature
(
:issue_weights
)
if
parent
.
feature_available?
(
:issue_weights
)
end
end
end
ee/app/controllers/projects/integrations/jira/issues_controller.rb
View file @
0c0dbb85
...
...
@@ -16,7 +16,6 @@ module Projects
before_action
:check_issues_show_enabled!
,
only: :show
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
)
end
...
...
ee/app/models/ee/namespace.rb
View file @
0c0dbb85
...
...
@@ -143,9 +143,6 @@ module EE
# being licensed.
override
:feature_available?
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
Hash
.
new
do
|
h
,
f
|
h
[
f
]
=
load_feature_available
(
f
)
...
...
ee/app/models/ee/project.rb
View file @
0c0dbb85
...
...
@@ -784,9 +784,6 @@ module EE
end
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
Hash
.
new
do
|
h
,
f
|
h
[
f
]
=
load_licensed_feature_available
(
f
)
...
...
ee/app/models/license.rb
View file @
0c0dbb85
...
...
@@ -427,9 +427,6 @@ class License < ApplicationRecord
def
feature_available?
(
feature
)
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
)
end
...
...
ee/app/services/personal_access_tokens/revoke_invalid_tokens.rb
View file @
0c0dbb85
...
...
@@ -8,7 +8,8 @@ module PersonalAccessTokens
end
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
expiration_date
&&
user_affected?
...
...
ee/spec/controllers/boards/lists_controller_spec.rb
View file @
0c0dbb85
...
...
@@ -117,7 +117,7 @@ RSpec.describe Boards::ListsController do
context
'without licensed wip limits'
do
before
do
stub_
feature_flag
s
(
wip_limits:
false
)
stub_
licensed_feature
s
(
wip_limits:
false
)
end
it
'ignores max issue count'
do
...
...
@@ -141,7 +141,7 @@ RSpec.describe Boards::ListsController do
context
'without licensed wip limits'
do
before
do
stub_
feature_flag
s
(
wip_limits:
false
)
stub_
licensed_feature
s
(
wip_limits:
false
)
end
it
'ignores max issue count'
do
...
...
@@ -193,7 +193,7 @@ RSpec.describe Boards::ListsController do
context
'without licensed wip limits'
do
before
do
stub_
feature_flag
s
(
wip_limits:
false
)
stub_
licensed_feature
s
(
wip_limits:
false
)
end
it
'ignores limit metric setting'
do
...
...
@@ -467,7 +467,7 @@ RSpec.describe Boards::ListsController do
context
'when wip limits are not licensed'
do
before
do
stub_
feature_flag
s
(
wip_limits:
false
)
stub_
licensed_feature
s
(
wip_limits:
false
)
end
it
'fails to update max issue count with expected status'
do
...
...
ee/spec/features/boards/boards_spec.rb
View file @
0c0dbb85
...
...
@@ -215,7 +215,7 @@ RSpec.describe 'issue boards', :js do
login_as
(
user
)
end
context
'
W
hen license is available'
do
context
'
w
hen license is available'
do
let!
(
:label
)
{
create
(
:label
,
project:
project
,
name:
'Brount'
)
}
let!
(
:list
)
{
create
(
:list
,
board:
board
,
label:
label
,
position:
1
)
}
...
...
@@ -346,7 +346,7 @@ RSpec.describe 'issue boards', :js do
end
end
context
'
W
hen license is not available'
do
context
'
w
hen license is not available'
do
before
do
stub_licensed_features
(
wip_limits:
false
)
visit
project_boards_path
(
project
)
...
...
ee/spec/frontend/boards/components/board_content_spec.js
View file @
0c0dbb85
...
...
@@ -6,7 +6,7 @@ import { createStore } from '~/boards/stores';
describe
(
'
ee/BoardContent
'
,
()
=>
{
let
wrapper
;
let
store
;
window
.
gon
=
{
features
:
{}
};
window
.
gon
=
{
licensed_
features
:
{}
};
const
createComponent
=
()
=>
{
wrapper
=
shallowMount
(
BoardContent
,
{
...
...
@@ -30,19 +30,19 @@ describe('ee/BoardContent', () => {
});
afterEach
(()
=>
{
window
.
gon
.
features
=
{};
window
.
gon
.
licensed_
features
=
{};
wrapper
.
destroy
();
});
describe
.
each
`
featureFlag
| state | result
licenseEnabled
| state | result
${
true
}
|
${{
isShowingEpicsSwimlanes
:
true
}
} |
${
true
}
${
true
}
|
${{
isShowingEpicsSwimlanes
:
false
}
} |
${
false
}
${
false
}
|
${{
isShowingEpicsSwimlanes
:
true
}
} |
${
false
}
${
false
}
|
${{
isShowingEpicsSwimlanes
:
false
}
} |
${
false
}
`
(
'
with
featureFlag=$featureFlag and state=$state
'
,
({
featureFlag
,
state
,
result
})
=>
{
`
(
'
with
licenseEnabled=$licenseEnabled and state=$state
'
,
({
licenseEnabled
,
state
,
result
})
=>
{
beforeEach
(()
=>
{
gon
.
features
.
swimlanes
=
featureFlag
;
gon
.
licensed_features
.
swimlanes
=
licenseEnabled
;
Object
.
assign
(
store
.
state
,
state
);
createComponent
();
});
...
...
ee/spec/frontend/boards/stores/getters_spec.js
View file @
0c0dbb85
...
...
@@ -18,12 +18,12 @@ describe('EE Boards Store Getters', () => {
describe
(
'
isSwimlanesOn
'
,
()
=>
{
afterEach
(()
=>
{
window
.
gon
=
{
features
:
{}
};
window
.
gon
=
{
licensed_
features
:
{}
};
});
describe
(
'
when swimlanes feature is true
'
,
()
=>
{
beforeEach
(()
=>
{
window
.
gon
=
{
features
:
{
swimlanes
:
true
}
};
window
.
gon
=
{
licensed_
features
:
{
swimlanes
:
true
}
};
});
describe
(
'
when isShowingEpicsSwimlanes is true
'
,
()
=>
{
...
...
ee/spec/lib/gitlab/tree_summary_spec.rb
View file @
0c0dbb85
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
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
(
:user
)
{
create
(
:user
)
}
...
...
@@ -21,7 +21,7 @@ RSpec.describe Gitlab::TreeSummary do
context
'when file_locks feature is unavailable'
do
before
do
stub_
feature_flag
s
(
file_locks:
false
)
stub_
licensed_feature
s
(
file_locks:
false
)
end
it
'does not fill lock labels'
do
...
...
ee/spec/models/ee/list_spec.rb
View file @
0c0dbb85
...
...
@@ -101,6 +101,10 @@ RSpec.describe List do
let!
(
:list2
)
{
create
(
:list
,
board:
board2
)
}
context
'with enabled wip_limits'
do
before
do
stub_licensed_features
(
wip_limits:
true
)
end
it
'returns the expected values'
do
expect
(
list1
.
wip_limits_available?
).
to
be_truthy
expect
(
list2
.
wip_limits_available?
).
to
be_truthy
...
...
@@ -109,7 +113,7 @@ RSpec.describe List do
context
'with disabled wip_limits'
do
before
do
stub_
feature_flag
s
(
wip_limits:
false
)
stub_
licensed_feature
s
(
wip_limits:
false
)
end
it
'returns the expected values'
do
...
...
ee/spec/models/ee/namespace_spec.rb
View file @
0c0dbb85
...
...
@@ -501,22 +501,6 @@ RSpec.describe Namespace do
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
describe
'#feature_available?'
do
...
...
ee/spec/models/group_member_spec.rb
View file @
0c0dbb85
...
...
@@ -254,7 +254,7 @@ RSpec.describe GroupMember do
end
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
(
:user
)
{
create
(
:user
)
}
...
...
@@ -350,8 +350,8 @@ RSpec.describe GroupMember do
expect
(
WebMock
).
not_to
have_requested
(
:post
,
group_hook
.
url
)
end
it
'does not execute webhooks if
feature flag
is disabled'
do
stub_
feature_flag
s
(
group_webhooks:
false
)
it
'does not execute webhooks if
license
is disabled'
do
stub_
licensed_feature
s
(
group_webhooks:
false
)
group
.
add_guest
(
user
)
...
...
ee/spec/models/license_spec.rb
View file @
0c0dbb85
...
...
@@ -874,26 +874,6 @@ RSpec.describe License do
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
def
build_license_with_add_ons
(
add_ons
,
plan:
nil
)
...
...
ee/spec/models/project_spec.rb
View file @
0c0dbb85
...
...
@@ -883,14 +883,6 @@ RSpec.describe Project do
it
'returns true'
do
is_expected
.
to
eq
(
true
)
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
context
'not allowed by Plan License but project and namespace are public'
do
...
...
ee/spec/policies/project_policy_spec.rb
View file @
0c0dbb85
...
...
@@ -1084,7 +1084,6 @@ RSpec.describe ProjectPolicy do
let
(
:current_user
)
{
public_send
(
role
)
if
role
}
before
do
stub_feature_flags
(
feature
=>
true
)
stub_licensed_features
(
feature
=>
true
)
enable_admin_mode!
(
current_user
)
if
admin_mode
end
...
...
@@ -1098,14 +1097,6 @@ RSpec.describe ProjectPolicy do
it
{
is_expected
.
to
be_disallowed
(
policy
)
}
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
...
...
ee/spec/requests/api/boards_spec.rb
View file @
0c0dbb85
...
...
@@ -74,7 +74,7 @@ RSpec.describe API::Boards do
context
'without WIP limits license'
do
before
do
stub_
feature_flag
s
(
wip_limits:
false
)
stub_
licensed_feature
s
(
wip_limits:
false
)
get
api
(
url
,
user
)
end
...
...
ee/spec/services/boards/lists/update_service_spec.rb
View file @
0c0dbb85
...
...
@@ -154,7 +154,7 @@ RSpec.describe 'EE::Boards::Lists::UpdateService' do
context
'without licensed wip limits'
do
before
do
stub_
feature_flag
s
(
wip_limits:
false
)
stub_
licensed_feature
s
(
wip_limits:
false
)
end
it
'does not update the list even if max_issue_count is given'
do
...
...
ee/spec/services/ee/boards/lists/create_service_spec.rb
View file @
0c0dbb85
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Boards
::
Lists
::
CreateService
do
describe
'#execute'
do
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
(
:user
)
{
create
(
:user
)
}
...
...
@@ -106,7 +106,7 @@ RSpec.describe Boards::Lists::CreateService do
describe
'#create_list_attributes'
do
shared_examples
'attribute provider for list creation'
do
before
do
stub_
feature_flag
s
(
wip_limits:
wip_limits_enabled
)
stub_
licensed_feature
s
(
wip_limits:
wip_limits_enabled
)
end
where
(
:params
,
:expected_max_issue_count
,
:expected_max_issue_weight
,
:expected_limit_metric
)
do
...
...
ee/spec/services/personal_access_tokens/revoke_invalid_tokens_spec.rb
View file @
0c0dbb85
...
...
@@ -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_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
it
'does not send any notification to user'
do
expect
(
Notify
).
not_to
receive
(
:policy_revoked_personal_access_tokens_email
).
and_call_original
...
...
@@ -103,9 +107,9 @@ RSpec.describe PersonalAccessTokens::RevokeInvalidTokens do
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
stub_
feature_flag
s
(
personal_access_token_expiration_policy:
false
)
stub_
licensed_feature
s
(
personal_access_token_expiration_policy:
false
)
end
it_behaves_like
'user does not receive revoke notification email'
...
...
ee/spec/support/shared_examples/features/insights_shared_examples.rb
View file @
0c0dbb85
...
...
@@ -64,23 +64,10 @@ RSpec.shared_examples 'Insights page' do
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
context
'without correct license'
do
before
do
stub_feature_flags
(
insights:
false
)
stub_licensed_features
(
insights:
false
)
end
...
...
ee/spec/workers/personal_access_tokens/groups/policy_worker_spec.rb
View file @
0c0dbb85
...
...
@@ -21,6 +21,10 @@ RSpec.describe PersonalAccessTokens::Groups::PolicyWorker, type: :worker do
described_class
.
new
.
perform
(
group
.
id
)
end
before
do
stub_licensed_features
(
personal_access_token_expiration_policy:
true
)
end
it_behaves_like
'an idempotent worker'
do
let
(
:job_args
)
{
[
group
.
id
]
}
...
...
ee/spec/workers/personal_access_tokens/instance/policy_worker_spec.rb
View file @
0c0dbb85
...
...
@@ -9,6 +9,7 @@ RSpec.describe PersonalAccessTokens::Instance::PolicyWorker, type: :worker do
before
do
stub_application_setting
(
max_personal_access_token_lifetime:
instance_limit
)
stub_licensed_features
(
personal_access_token_expiration_policy:
true
)
end
context
'when a token is valid'
do
...
...
lib/feature/shared.rb
View file @
0c0dbb85
...
...
@@ -37,18 +37,6 @@ class Feature
push_frontend_feature_flag(:my_ops_flag, project, type: :ops)
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:
{
description:
'Short lived, used specifically to run A/B/n experiments.'
,
optional:
true
,
...
...
spec/bin/feature_flag_spec.rb
View file @
0c0dbb85
...
...
@@ -265,16 +265,9 @@ RSpec.describe 'bin/feature-flag' do
end
describe
'.read_ee_only'
do
where
(
:type
,
:is_ee_only
)
do
:development
|
false
:licensed
|
true
end
with_them
do
let
(
:options
)
{
OpenStruct
.
new
(
name:
'foo'
,
type:
type
)
}
let
(
:options
)
{
OpenStruct
.
new
(
name:
'foo'
,
type: :development
)
}
it
{
expect
(
described_class
.
read_ee_only
(
options
)).
to
eq
(
is_ee_only
)
}
end
it
{
expect
(
described_class
.
read_ee_only
(
options
)).
to
eq
(
false
)
}
end
end
end
spec/frontend/integrations/edit/components/integration_form_spec.js
View file @
0c0dbb85
...
...
@@ -207,27 +207,6 @@ describe('IntegrationForm', () => {
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
'
,
()
=>
{
...
...
spec/frontend/vue_shared/gl_feature_flags_plugin_spec.js
View file @
0c0dbb85
...
...
@@ -11,6 +11,10 @@ describe('GitLab Feature Flags Plugin', () => {
aFeature
:
true
,
bFeature
:
false
,
},
licensed_features
:
{
cFeature
:
true
,
dFeature
:
false
,
},
};
localVue
.
use
(
GlFeatureFlags
);
...
...
@@ -25,6 +29,8 @@ describe('GitLab Feature Flags Plugin', () => {
expect
(
wrapper
.
vm
.
glFeatures
).
toEqual
({
aFeature
:
true
,
bFeature
:
false
,
cFeature
:
true
,
dFeature
:
false
,
});
});
...
...
@@ -37,6 +43,8 @@ describe('GitLab Feature Flags Plugin', () => {
expect
(
wrapper
.
vm
.
glFeatures
).
toEqual
({
aFeature
:
true
,
bFeature
:
false
,
cFeature
:
true
,
dFeature
:
false
,
});
});
});
spec/lib/feature_spec.rb
View file @
0c0dbb85
...
...
@@ -269,7 +269,7 @@ RSpec.describe Feature, stub_feature_flags: false do
end
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/
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment