diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-10 09:08:27 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-10 09:08:27 +0000 |
commit | 1385b54a3e44a90a463d4975bd639089be056778 (patch) | |
tree | 4ba1fbd8e29115ba21472d5ebc88dfa6d9d637a4 /lib | |
parent | 8d8b960cece096fb6af9ada2ca8c88fc48b5476c (diff) | |
download | gitlab-ce-1385b54a3e44a90a463d4975bd639089be056778.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/feature/shared.rb | 13 | ||||
-rw-r--r-- | lib/gitlab/background_migration/populate_vulnerability_historical_statistics.rb | 14 |
2 files changed, 27 insertions, 0 deletions
diff --git a/lib/feature/shared.rb b/lib/feature/shared.rb index 53f027e3893..c06f699ef27 100644 --- a/lib/feature/shared.rb +++ b/lib/feature/shared.rb @@ -8,12 +8,14 @@ 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, project) Feature.enabled?(:my_feature_flag, project, type: :development) @@ -24,10 +26,21 @@ class Feature 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 diff --git a/lib/gitlab/background_migration/populate_vulnerability_historical_statistics.rb b/lib/gitlab/background_migration/populate_vulnerability_historical_statistics.rb new file mode 100644 index 00000000000..a0c89cc4664 --- /dev/null +++ b/lib/gitlab/background_migration/populate_vulnerability_historical_statistics.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Gitlab + module BackgroundMigration + # This class creates/updates those project historical vulnerability statistics + # that haven't been created nor initialized. It should only be executed in EE. + class PopulateVulnerabilityHistoricalStatistics + def perform(project_ids) + end + end + end +end + +Gitlab::BackgroundMigration::PopulateVulnerabilityHistoricalStatistics.prepend_if_ee('EE::Gitlab::BackgroundMigration::PopulateVulnerabilityHistoricalStatistics') |