SE-3222 Extend EDXAPP_SITE_CONFIGURATION with default values
Created by: s0b0lev
This PR introduce new merge function for EDXAPP_SITE_CONFIGURATION
settings.
Testing instructions This instruction is meant to be run locally:
- Create a new OpenEDXInstance
- Open OCIM django shell
make shell
- Get created instance:
>>> instance = OpenEdXInstance.objects.last()
- Create new appserver (without spawning actual deployment, we are care only about app server final configuration)
>>> instance._create_owned_appserver()
- Open UI, check that
Combined ansible vars -> EDXAPP_SITE_CONFIGURATION
looks like this:
EDXAPP_SITE_CONFIGURATION:
- values:
CONTACT_US_CUSTOM_LINK: /contact
- Open instance settings (django admin page
http://localhost:5000/admin/instance/openedxinstance/
) - Update
Configuration extra settings
:
DEMO_CREATE_STAFF_USER: false
SANDBOX_ENABLE_CERTIFICATES: false
demo_test_users: []
EDXAPP_SITE_CONFIGURATION:
- values:
CONTACT_US_CUSTOM_LINK: /override-contact-us-link
TEST_VAR: /test
- Repeat step 4
- Open UI, check that
Combined ansible vars -> EDXAPP_SITE_CONFIGURATION
looks like this:
EDXAPP_SITE_CONFIGURATION:
- values:
CONTACT_US_CUSTOM_LINK: /override-contact-us-link
TEST_VAR: /test
Possible edge scenarios to verify:
-
Appserver provisioned with default EDXAPP_SITE_CONFIGURATION
-
Appserver provisioned with additional Configuration extra settings
-
Appserver prodivioned with overridden default for EDXAPP_SITE_CONFIGURATION (for example: CONTACT_US_CUSTOM_LINK)
Author notes @nizarmah I am sorry for such large instruction, but this is the only way to verify it works. Feel free to ask any questions or clarify anything you need for this review.
Thanks!