Skip to content

Conversation

@Agrendalath
Copy link
Member

@Agrendalath Agrendalath commented Jul 7, 2022

Description

As a part of the ModuleSystem removal, we want to get rid of the course_id from its attributes. We have replaced its usages in the platform with block.scope_ids.usage_id.context_key. For backward compatibility, external XBlocks will still be able to implicitly obtain it either from the CachingDescriptorSystem or XModuleMixin as a fallback.

Supporting information

Sandbox instance: https://pr30715.sandbox.opencraft.hosting
Use staff@example.com:edx to log in.

Testing instructions

  1. Go to the Instructor Dashboard and check that generating a report of problem responses works correctly for XBLocks with custom Python scripts.
  2. Check that the edX notes functionality works.
    1. First, go to this page and add the certificate extension to your browser. Setting up edX notes for sandboxes needs some more steps than we have documented, but I didn't look into this. I've added verify=False to requests in lms/djangoapps/edxnotes/helpers.py to quickly get this working.
    2. Go to a page with an HTML XBlock. Create, edit, and delete some notes.
    3. View all your notes here.
  3. Go to this page and check that the export functionality of the Poll XBlock is working.
  4. Go through all existing XBlocks and verify that they are working correctly.
  5. Check that Instructor tasks work correctly for special exams:
    1. View the course as a learner and start the timed exam.
    2. Refresh the page (something is wrong with the Learning MFE, as it doesn't immediately show the exam bar) and submit the exam.
    3. Switch back to the staff user and reset the attempt through the Instructor Dashboard.

Other information

Private-ref: BB-5969

@openedx-webhooks openedx-webhooks added the blended PR is managed through 2U's blended developmnt program label Jul 7, 2022
@openedx-webhooks
Copy link

openedx-webhooks commented Jul 7, 2022

Thanks for the pull request, @Agrendalath!

When this pull request is ready, tag your edX technical lead.

@Agrendalath Agrendalath force-pushed the agrendalath/bd-13-deprecate_course_id branch 2 times, most recently from 81ff675 to 12b8d61 Compare July 13, 2022 15:07
@natabene
Copy link
Contributor

@Agrendalath Just checking if you are planning to pursue this any time soon.

@Agrendalath
Copy link
Member Author

@natabene, sorry, I just came back from vacation. Yes, I have this, #30072, and #30046 on my list for the upcoming two weeks.

@natabene
Copy link
Contributor

natabene commented Aug 8, 2022

@Agrendalath I hope you had a great vacation, thanks for letting me know about the plans for the PRs.

@Agrendalath Agrendalath force-pushed the agrendalath/bd-13-deprecate_course_id branch from 12b8d61 to fc44ba9 Compare August 17, 2022 17:06
@Agrendalath Agrendalath force-pushed the agrendalath/bd-13-deprecate_course_id branch 2 times, most recently from e319158 to b295d5a Compare September 5, 2022 15:56
@Agrendalath Agrendalath changed the title refactor: deprecate course_id from ModuleSystem [BD-13][BB-5969] refactor: deprecate course_id from ModuleSystem [BD-13] Sep 5, 2022
@Agrendalath Agrendalath marked this pull request as ready for review September 5, 2022 17:55
@Agrendalath Agrendalath force-pushed the agrendalath/bd-13-deprecate_course_id branch from a6025af to 68091e8 Compare September 5, 2022 17:58
@Agrendalath Agrendalath requested a review from pkulkark September 5, 2022 18:00
@Agrendalath
Copy link
Member Author

@ormsbee, would you like to review this PR?

Copy link
Contributor

@ormsbee ormsbee left a comment

Choose a reason for hiding this comment

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

Two main line of questions:

  1. Is it possible that this refactoring is introducing versioned CourseKeys in places they previously were not? I'm concerned that this might cause regressions for things like serialization or configuration lookup (e.g. the thing is enabled for the string that is the CourseKey, but not the string that is the CourseKey+branch/version information).
  2. Why are the service additions part of the same PR? Is it because course_id swichover requires it for some reason?

Copy link
Contributor

@ormsbee ormsbee left a comment

Choose a reason for hiding this comment

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

Just a few comments and questions.

Comment on lines +1687 to +1704
Copy link
Contributor

Choose a reason for hiding this comment

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

@jristau1984: Sometime after this PR merges, you might want to look for this line in the Splunk logs. In particular, this could happen if edx.org uses extensions or XBlocks that try to access this deprecated attribute directly instead of deriving it directly from the UsageKey.

@ormsbee ormsbee self-assigned this Sep 13, 2022
Copy link
Contributor

@pkulkark pkulkark left a comment

Choose a reason for hiding this comment

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

I haven't done a deep code review since @ormsbee is already doing that. But I tested it out on the sandbox and it works as expected. LGTM 👍

@Agrendalath
Copy link
Member Author

@ormsbee, I've resolved the existing conversations (except for this one). Please let me know if you'd like to have another look before we move forward here.

Copy link
Contributor

@ormsbee ormsbee left a comment

Choose a reason for hiding this comment

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

Looks good to me.

I haven't done a deep code review since @ormsbee is already doing that. But I tested it out on the sandbox and it works as expected. LGTM 👍

@pkulkark: I actually meant to review only things that you had already reviewed, and did this one by accident without realizing. But as a general rule, please feel free to closely review everything, regardless of whether I do a pass at it. The Modulestore is tricky enough where I'm always grateful for an extra set of eyes on these things.

This attribute is already deprecated for XBlocks in favour of directly
retrieving it like `block.scope_ids.usage_id.context_key`.

This commit also removes some redundant logging code which was omitted in the
Datadog removal in openedx#19420.
@Agrendalath Agrendalath force-pushed the agrendalath/bd-13-deprecate_course_id branch from d1525b7 to dcabc5a Compare September 21, 2022 17:01
@Agrendalath Agrendalath force-pushed the agrendalath/bd-13-deprecate_course_id branch from dcabc5a to 1afb32c Compare September 21, 2022 17:05
@Agrendalath Agrendalath merged commit fcb594d into openedx:master Sep 26, 2022
@Agrendalath Agrendalath deleted the agrendalath/bd-13-deprecate_course_id branch September 26, 2022 12:23
@openedx-webhooks
Copy link

@Agrendalath 🎉 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-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

@regisb
Copy link
Contributor

regisb commented Sep 30, 2022

FYI I believe that this PR causes the following issue when building the openedx Docker image on Tutor: overhangio/tutor#726

EDIT 2022-10-03: nope! I was wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blended PR is managed through 2U's blended developmnt program

Projects

Archived in project
Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants