diff options
author | Stan Hu <stanhu@gmail.com> | 2019-07-16 20:40:42 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-07-16 20:40:42 +0000 |
commit | ef3f6386421ad382ddf989523c00a4385b4d0431 (patch) | |
tree | 87a79b568c5a28914895d9ffac87a9d3db235ea1 /lib/tasks | |
parent | b545cf4060101ea3490f0c05d4e69602a0e86879 (diff) | |
parent | ff0654b0b46df4d143c3ec6bb4fa92da34745e44 (diff) | |
download | gitlab-ce-ef3f6386421ad382ddf989523c00a4385b4d0431.tar.gz |
Merge branch 'jc-fix-rugged-feature-flag-rake' into 'master'
Add unset_rugged rake task
Closes #64441
See merge request gitlab-org/gitlab-ce!30636
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/features.rake | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/tasks/gitlab/features.rake b/lib/tasks/gitlab/features.rake index d88bcca0819..9cf568c07fe 100644 --- a/lib/tasks/gitlab/features.rake +++ b/lib/tasks/gitlab/features.rake @@ -10,14 +10,22 @@ namespace :gitlab do set_rugged_feature_flags(false) puts 'All Rugged feature flags were disabled.' end + + task unset_rugged: :environment do + set_rugged_feature_flags(nil) + puts 'All Rugged feature flags were unset.' + end end def set_rugged_feature_flags(status) Gitlab::Git::RuggedImpl::Repository::FEATURE_FLAGS.each do |flag| - if status - Feature.enable(flag) - else + case status + when nil Feature.get(flag).remove + when true + Feature.enable(flag) + when false + Feature.disable(flag) end end end |