From 64feb904b13034e0862e3afed489b4b4eb2600da Mon Sep 17 00:00:00 2001 From: Gabriel Mechali Date: Thu, 6 Feb 2025 13:28:48 -0800 Subject: [PATCH] [Feature Flags] Give custom DC their own checked in flags. (#4934) Creates a local file with the feature flags to be used in Custom DC. Sets autocomplete and place page flags to be disabled (note that the screenshot had place experiment enabled, but it's now disabled). Starts reading the flags for custom DC from the local file, and injects them in the custom DC base.html file. See how local custom DC now has the scroll to top button: https://screenshot.googleplex.com/7dk4eim4LALCuVL --- .../config/feature_flag_configs/custom.json | 24 +++++++++++++++++++ server/lib/util.py | 2 +- server/templates/custom_dc/custom/base.html | 3 +++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 server/config/feature_flag_configs/custom.json diff --git a/server/config/feature_flag_configs/custom.json b/server/config/feature_flag_configs/custom.json new file mode 100644 index 0000000000..ae0dae4511 --- /dev/null +++ b/server/config/feature_flag_configs/custom.json @@ -0,0 +1,24 @@ +[{ + "name": "autocomplete", + "enabled": false, + "owner": "gmechali", + "description": "Feature flag to enable place autocomplete." +}, +{ + "name": "dev_place_experiment", + "enabled": false, + "owner": "gmechali", + "description": "Feature flag to enable the V2 place page only for the experiment places." +}, +{ + "name": "dev_place_ga", + "enabled": false, + "owner": "dwnoble", + "description": "Feature flag to enable the V2 Place page to GA." +}, +{ + "name": "scroll_to_top_button", + "enabled": true, + "owner": "gmechali", + "description": "Feature flag to enable the scroll to top button on the explore and place pages." +}] \ No newline at end of file diff --git a/server/lib/util.py b/server/lib/util.py index 2f7fd8ff5b..276fbcff61 100644 --- a/server/lib/util.py +++ b/server/lib/util.py @@ -431,7 +431,7 @@ def load_feature_flags_from_gcs(environment: str): def load_fallback_feature_flags(environment: str): """Loads the fallback feature flags into the app config. We fallback to checked in flag configs per environment.""" environments_with_local_files = set( - ['local', 'autopush', 'dev', 'staging', 'production']) + ['local', 'autopush', 'dev', 'staging', 'production', 'custom']) testing_environments = set(['integration_test', 'test', 'webdriver']) if environment in testing_environments: diff --git a/server/templates/custom_dc/custom/base.html b/server/templates/custom_dc/custom/base.html index 062233094b..b141fe07bd 100644 --- a/server/templates/custom_dc/custom/base.html +++ b/server/templates/custom_dc/custom/base.html @@ -49,6 +49,9 @@ }); {% endif %} + {{ title }} - Custom Data Commons