Skip to content

get_lms_link_from_course_key fallback to LMS base if no Site found - #813

Merged
bryanlandia merged 2 commits into
appsembler/tahoe/developfrom
bryan/lms-link-fallback-no-course-org
Feb 24, 2021
Merged

get_lms_link_from_course_key fallback to LMS base if no Site found#813
bryanlandia merged 2 commits into
appsembler/tahoe/developfrom
bryan/lms-link-fallback-no-course-org

Conversation

@bryanlandia

Copy link
Copy Markdown

The way this is written now is adding a lot of complexity for standalone deployments. There, we have a single Site with multiple course orgs. As far as I can tell, there's no need within Tahoe SaaS multitenant to fall back to {course_org}.LMS_BASE if no Site with the name of the course org is found. There are many other points of the system that enforce or will break unless that Site is named 'chef' or whatever.

As it is, for a single-site standalone, the Site not found fallback then means we have to support wildcard subdomains, as all of our preview and jump_to links will end up going to {course_org}.lms_base.customer_domain.com. That gets complicated, as wildcard LE certs require DNS TXT record validation, etc.

So, putting this together as a Draft for initial feedback. If it looks good to go ahead I'll write tests (there are none yet anyhow).

@OmarIthawi OmarIthawi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bryanlandia. This PR shouldn't go as-is because it could break the feature for SaaS customers.

Please check the notes and let me know what do you think. I'm leaning towards Option 1 and using get_site_for_course since the course.org is not a reliable source of truth imho.

Comment thread openedx/core/djangoapps/appsembler/sites/utils.py Outdated
@bryanlandia
bryanlandia force-pushed the bryan/lms-link-fallback-no-course-org branch 2 times, most recently from 77f8a60 to 35ba62e Compare February 3, 2021 22:35
@OmarIthawi

Copy link
Copy Markdown

Thanks @bryanlandia. Now it looks good. Apparently, we're having failed tests due to (I think) circular dependency.

Please refactor to avoid this issue and we'll need to test this helper on staging to see if it works.

@bryanlandia

Copy link
Copy Markdown
Author

Checks have passed now @OmarIthawi. Thanks for investigating the build results.

@bryanlandia
bryanlandia marked this pull request as ready for review February 4, 2021 18:57

@OmarIthawi OmarIthawi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bryanlandia! Would it be okay to write a test case or two for get_lms_link_from_course_key?

Rework get_lms_link_from_course_key using get_site_for_course

@OmarIthawi suggestion

Co-authored-by: Omar Al-Ithawi <i@omardo.com>

Fix import issue in get_lms_link_for_course_key
@bryanlandia
bryanlandia force-pushed the bryan/lms-link-fallback-no-course-org branch 2 times, most recently from 5607890 to 2bf1e1e Compare February 22, 2021 23:05
@bryanlandia
bryanlandia force-pushed the bryan/lms-link-fallback-no-course-org branch from 2bf1e1e to f209638 Compare February 22, 2021 23:06
@bryanlandia

Copy link
Copy Markdown
Author

@OmarIthawi I added some tests for this

@OmarIthawi

Copy link
Copy Markdown

Thanks @bryanlandia!

@bryanlandia
bryanlandia merged commit ad6e1b0 into appsembler/tahoe/develop Feb 24, 2021
@bryanlandia
bryanlandia deleted the bryan/lms-link-fallback-no-course-org branch February 24, 2021 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants