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 14, 2025
1 parent e679a5b commit 9fc2c6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tubular/scripts/frontend_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ def ensure_wrapped_in_quotes(value) -> str:
else:
return f"'{string_value}'"


if __name__ == "__main__":
frontend_build() # pylint: disable=no-value-for-parameter
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 9fc2c6c

Please sign in to comment.