Skip to content

Conversation

@navinkarkera
Copy link
Contributor

@navinkarkera navinkarkera commented Oct 27, 2025

Adds function to get full structure of any container. Also creates a new api function to get ready to publish drafts and remove some duplicate code.

These changes are required by openedx/edx-platform#37552 to allow publishing of containers more than one level deep, i.e. support any level, sections > subsections > units > components.

Related PR: openedx/edx-platform#37552
Related Issue: openedx/frontend-app-authoring#2502

Concern: The publish log without the changes in this PR stores the container draft that was published even if the container itself did not have any changes.

For Example: Suppose a structure like this: Section > Subsection > Unit > Component. If the component is updated and the section is published, the publish logs record the last draft of the section even if it has not changes of its own, i.e. its version number does not change.

Now with the changes in this PR and openedx/edx-platform#37552, the publish log stores only the modified component and not the container that was published.

It is however possible to store the container as well as the actually updated component in the publish records if required.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Oct 27, 2025
@openedx-webhooks
Copy link

Thanks for the pull request, @navinkarkera!

This repository is currently maintained by @axim-engineering.

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.

Adds function to get full structure of any container.
@navinkarkera
Copy link
Contributor Author

@bradenmacdonald I would like to know your thoughts regarding this PR and the concern that I have added in the description?

)


def get_ready_to_publish_drafts(learning_package_id: int, /) -> QuerySet[Draft]:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

get_unpublished_drafts is probably a better name.

@navinkarkera navinkarkera force-pushed the navin/fal-4270/fix-publish-childrens branch from 3827e66 to 518b9f1 Compare October 27, 2025 10:09
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Oct 27, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Oct 27, 2025
@bradenmacdonald
Copy link
Contributor

@navinkarkera Did you see #369 ? I think that's how we were planning to implement publishing descendants automatically.

We may still want an API to get the full structure of a container, but it should ideally be something that does a fixed number of queries, not a recursive function. See #360 . Your implementation is probably fine for now, if we need a short-term solution though, as a properly performant one will take some time and isn't even fully designed yet.

@navinkarkera
Copy link
Contributor Author

@bradenmacdonald Ohh, I was not aware. We can close this if they are ready to be merged or we can use this as temporary solution.

@ormsbee
Copy link
Contributor

ormsbee commented Nov 20, 2025

@navinkarkera: I'm closing this since #369 merged, fixing the issue with publishing across an arbitrary number of levels. Please feel free to re-open if you want to discuss further.

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

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants