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
30fa7da1
Commit
30fa7da1
authored
Nov 03, 2021
by
Zhu Shuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add jh only feature flag
parent
3a2cd1e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
rubocop/cop/gitlab/mark_used_feature_flags.rb
rubocop/cop/gitlab/mark_used_feature_flags.rb
+8
-1
scripts/used-feature-flags
scripts/used-feature-flags
+15
-1
No files found.
rubocop/cop/gitlab/mark_used_feature_flags.rb
View file @
30fa7da1
...
...
@@ -255,10 +255,17 @@ module RuboCop
]
# For EE additionally process `ee/` feature flags
if
File
.
exist?
(
File
.
expand_path
(
'../../../ee/app/models/license.rb'
,
__dir__
))
&&
!
%w[true 1]
.
include?
(
ENV
[
'FOSS_ONLY'
].
to_s
)
is_ee
=
File
.
exist?
(
File
.
expand_path
(
'../../../ee/app/models/license.rb'
,
__dir__
))
&&
!
%w[true 1]
.
include?
(
ENV
[
'FOSS_ONLY'
].
to_s
)
if
is_ee
flags_paths
<<
'ee/config/feature_flags/**/*.yml'
end
# For JH additionally process `jh/` feature flags
is_jh
=
is_ee
&&
Dir
.
exist?
(
File
.
expand_path
(
'../../../jh'
,
__dir__
))
&&
!
%w[true 1]
.
include?
(
ENV
[
'EE_ONLY'
].
to_s
)
if
is_jh
flags_paths
<<
'jh/config/feature_flags/**/*.yml'
end
flags_paths
.
each_with_object
([])
do
|
flags_path
,
memo
|
flags_path
=
File
.
expand_path
(
"../../../
#{
flags_path
}
"
,
__dir__
)
Dir
.
glob
(
flags_path
).
each
do
|
path
|
...
...
scripts/used-feature-flags
View file @
30fa7da1
...
...
@@ -27,7 +27,8 @@ flags_paths = [
]
# For EE additionally process `ee/` feature flags
if
File
.
exist?
(
'ee/app/models/license.rb'
)
&&
!
%w[true 1]
.
include?
(
ENV
[
'FOSS_ONLY'
].
to_s
)
is_ee
=
File
.
exist?
(
'ee/app/models/license.rb'
)
&&
!
%w[true 1]
.
include?
(
ENV
[
'FOSS_ONLY'
].
to_s
)
if
is_ee
flags_paths
<<
'ee/config/feature_flags/**/*.yml'
# Geo feature flags are constructed dynamically and there's no explicit checks in the codebase so we mark all
...
...
@@ -41,6 +42,19 @@ if File.exist?('ee/app/models/license.rb') && !%w[true 1].include?(ENV['FOSS_ONL
end
end
# For JH additionally process `jh/` feature flags
is_jh
=
is_ee
&&
Dir
.
exist?
(
'jh'
)
&&
!
%w[true 1]
.
include?
(
ENV
[
'EE_ONLY'
].
to_s
)
if
is_jh
flags_paths
<<
'jh/config/feature_flags/**/*.yml'
Dir
.
glob
(
'jh/app/replicators/geo/*_replicator.rb'
).
each_with_object
(
Set
.
new
)
do
|
path
,
memo
|
replicator_name
=
File
.
basename
(
path
,
'.rb'
)
feature_flag_name
=
"geo_
#{
replicator_name
.
delete_suffix
(
'_replicator'
)
}
_replication"
FileUtils
.
touch
(
File
.
join
(
'tmp'
,
'feature_flags'
,
"
#{
feature_flag_name
}
.used"
))
end
end
all_flags
=
{}
additional_flags
=
Set
.
new
...
...
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