Skip to content

Conversation

@ChrisChV
Copy link
Contributor

@ChrisChV ChrisChV commented May 21, 2025

Description

  • Refactor of test_containers.py 8b9731d
  • Updates the content_libraries/api/containers and content_libraries/rest_api to support:
    • Basic CRUD for sections and subsections as containers
    • Basic CRUD support for section and subsection children
  • Updates the content/search to support:
    • Basic CRUD for sections and subsections as containers in the search index
    • Basic CRUD support for section and subsection children in the search index
  • Updates the content_libraries/tests/test_containers.py to test the new support
  • Updates the content/search/tests to test the new support.
  • I verified that the add/remove to collection works without major changes. Tests updated
  • Which edX user roles will this change impact? "Developer".

Supporting information

Testing instructions

Deadline

ASAP to unlock more tasks

Other information

To complete a full support it is known that the following is missing:

  • Update the index to store the subsections in which a unit is contained and the sections in which a subsection is contained. Also call the CONTENT_OBJECT_ASSOCIATIONS_CHANGED
  • Update the get_containers_contains_component in the API
  • All related to publish
  • Call events when delete a subsection/unit to update the affected sections/subsections (or verify if this works).

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

openedx-webhooks commented May 21, 2025

Thanks for the pull request, @ChrisChV!

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.

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

@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions May 21, 2025
@ChrisChV ChrisChV marked this pull request as draft May 21, 2025 01:43
@ChrisChV ChrisChV force-pushed the chris/FAL-4180-sections-subsections-api branch from 0fc836c to 3f6c616 Compare May 21, 2025 02:18
ChrisChV added 2 commits May 21, 2025 20:36
* Created `test_subsection_permissions`
* Created `test_section_permissions`
* Rename `test_units_gets_auto_slugs` to `test_containers_gets_auto_slugs` and also test sections and subsections
* feat: `test_restore_units` renamed to `test_restore_containers` to also test restore section and subsections
* refactor: Created `test_container_crud` to test all container types using ddt.
* refactor: Created `test_container_permissions` to test all container types using ddt.
* refactor: Created `test_containers_gets_auto_slugs` to test all container types using ddt
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions May 22, 2025
@ChrisChV ChrisChV changed the title feat: Update content libraries REST API and search API to support sections/subsections feat: Basic CRUD support for sections/subsections as containers May 26, 2025
@ChrisChV ChrisChV marked this pull request as ready for review May 26, 2025 23:39
Copy link
Contributor

@navinkarkera navinkarkera left a comment

Choose a reason for hiding this comment

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

@ChrisChV Nice work 👍

@navinkarkera
Copy link
Contributor

Update the index to store the subsections in which a unit is contained and the sections in which a subsection is contained.

@ChrisChV I actually need this for openedx/frontend-app-authoring#2032 so I went ahead and created this small PR: open-craft#785 with basic implementation. Please take a look and let me know if you want me to make any changes or if you want to take over and merge it here.

Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

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

Looks great, thanks! Just a few nits. Please take a look at them before you merge.

None,
)

# TODO verify subsections in units
Copy link
Contributor

Choose a reason for hiding this comment

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

What's left to do here? This looks similar to the units case above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was missing to add to the index the sections and subsections to which it is contained. Navin has advanced this part in #36762 (comment). I'll review it and update the tests.

None,
)

# TODO verify section in subsections
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ChrisChV ChrisChV moved this from Waiting on Author to Ready for Review in Contributions May 28, 2025
@ChrisChV
Copy link
Contributor Author

@ChrisChV I actually need this for openedx/frontend-app-authoring#2032 so I went ahead and created this small PR: open-craft#785 with basic implementation. Please take a look and let me know if you want me to make any changes or if you want to take over and merge it here.

@navinkarkera Looks good! Thanks for this work! I think it's missing to update this TODOS's:

This PR is ready to be merged, I think we should merge it to be able to unblock openedx/frontend-app-authoring#2013. I will create a separed PR with your work and I'm going to continue it 😄

@ChrisChV ChrisChV changed the title feat: Basic CRUD support for sections/subsections as containers feat: Basic CRUD support for sections/subsections as containers [FC-0090] May 28, 2025
@ChrisChV ChrisChV enabled auto-merge (squash) May 28, 2025 20:34
@ChrisChV ChrisChV merged commit c2eb913 into openedx:master May 28, 2025
48 checks passed
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in Contributions May 28, 2025
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

marlonkeating pushed a commit that referenced this pull request Jul 15, 2025
…090] (#36762)

- Refactor of `test_containers.py` 8b9731d
- Updates the `content_libraries/api/containers` and `content_libraries/rest_api` to support:
    - Basic CRUD for sections and subsections as containers
    - Basic CRUD support for section and subsection children
- Updates the `content/search` to support:
    - Basic CRUD for sections and subsections as containers in the search index
    - Basic CRUD support for section and subsection children in the search index
- Updates the `content_libraries/tests/test_containers.py` to test the new support
- Updates the `content/search/tests` to test the new support.
- I verified that the add/remove to collection works without major changes. Tests updated
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.

5 participants