-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[BD-13] [BB-6144] deprecate hostname attribute from xmodule ModuleSystem #30308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BD-13] [BB-6144] deprecate hostname attribute from xmodule ModuleSystem #30308
Conversation
|
Thanks for the pull request, @tecoholic! I've created BLENDED-1215 to keep track of it in Jira. More details are on the BD-13 project page. When this pull request is ready, tag your edX technical lead. |
19b233c to
cd7d8bc
Compare
cd7d8bc to
9ba382e
Compare
|
@tecoholic, this PR: Changes the existing behavior of the LTI XBlock in Studio and PreviewAssumptions:
The original LTIBlock provides the following Resource Link IDs:
The version from this PR provides the following values:
@giovannicimolin, would you mind commenting on this? Breaks the LTI Consumer XBlockUsing the LTI Consumer XBlock (which is installed in the edx-platform by default) throws the |
|
@Agrendalath I was thinking using the |
9ba382e to
30af6be
Compare
|
@Agrendalath I reworked the solution to use a new service called
Since there is already a class HostnameService:
def get_hostname(self):
return settings.SITE_NAMElet me know. I will make the changes and update the PR. |
I am not sure how this affects the LTI functionality. Maybe it doesn't have any impact here. We should check this with @giovannicimolin.
While the approach seems to be fine for a one-liner, I haven't found a service that would not return an instance of its class. I believe we should follow the official API here, and create the |
|
@Agrendalath Agreed. I will update the PR with a proper service class. |
30af6be to
87d5c55
Compare
|
@Agrendalath I have replaced the one-liner with |
The LTI spec, under section 3 mentions:
So, this implementation is more consistent and correct than the previous implementation, but there's a gotcha still: ideally, they should all be the same value since they represent the same placement in a course. Studio and Preview values are not that important to keep the same, just make sure the LMS value doesn't change, otherwise students will lose their progress in the LTI tool. |
|
@schenedx Some changes are incoming to LTI consumer - should not impact end users though. See my comment above ^ |
|
For reference: there's a thread open on the discussion forums about this parameter mismatch. |
|
@giovannicimolin Thank you for the heads up. I read the comment above your comment. The consistency make sense to me because, through my own testing, I also noticed the value on the |
|
@ormsbee, this one is almost ready - we just need to replace one variable. mentioned here. Would you like to take a look at this before we merge it? We'll also open a PR to the LTI Consumer XBlock, but it is going to be as small as openedx/xblock-lti-consumer#249. |
4205f56 to
59c8a60
Compare
59c8a60 to
004213c
Compare
|
@tecoholic, please look into the following failing tests:
|
|
@Agrendalath Talk about unintended consequences. The default The tests are fixed now and pushed them as a separate commit. |
|
An unrelated test Maybe an effect of old code, should we rebase this onto master? |
The hostname used to construct the resource link ID is moved from using a runtime attribute to the new 'hostname' service as the former is deprecated. openedx/openedx-platform#30308
The hostname used to construct the resource link ID is moved from using a runtime attribute to the new 'hostname' service as the former is deprecated. openedx/openedx-platform#30308
|
Moving this to draft as we found that this approach is not a good one. |
52ab933 to
bf1a72b
Compare
bf1a72b to
bf8a158
Compare
|
@ormsbee, would you like to take a look at this before we merge it? |
You can merge without me, just please make sure @jristau1984 is aware of when it's happening. Thank you. |
schenedx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
19e79fd to
6837930
Compare
The hostname constructor argument of the XModule ModuleSystem is deprecated in favour of directly accessing the LMS_BASE value from django.conf.settings.
6837930 to
7b75183
Compare
|
@tecoholic 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
The hostname used to construct the resource link ID is moved from using a runtime attribute to the new 'hostname' service as the former is deprecated. openedx/openedx-platform#30308
The hostname used to construct the resource link ID is moved from using a runtime attribute to the new 'hostname' service as the former is deprecated. openedx/openedx-platform#30308
The hostname used to construct the resource link ID is moved from using a runtime attribute to the new 'hostname' service as the former is deprecated. openedx/openedx-platform#30308
Description
The
hostnameattribute was needed for OAuth in the LTI Module and wasbeing passed via the
x_module.ModuleSystemclass as a mixin. This attribute has been removed.It has been replaced in the
xmodule.lti_modulewithget_current_request_hostnameutility function.This change affects only the
module_renderermodule of the LMS which is also updated to initialize the XBlocks without passing the hostname attribute anymore.This shouldn't cause any changes for any users and should continue to work just as usual.
Supporting information
Testing instructions
masterbranch."lti"to the Advanced Module List in the Advanced Settings. (NOTlti_consumerwhich is an independent xblock, this PR deals with the oldltimodule)"saltire:consumer_key:secret". We will be using the Saltire Tool Emulator to test the changessaltirehttps://saltire.lti.app/toolFalsePassedresource_link_id. It should be something like{hostname}-{random-hash-value}. Eg., when testing from local devstacklocalhost%3A18000-71e809b7a55442afaa590a477145bb6cedx-platformto the PR branchopen-craft:tecoholic/BB-6144-deprecate-hostname-in-ModuleSystemresource_link_idshow with the old value. Both should have the same{hostname}part.hostnamevalue is populated as expected.