-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Draft: feat: REST APIs for import functionality #36541
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
Draft: feat: REST APIs for import functionality #36541
Conversation
|
Thanks for the pull request, @NiedielnitsevIvan! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
70e7978 to
b7782c2
Compare
b7782c2 to
7275e17
Compare
kdmccormick
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.
The REST API needs major rework. It is providing too much information in some cases and too little information in others.
The API currently lets its clients start a staging task, start an import task, and view the structure of a staged import. However, I don't see any way that the API gives them an ability to check what the status of the tasks are, whether they succeeded, and if they fail, any error information. This status-related information is significantly more important than being able to see the structure of the staged content. The API user doesn't need to even know that content staging exists as an intermediate format; from their perspective, it would be fine if it were all one step.
The ability to query status is provided, with pre-made REST API endpoints, by django-user-tasks. Using this framework requires that all the work occurs in a single Celery task. Yes, the work currently occurs in two celery tasks (stage content, and import staged content); however, rather than two Celery tasks, this could be a single Celery task which calls two synchronous API methods. django-user-tasks even allows you to set custom status messages, negating the need for the detailed ImportStatus enumeration. The Import model would have a OneToOneField(to=UserTaskStatus) so that each import event is related to a single UserTaskStatus.
I'm sorry to give this feedback so late. I wish I had been more insistent about using django-user-tasks when we first talked about it. In the future, we should agree on the REST API design early on before any implementation (beyond protoype) is started.
| path('api/import_from_modulestore/', | ||
| include('cms.djangoapps.import_from_modulestore.views.urls', namespace='import_from_modulestore_api')), |
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.
| path('api/import_from_modulestore/', | |
| include('cms.djangoapps.import_from_modulestore.views.urls', namespace='import_from_modulestore_api')), | |
| path('api/import_from_modulestore/', | |
| include('cms.djangoapps.import_from_modulestore.rest_api.urls', namespace='import_from_modulestore_api')), |
To be consistent with other edx-platform apps, the import_from_modulestore/views/ folder should be called import_from_modulestore/rest_api/
|
@NiedielnitsevIvan @cmltaWt0 I have a draft in progress of the requested rework. When you're online, please focus on the Python APIs PR, and I will post the REST API rework as soon as it's ready. |
|
Here's my WIP PR for the REST APIs: #36582 |
|
@NiedielnitsevIvan @cmltaWt0 We discussed in named release planning that this and the Django Admin PR can both merge up to two weeks after the code cutoff and be backported into Teak. So, we just need to merge these by Thu May 8th. I'm going to focus on other work (#36275) for the rest of this week, and then I'll be available next week for code review and sync-ups on this PR and the Django Admin PR. |
|
Hi @NiedielnitsevIvan! Is this pull request still in progress, or can it be closed? |
|
Superseded by kdmccormick#32 |
No description provided.