-
Notifications
You must be signed in to change notification settings - Fork 85
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
change to new edx user service #224
Conversation
Thanks for the pull request, @sroertgen! I've created OSPR-6413 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
@sroertgen Awesome work here. Let me know if you have any questions. I'll find the right person to help you if you bump into any issues. |
@sroertgen |
Thank you both! Have a nice weekend! |
@sroertgen Thank you very much! Once they process it and you are cleared, I will post here. |
@sroertgen Some tests are failing because of the User service mock isn't returning proper values, can you fix that? See https://github.com/openedx/xblock-lti-consumer/runs/4982515609?check_suite_focus=true. Edit: I noticed that commitlint in failing here as well. You'll need to:
Thanks for your patience here, the strict CI/rulechecks can be a hassle if it's your first time around. Let me know if you need any help. 😁 |
@giovannicimolin oh yes, there are tests :D I will have a look into this! And thanks for the hints! |
@sroertgen Thank you for signing, you are all set now. Next commit or rebase should clear the cla check. |
Hey @giovannicimolin, I fixed the tests. Had a bit of struggle squashing my commits, but I hope it is now as you expect (was a good opportunity for me starting with this best practice ;) ) Please let me know, if I have to do anything else. |
just saw the failing test. I just ran |
@sroertgen There's quality checks too, make sure you run those as well. :) |
fix failing quality tests
@giovannicimolin If you don't mind, you can try running the workflows again. |
@sroertgen Tests running 😁 |
Codecov Report
@@ Coverage Diff @@
## master #224 +/- ##
==========================================
- Coverage 97.14% 97.10% -0.05%
==========================================
Files 66 66
Lines 4694 4698 +4
==========================================
+ Hits 4560 4562 +2
- Misses 134 136 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@sroertgen @giovannicimolin Is this good for our review? |
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.
@sroertgen Did a full review and testing of the changes and left a few suggestions in the PR.
lti_consumer/lti_xblock.py
Outdated
try: | ||
role = self.runtime.service(self, 'user').get_current_user().opt_attrs['edx-platform.user_role'] | ||
# opt_attrs might not be present or the "edx-platform.user_role" key if opt_attrs is present | ||
except (KeyError, AttributeError): | ||
role = "student" | ||
return ROLE_MAP.get(role, 'Student') |
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.
You can always consider opt_attrs
as a valid attribute (this is defined here), simplifying this to:
try: | |
role = self.runtime.service(self, 'user').get_current_user().opt_attrs['edx-platform.user_role'] | |
# opt_attrs might not be present or the "edx-platform.user_role" key if opt_attrs is present | |
except (KeyError, AttributeError): | |
role = "student" | |
return ROLE_MAP.get(role, 'Student') | |
role = self.runtime.service(self, 'user').get_current_user().opt_attrs.get('edx-platform.user_role', 'student') | |
return ROLE_MAP.get(role, 'Student') |
Thanks! Will have a look into this during this week! |
Hey @giovannicimolin, sorry it took a bit longer, but I had to hand in two proposals in the last weeks and just did not have time to work on your suggestions. Thanks for the hints! I implemented the changes and am looking forward for your feedback. Best, |
Sorry, my |
@giovannicimolin Could you finalize reviewing and merge when ready? Owning team is fine with you review and mege. |
@natabene Sure! I'm planning to review this today - sorry for the delay in the reply. |
@giovannicimolin Thanks! |
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.
👍
- I tested this:
- Tested LTI 1.1 launches from both the LMS and Studio and checked the data.
- Individually tested each method modified and checked it's results on the LMS and Studio environments using a debugger.
- I read through the code
-
I checked for accessibility issuesNA -
Includes documentationNA
@sroertgen Great work! Thanks for the contribution.
I'll fix the commit-lint error using GitHub's squash and merge feature.
@sroertgen 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
As discussed in #217 edX changed its internal user service.
This PR implements these changes.