[MNG-1904] Fix: update new runtime's runtime.anonymous_student_id to store in DB - #26135
Conversation
This addresses a longstanding TODO item to make runtime.anonymous_student_id for content libraries v2 work the same way as it does for XBlocks in regular courses, persisting the "context ID" (equivalent to course ID) to the database. This way, if SECRET KEY is changed, existing anonymous IDs will continue to work unchanged. This is a potentially breaking change, but should mostly affect capa problems using external code graders or Matlab code input, and I'm not aware of any such usage of the new runtime / libraries v2.
|
Thanks for the pull request, @bradenmacdonald! I've created OSPR-5430 to keep track of it in JIRA. As a core committer in this repo, you can merge this once the pull request is approved per the core committer reviewer requirements and according to the agreement with your edX Champion. |
|
@feanil Here's a PR for the issue we discussed on Slack. |
|
@pomegranited @symbolist Do you have any concerns about this change to |
|
Your PR has finished running tests. There were no failures. |
No concerns from me -- I agree with your assessment that LabXchange content doesn't use the
edx-ora2 submissions also use |
feanil
left a comment
There was a problem hiding this comment.
Looks good to me but I'm not as familiar with this part of the system so a review from @symbolist or @ormsbee would be great before I merge this.
|
@bradenmacdonald 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
@ormsbee, @kdmccormick: thought you might like to know that bradenmacdonald merged this pull request. |
|
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. |
This addresses a longstanding TODO item to make
runtime.anonymous_student_idfor content libraries v2 work the same way as it does for XBlocks in regular courses, persisting the anonymous ID string to the database. This way, ifSECRET_KEYis changed, existing anonymous IDs will continue to work unchanged.This is a potentially breaking change for XBlocks in these blockstore-based libraries (v2 libraries), because the actual
anonymous_student_idvalues generated are now different (old ones were based on only user ID and secret key but didn't also incorporate the "context key" into the hash as the new IDs do). But based on my searching foranonymous_student_idin the codebase, this should only affect capa problems using external code graders or Matlab code input, and I'm not aware of any such usage of the new runtime / libraries v2.Risks
There is a low risk that this change to
anonymous_student_idcauses issues for some LabXchange XBlocks (LabXchange being essentially the only user of the new runtime so far). Based on my code searching and manual testing, I don't believeanonymous_student_idis actually used meaningfully (they don't use external graders nor matlab input), so I don't expect any problems. However, if we wanted to be more conservative we could use a transition period where the existing IDs are stored into the table, before we change to the newer ID formatDatabase migration
It has one, but it doesn't make any changes (no SQL); it's just a change to the django model.
Testing
How I tested this change:
anonymous_student_idfor that problem+user did change, but the previously submitted answer was still selected.