Skip to content

Conversation

@navinkarkera
Copy link
Contributor

@navinkarkera navinkarkera commented Aug 19, 2024

Adds get_collections api for openedx/edx-platform#35324

@openedx-webhooks
Copy link

openedx-webhooks commented Aug 19, 2024

Thanks for the pull request, @navinkarkera!

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

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Aug 19, 2024
@navinkarkera navinkarkera force-pushed the navin/update-collections-api branch 2 times, most recently from 5f128ce to fc598eb Compare August 21, 2024 10:58
@navinkarkera navinkarkera marked this pull request as ready for review August 21, 2024 10:58
@navinkarkera navinkarkera force-pushed the navin/update-collections-api branch from fc598eb to 67d6b97 Compare August 21, 2024 10:59
@navinkarkera navinkarkera requested a review from rpenido August 21, 2024 15:00
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.

@navinkarkera Could you add a test for this new function?

@navinkarkera navinkarkera force-pushed the navin/update-collections-api branch 2 times, most recently from 4b2b92d to 9b941cd Compare August 22, 2024 05:52
allow users to get enabled & disabled collections together
@navinkarkera navinkarkera force-pushed the navin/update-collections-api branch from 9b941cd to 005f616 Compare August 22, 2024 06:05
@navinkarkera navinkarkera force-pushed the navin/update-collections-api branch from 0420cb7 to 2a0bc53 Compare August 22, 2024 06:27
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, @navinkarkera !

  • I tested this using the instructions from openedx/edx-platform#35324
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

@pomegranited This is ready for CC review!

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

@pomegranited pomegranited left a comment

Choose a reason for hiding this comment

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

@navinkarkera 👍 with one nit/question for @ormsbee , but I'm fine with merging this as-is.

  • I tested this using the instructions on openedx/edx-platform#35324
  • I read through the code
  • I checked for accessibility issues N/A
  • Includes documentation
  • User-facing strings are extracted for translation N/A

"""
Get all collections, optionally caller can filter by enabled flag
"""
qs = Collection.objects.all()
Copy link
Contributor

Choose a reason for hiding this comment

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

The get_components api method sorts its returned results by pk.. should we be doing that here too? It's nice to have APIs return things in a deterministic order (and it makes your tests simpler too).

I can't find an ADR which supports this stance though.. @ormsbee what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

And I guess if we sort these results, we should sort those from get_learning_package_collections too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pomegranited I agree about making tests simpler, as you can see I had to make use of self.assertQuerySetEqual as the order was not matching in CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated PR to order by pk, we can remove the commit if @ormsbee does not agree.

Copy link
Contributor

Choose a reason for hiding this comment

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

I originally made it sort by pk as a cheap, lazy way of sorting it by creation time. But I think it's a reasonable default sort in a lot of situations, so this is fine by me.

@pomegranited pomegranited merged commit baebbb3 into openedx:main Aug 27, 2024
@openedx-webhooks
Copy link

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

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

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants