summaryrefslogtreecommitdiff
path: root/lib/feature/shared.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-19 01:45:44 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-19 01:45:44 +0000
commit85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch)
tree9160f299afd8c80c038f08e1545be119f5e3f1e1 /lib/feature/shared.rb
parent15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff)
downloadgitlab-ce-85dc423f7090da0a52c73eb66faf22ddb20efff9.tar.gz
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'lib/feature/shared.rb')
-rw-r--r--lib/feature/shared.rb27
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/feature/shared.rb b/lib/feature/shared.rb
index 14efbb07100..c06f699ef27 100644
--- a/lib/feature/shared.rb
+++ b/lib/feature/shared.rb
@@ -8,15 +8,38 @@ class Feature
module Shared
# optional: defines if a on-disk definition is required for this feature flag type
# rollout_issue: defines if `bin/feature-flag` asks for rollout issue
+ # default_enabled: defines a default state of a feature flag when created by `bin/feature-flag`
# example: usage being shown when exception is raised
TYPES = {
development: {
description: 'Short lived, used to enable unfinished code to be deployed',
optional: true,
rollout_issue: true,
+ default_enabled: false,
example: <<-EOS
- Feature.enabled?(:my_feature_flag)
- Feature.enabled?(:my_feature_flag, type: :development)
+ Feature.enabled?(:my_feature_flag, project)
+ Feature.enabled?(:my_feature_flag, project, type: :development)
+ push_frontend_feature_flag?(:my_feature_flag, project)
+ EOS
+ },
+ ops: {
+ description: "Long-lived feature flags that control operational aspects of GitLab's behavior",
+ optional: true,
+ rollout_issue: false,
+ default_enabled: false,
+ example: <<-EOS
+ Feature.enabled?(:my_ops_flag, type: ops)
+ push_frontend_feature_flag?(:my_ops_flag, project, type: :ops)
+ EOS
+ },
+ licensed: {
+ description: 'Permanent feature flags used to temporarily disable licensed features.',
+ optional: true,
+ rollout_issue: false,
+ default_enabled: true,
+ example: <<-EOS
+ project.feature_available?(:my_licensed_feature)
+ namespace.feature_available?(:my_licensed_feature)
EOS
}
}.freeze