Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 18:44:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 18:44:42 +0300
commit4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch)
tree5423a1c7516cffe36384133ade12572cf709398d /lib/feature
parente570267f2f6b326480d284e0164a6464ba4081bc (diff)
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'lib/feature')
-rw-r--r--lib/feature/active_support_cache_store_adapter.rb9
-rw-r--r--lib/feature/definition.rb4
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/feature/active_support_cache_store_adapter.rb b/lib/feature/active_support_cache_store_adapter.rb
index ae2d623abe1..431f1169a86 100644
--- a/lib/feature/active_support_cache_store_adapter.rb
+++ b/lib/feature/active_support_cache_store_adapter.rb
@@ -4,18 +4,27 @@
# This class was already nested this way before moving to a separate file
class Feature
class ActiveSupportCacheStoreAdapter < Flipper::Adapters::ActiveSupportCacheStore
+ # This patch represents https://github.com/jnunemaker/flipper/pull/512. In
+ # Flipper 0.21.0 and later, we can remove this and just pass `write_through:
+ # true` to the constructor in `Feature.build_flipper_instance`.
+
+ extend ::Gitlab::Utils::Override
+
+ override :enable
def enable(feature, gate, thing)
result = @adapter.enable(feature, gate, thing)
@cache.write(key_for(feature.key), @adapter.get(feature), @write_options)
result
end
+ override :disable
def disable(feature, gate, thing)
result = @adapter.disable(feature, gate, thing)
@cache.write(key_for(feature.key), @adapter.get(feature), @write_options)
result
end
+ override :remove
def remove(feature)
result = @adapter.remove(feature)
@cache.delete(FeaturesKey)
diff --git a/lib/feature/definition.rb b/lib/feature/definition.rb
index 8d9b2fa5234..cd2f5cb07a2 100644
--- a/lib/feature/definition.rb
+++ b/lib/feature/definition.rb
@@ -153,7 +153,7 @@ class Feature
definition.deep_symbolize_keys!
self.new(path, definition).tap(&:validate!)
- rescue => e
+ rescue StandardError => e
raise Feature::InvalidFeatureFlagError, "Invalid definition for `#{path}`: #{e.message}"
end
@@ -185,4 +185,4 @@ class Feature
end
end
-Feature::Definition.prepend_if_ee('EE::Feature::Definition')
+Feature::Definition.prepend_mod_with('Feature::Definition')