diff options
author | John Cai <jcai@gitlab.com> | 2019-07-11 09:53:38 -0700 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2019-07-11 09:53:41 -0700 |
commit | ff0654b0b46df4d143c3ec6bb4fa92da34745e44 (patch) | |
tree | 3c242a1a500be4ca2e984af7d4b88fa2abee3b15 /lib | |
parent | a06107582f1271d2724f83d8606488b78cf03144 (diff) | |
download | gitlab-ce-ff0654b0b46df4d143c3ec6bb4fa92da34745e44.tar.gz |
Add unset_rugged rake taskjc-fix-rugged-feature-flag-rake
Adds an unset_rugged rake task that unsets all rugged feature flags.
Also fixes the existing disable_rugged task to have it explicitly
disable feature flags instead of just unsetting them.
Diffstat (limited to 'lib')
-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 |