chore(flipper): enable strict mode and add missing features

This commit is contained in:
Colin Darie 2024-03-02 16:33:25 +01:00
parent dbf93b2ee4
commit 2d22737823
No known key found for this signature in database
GPG key ID: 8C76CADD40253590

View file

@ -2,11 +2,12 @@
# we can add new features from the Web UI. However when the new DB is created
# this will immediately migrate the default features to be controlled.
def setup_features(features)
features.each do |feature|
if !Flipper.exist?(feature)
# Disable feature by default
Flipper.disable(feature)
end
existing = Flipper.preload(features).map { _1.name.to_sym }
missing = features - existing
missing.each do |feature|
# Feature is disabled by default
Flipper.add(feature.to_s)
end
end
@ -14,13 +15,17 @@ end
features = [
:administrateur_web_hook,
:api_particulier,
:dossier_pdf_vide,
:hide_instructeur_email,
:procedure_routage_api,
:groupe_instructeur_api_hack,
:attestation_v2,
:blocking_pending_correction,
:cojo_type_de_champ,
:dossier_pdf_vide,
:engagement_juridique_type_de_champ,
:export_order_by_revision,
:expression_reguliere_type_de_champ,
:groupe_instructeur_api_hack,
:hide_instructeur_email,
:sva,
:blocking_pending_correction
:switch_domain
]
def database_exists?
@ -35,3 +40,7 @@ ActiveSupport.on_load(:active_record) do
setup_features(features)
end
end
Rails.application.configure do
config.flipper.strict = Rails.env.development?
end