Skip to content

Commit

Permalink
chore: adding feature flags json list in env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
huniafatima-arbi committed Jan 16, 2025
1 parent e679a5b commit cf42edf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tubular/scripts/frontend_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,17 @@ def get_app_config(self):
app_config = self.common_cfg.get('APP_CONFIG', {})
app_config.update(self.env_cfg.get('APP_CONFIG', {}))
app_config['APP_VERSION'] = self.get_version_commit_sha()
app_config['FEATURE_FLAGS'] = self.get_feature_flags()
if not app_config:
self.LOG('Config variables do not exist for app {}.'.format(self.app_name))
return app_config

def get_feature_flags(self):
""" Accesses the feature flags from config and JSON encodes it to be placed in env variables """
feature_flags = self.env_cfg.get('FEATURE_FLAGS', {})
feature_flag_json = json.dumps(feature_flags)
return feature_flag_json

def get_version_commit_sha(self):
""" Returns the commit SHA of the current HEAD """
return LocalGitAPI(Repo(self.app_name)).get_head_sha()
Expand Down

0 comments on commit cf42edf

Please sign in to comment.