Skip to content

Conversation

@rpenido
Copy link
Contributor

@rpenido rpenido commented Aug 9, 2024

Description

This PR fixes some issues in the Collections model from #206 and adds some improvements to the implementation.

Testing Instructions

  • Please ensure that the tests cover the expected behavior

Private ref: FAL-3782

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Aug 9, 2024
@openedx-webhooks
Copy link

openedx-webhooks commented Aug 9, 2024

Thanks for the pull request, @rpenido!

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.

@rpenido rpenido force-pushed the rpenido/fal-3782-fix-collection-model-issues branch 2 times, most recently from db3b742 to daecf9f Compare August 9, 2024 16:15
@rpenido rpenido marked this pull request as ready for review August 9, 2024 16:36
@rpenido rpenido requested a review from ormsbee August 9, 2024 16:39
@rpenido rpenido force-pushed the rpenido/fal-3782-fix-collection-model-issues branch from daecf9f to ef09229 Compare August 9, 2024 16:40
@rpenido rpenido changed the title fix: improve collections models and api fix: improve collections models and api [FC-0059] Aug 9, 2024
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Aug 12, 2024
Copy link
Member

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

👍 @rpenido Looks good to me, great work! Just had a question about the index, if you can kindly address it.

  • I tested this: I read through the code and confirmed tests are passing
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

Comment on lines 80 to 82
indexes = [
models.Index(fields=["learning_package_id", "title"]),
]
Copy link
Member

Choose a reason for hiding this comment

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

I just wanted to confirm, since the ForeignKey field defined is learning_package, should this index be learning_package instead of learning_package_id? I was looking at other places in the code where indexes are defined, and the ForeignKey fields are defined without the _id, so I just wanted to make sure if I am missing something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you are right @yusuf-musleh !
Fixed here: 9417609

@rpenido
Copy link
Contributor Author

rpenido commented Aug 14, 2024

Hi @pomegranited!

Could you do a last review, merge and tag a new version if everything is good?

@rpenido rpenido requested a review from pomegranited August 15, 2024 13:28
Copy link
Member

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

@rpenido I noticed a field was missing from the create_collection api as I was working on the REST endpoints, if you could take a look at it below.

Comment on lines 23 to 24
def create_collection(
learning_package_id: int,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def create_collection(
learning_package_id: int,
def create_collection(
learning_package_id: int,
created_by: int | None,

I realized the created_by value was missing from the params and in the .create below, would you mind adding them in this PR since I needed it when I was working on the REST endpoints.

Copy link
Contributor Author

@rpenido rpenido Aug 19, 2024

Choose a reason for hiding this comment

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

Good catch @yusuf-musleh!
Fixed here: a30e04a

Comment on lines 34 to 35
description=description,
)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description=description,
)
description=description,
created_by=created_by,
)

Likewise we need to add the created_by here

@rpenido rpenido force-pushed the rpenido/fal-3782-fix-collection-model-issues branch from 9cdd1e7 to 89f4cea Compare August 19, 2024 08:55
@rpenido rpenido force-pushed the rpenido/fal-3782-fix-collection-model-issues branch from 89f4cea to a30e04a Compare August 19, 2024 21:05
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.

👍 Looks great @rpenido ! I had a couple of nits, so just pushed them in to move this along. Will get this merged ASAP.

  • I tested this by running the tests.
  • I read through the code and ensured tests cover all of the Collections code.
  • I checked for accessibility issues N/A
  • Includes documentation
  • User-facing strings are extracted for translation

@rpenido
Copy link
Contributor Author

rpenido commented Aug 20, 2024

Thank you @pomegranited!

@pomegranited pomegranited merged commit b8610ff into openedx:main Aug 21, 2024
@openedx-webhooks
Copy link

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

@rpenido rpenido deleted the rpenido/fal-3782-fix-collection-model-issues branch August 22, 2024 14:13
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