Skip to content

Conversation

@NiedielnitsevIvan
Copy link
Contributor

No description provided.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 17, 2025
@openedx-webhooks
Copy link

openedx-webhooks commented Apr 17, 2025

Thanks for the pull request, @NiedielnitsevIvan!

This repository is currently maintained by @openedx/wg-maintenance-edx-platform.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If 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 PR

Your 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@NiedielnitsevIvan NiedielnitsevIvan marked this pull request as draft April 17, 2025 14:43
@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Apr 17, 2025
@NiedielnitsevIvan NiedielnitsevIvan changed the title feat: REST APIs for import functionality Draft: feat: REST APIs for import functionality Apr 17, 2025
@NiedielnitsevIvan NiedielnitsevIvan force-pushed the NiedielnitsevIvan/feat/import-from-modulestore-REST-apis branch from 70e7978 to b7782c2 Compare April 21, 2025 10:20
@NiedielnitsevIvan NiedielnitsevIvan force-pushed the NiedielnitsevIvan/feat/import-from-modulestore-REST-apis branch from b7782c2 to 7275e17 Compare April 21, 2025 10:28
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.

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.

Comment on lines +144 to +145
path('api/import_from_modulestore/',
include('cms.djangoapps.import_from_modulestore.views.urls', namespace='import_from_modulestore_api')),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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/

@kdmccormick
Copy link
Member

@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.

@kdmccormick
Copy link
Member

Here's my WIP PR for the REST APIs: #36582

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Apr 23, 2025
@kdmccormick
Copy link
Member

@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.

@mphilbrick211
Copy link

Hi @NiedielnitsevIvan! Is this pull request still in progress, or can it be closed?

@kdmccormick
Copy link
Member

Superseded by kdmccormick#32

@github-project-automation github-project-automation bot moved this from Waiting on Author to Done in Contributions Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants