Skip to content
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

fix: content search last_published date [FC-0059] #35195

Merged

Conversation

pomegranited
Copy link
Contributor

@pomegranited pomegranited commented Jul 27, 2024

Description

#35103 mis-used the "last published" log to determine the component published date. openedx/openedx-learning#204 resolves this issue by providing a new property component.versions.last_publish_log, from which we can get the published_at datetime.

  • Which edX user roles will this change impact? Content libraries v2 aren't production ready yet, so no users should be affected.

Supporting information

Depends on openedx/openedx-learning#204

Private-ref: FAL-3758

Testing instructions

  1. Run this branch at the frontend: feat: adds sort widget to search manager and library component page [FC-0059] frontend-app-authoring#1147
  2. Install the branches for this PR + feat: get_last_publish log for PublishableEntity [FC-0059] openedx-learning#204 into your CMS.
  3. Ensure your search index has been updated (from previous PR changes): python manage.py cms reindex_studio --experimental
  4. Create a v2 content library in the Course Authoring MFE.
  5. Add components A.
  6. Publish the content library.
  7. From the shell, publish the library:
    from openedx.core.djangoapps.content_libraries import api, models
    library = models.ContentLibrary.objects.get(org=`<your library org>`, slug='<your library slug>')
    api.publish_changes(library.library_key)
    
  8. Add a component B, and re-publish the library.
  9. Add a component C, but do not publish.
  10. View your library's "Components" tab, and sort by "Recently Published". Should see components B and A (in that order), and C should be omitted.

Or you can just reindex studio content to apply this change to existing components:

python manage.py cms reindex_studio --experimental

Deadline

None

@openedx-webhooks
Copy link

openedx-webhooks commented Jul 27, 2024

Thanks for the pull request, @pomegranited!

What's next?

Please work through the following steps to get your changes 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.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently maintained by @openedx/wg-maintenance-edx-platform. Tag them in a comment and let them know that your changes are ready for review.

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.

@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Jul 30, 2024
Copy link
Contributor

@rpenido rpenido left a comment

Choose a reason for hiding this comment

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

LGTM 👍
Thank you for your work @pomegranited !

  • I tested this using the instructions from PR
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

@@ -441,7 +441,7 @@ def test_build_library_object_tree(self) -> None:
"""
Test if we can export a library
"""
with self.assertNumQueries(11):
with self.assertNumQueries(8):
Copy link
Contributor

Choose a reason for hiding this comment

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

Great!

Copy link
Contributor

@yusuf-musleh yusuf-musleh left a comment

Choose a reason for hiding this comment

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

👍 Works well @pomegranited ! I just had run the reindex the first time before being able to do the sorting (which is expected, but the order of the testing instructions had the reindexing at the end)

  • I tested this: Followed the testing instruction in the PR
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

@pomegranited pomegranited marked this pull request as ready for review July 31, 2024 17:22
@ormsbee
Copy link
Contributor

ormsbee commented Jul 31, 2024

(Approved, but please squash.)

@pomegranited pomegranited merged commit 20f7dbd into openedx:master Aug 1, 2024
49 checks passed
@openedx-webhooks
Copy link

@pomegranited 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@pomegranited pomegranited deleted the jill/fix-content-index-last_published branch August 1, 2024 17:18
@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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

7 participants