-
Notifications
You must be signed in to change notification settings - Fork 17
feat: get complete entity structure api #421
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
feat: get complete entity structure api #421
Conversation
|
Thanks for the pull request, @navinkarkera! 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. |
Adds function to get full structure of any container.
|
@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]: |
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.
get_unpublished_drafts is probably a better name.
3827e66 to
518b9f1
Compare
|
@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. |
|
@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. |
|
@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. |
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.