appsembler / figures

Reporting and data retrieval app for Open edX
MIT License
44 stars 37 forks source link

Update how Figures handles missing `settings.ENV_VAR['FIGURES']` #456

Open johnbaldwin opened 2 years ago

johnbaldwin commented 2 years ago

@bryanlandia made a comment to not use bracket notation for settings.ENV_VAR['FIGURES']

https://github.com/appsembler/figures/pull/452#discussion_r856374217

This bracket notation is used throughout Figures and if Figures is instantiated as an Open edX plugin, it will always exist. See here: https://github.com/appsembler/figures/blob/main/figures/settings/lms_production.py#L127

So I created this card to note this topic was raised and to provide a location to discuss improving the architecture.

A couple of considerations to seed conversation:

  1. What if Figures ran as a standalone service, as a Django reusable app on a Django server that is not Open edX (edx-platform)? What should the configuration look like?
  2. How should we improve Figures Open edX plug-in settings? For example, should Figures automagically fill in defaults into settings.ENV_TOKENS['FIGURES']. Given prior conversations on Figures plugin setting defaults, IIRC @OmarIthawi was against this
  3. Perhaps we implement a module/function or class to serve as "the source of truth" for Figures settings and this module or class serves as an adapter to the Django site upon which Figures runs. Consider what this may mean for running on Open edX and the existing figures.settings.lms_production module