-
Notifications
You must be signed in to change notification settings - Fork 262
Open
Labels
Description
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Current behavior
Currently, Studio is configured to use one backend for the curriculum automation API (Recommendations) which uses the default URL prefix /stable.
Desired behavior
When Studio is deployed to our non-production servers, in should attempt to use an unstable version of the curriculum automation API, but fallback to the stable version if it cannot connect to the unstable version. This should occur through backends that use those respective URL prefixes.
- A new backend class
CompositeBackendshould be created which should:- essentially implement the composite OOP pattern
- accept a list of backends in its constructor
- implement the same interface as
Backend - choose the first backend from its list when its
connectmethod is called, based on its Okay response - use the chosen backend for all other requests
- The backend factory
RecommendationsBackendFactoryshould:- maintain its current implementation if Studio is in production mode (
settings.SITE_ID == settings.PRODUCTION_SITE_ID) - otherwise create a
CompositeBackendwith 2 child backends, one with an/unstableURL prefix and another with the default/stableprefix (in that order)
- maintain its current implementation if Studio is in production mode (
Value add
Allows us to test improvements to the curriculum automation API on our non-production servers, prior to replacing the stable endpoint.
