Ensure LMS_ROOT_URL is defined in i18n and assets settings modules#1256
Ensure LMS_ROOT_URL is defined in i18n and assets settings modules#1256kdmccormick merged 2 commits intooverhangio:mainfrom
Conversation
When running the management commands related to translations and static assets in `tutor/templates/build/openedx/Dockerfile`, LMS_ROOT_URL needs to have a valid value, otherwise the build will fail. Tutor has relied on there being a valid value for LMS_ROOT_URL present in `lms/envs/common.py` and `cms/envs/common.py`, but upcoming changes to edx-platform (#37045) will create the need to ensure LMS_ROOT_URL has a valid value.
|
@kdmccormick could you give this a look over? |
|
I think there's a misunderstanding. Asset compilation and translation collection is happening at build time. The LMS root url should only be used at runtime. If not, then it means that we will no longer be able to provide Docker images that are usable by everyone. Images pushed to the Docker registry should not include any personal detail of any specific platform. If static assets or translation files include hard-coded references to the LMS root url, then they will no longer work for everyone. AFAIU we need to revert this change in edx-platform. |
edx-platform #37045 has not been merged into Currently, in Correct me if I'm wrong, but Although, So, my take of it all is that the |
|
OK I think a "good" fix would be to define LMS_ROOT_URL in tutor's i18n.py and assets.py, but we cannot use a value that differs from one installation to another, for the reasons highlighted above. In particular, having different py setting files, would cause cache busting during build, which would considerably slow down So I suggest something like: |
I hadn't thought of that, good point.
Until we're able to fix the unnecessary dependency on LMS_ROOT_URL upstream, this sounds like a good compromise to me. I suggest leaving a comment to explain that this is just a dummy value with no bearing on the static asset or i18n build steps. |
|
I merged without a changelog entry because I don't think operators/devs will care about this change, but if you disagree Régis let me know and we can create a follow-up PR. |
When running the management commands related to translations and static assets in
tutor/templates/build/openedx/Dockerfile,LMS_ROOT_URLneeds to have a valid value, otherwise the build will fail.Tutor has relied on there being a valid value for
LMS_ROOT_URLpresent inlms/envs/common.pyandcms/envs/common.py, but upcoming changes to edx-platform (#37045) will create the need to ensureLMS_ROOT_URLhas a valid value.This PR stemmed from the discussion here in edx-platform #37045.