Skip to content
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

E0d/refactor 0002 inter app apis #31547

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

e0d
Copy link
Contributor

@e0d e0d commented Jan 13, 2023

This is PR refactors code in the lms/student Django app toward the standards agreed to:

In short the functions in models_api.py have been migrated to api.py and references haven been updated to use api.py.

@e0d e0d marked this pull request as draft January 13, 2023 22:31
@e0d e0d force-pushed the e0d/refactor-0002-inter-app-apis branch from 90c3d58 to a20cd56 Compare January 13, 2023 22:49
@e0d e0d marked this pull request as ready for review January 13, 2023 23:42
@e0d e0d requested a review from kdmccormick January 19, 2023 13:28
@kdmccormick
Copy link
Member

Nice, I'll take a look soon.

@kdmccormick
Copy link
Member

Sorry, Ed. Busy on-call week. This is still on my radar.

Copy link
Member

@kdmccormick kdmccormick 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, just one formatting request. Out out of curiosity, do you have a sense why @tuchfarber originally split it into api.py and models_api.py? Seems as if he was following the same ADR that you were.

Comment on lines +12 to +14
from common.djangoapps.student.models import CourseEnrollment as _CourseEnrollment, UserProfile as _UserProfile, \
CourseAccessRole as _CourseAccessRole, PendingNameChange as _PendingNameChange, \
ManualEnrollmentAudit as _ManualEnrollmentAudit
Copy link
Member

Choose a reason for hiding this comment

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

The prevailing style in edx-platform is to have one import .... as .... per line, preferring parentheses to backslashes. The from common.djangoapps.student.models import (... on the next line is a good example.

Copy link
Member

Choose a reason for hiding this comment

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

@tuchfarber
Copy link
Contributor

Looks good, just one formatting request. Out out of curiosity, do you have a sense why @tuchfarber originally split it into api.py and models_api.py? Seems as if he was following the same ADR that you were.

I borrowed that pattern from #20354 at the time. Though I can say I didn't super understand the benefit of it. It felt superfluous which is why I didn't add it to the OEP https://open-edx-proposals.readthedocs.io/en/latest/architectural-decisions/oep-0049-django-app-patterns.html

Copy link
Member

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

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

Oh hi @tuchfarber ! Hope you're doing well. Thanks for the background.

@e0d Besides my import style nit above, I think your refactor looks good. I would use a refactor: commit rather than a chore: commit. Otherwise, 🚀

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 20, 2023
@openedx-webhooks
Copy link

Thanks for the pull request, @e0d! 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:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

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.

1 similar comment
@openedx-webhooks
Copy link

Thanks for the pull request, @e0d! 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:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

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.

@e0d e0d removed the open-source-contribution PR author is not from Axim or 2U label Nov 20, 2023
@e0d
Copy link
Contributor Author

e0d commented Nov 21, 2023

@feanil since you are leading the API work, is this worth merging?

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 21, 2023
Copy link
Contributor

@feanil feanil left a comment

Choose a reason for hiding this comment

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

Yes, I think this move towards our current standards id definitely worth landing.

@bradenmacdonald
Copy link
Contributor

@e0d This seems like a nice PR and has two thumbs up - can we get it rebased and merged?

@itsjeyd
Copy link
Contributor

itsjeyd commented Nov 28, 2024

Hey @e0d, is this PR still needed or should we close it?

@itsjeyd itsjeyd added the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Nov 28, 2024
@itsjeyd itsjeyd added the inactive PR author has been unresponsive for several months label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive PR author has been unresponsive for several months open-source-contribution PR author is not from Axim or 2U waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc.
Projects
Status: Ready to Merge
Development

Successfully merging this pull request may close these issues.

7 participants