Skip to content

Conversation

@ChrisChV
Copy link
Contributor

Description

Supporting information

Testing instructions

  • Use this edx-platform branch: feat: REST_API to get MAX_BLOCKS_PER_CONTENT_LIBRARY [FC-0112] edx-platform#37686
  • Update the settings MAX_BLOCKS_PER_CONTENT_LIBRARY to a lower value, like 20
  • Create a course with a Unit with more blocks that the limit.
  • Go to a library home of a library
  • Go to the Import menu
  • Import the new created course
  • In the summary step verify that the blocks that exceed the limit are marked as undefined

Other information

N/A

Best Practices Checklist

We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:

  • Any new files are using TypeScript (.ts, .tsx).
  • Avoid propTypes and defaultProps in any new or modified code.
  • Tests should use the helpers in src/testUtils.tsx (specifically initializeMocks)
  • Do not add new fields to the Redux state/store. Use React Context to share state among multiple components.
  • Use React Query to load data from REST APIs. See any apiHooks.ts in this repo for examples.
  • All new i18n messages in messages.ts files have a description for translators to use.
  • Avoid using ../ in import paths. To import from parent folders, use @src, e.g. import { initializeMocks } from '@src/testUtils'; instead of from '../../../../testUtils'

@openedx-webhooks
Copy link

Thanks for the pull request, @ChrisChV!

This repository is currently maintained by @bradenmacdonald.

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.


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.

@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

❌ Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.85%. Comparing base (ef36156) to head (b620588).

Files with missing lines Patch % Lines
src/library-authoring/data/api.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2700      +/-   ##
==========================================
- Coverage   94.85%   94.85%   -0.01%     
==========================================
  Files        1232     1232              
  Lines       27899    27914      +15     
  Branches     6316     6323       +7     
==========================================
+ Hits        26464    26478      +14     
- Misses       1364     1365       +1     
  Partials       71       71              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@navinkarkera navinkarkera left a comment

Choose a reason for hiding this comment

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

@ChrisChV The limit is applicable to the whole number of blocks in the library, so we need to consider: the current number of blocks in the library + total number of blocks in the imported course (Including the sections, subsections & units). And then exclude the number from Total Blocks section as we don't know if the components will be excluded or the containers. Maybe also include a line in the alert above saying something like the library being close to limit of total number of blocks and the import will be stopped when it is crossed.

@ChrisChV
Copy link
Contributor Author

ChrisChV commented Nov 26, 2025

The limit is applicable to the whole number of blocks in the library, so we need to consider: the current number of blocks in the library + total number of blocks in the imported course (Including the sections, subsections & units)

@navinkarkera Yes, you are right. I was confused to see that MAX_BLOCKS_PER_CONTENT_LIBRARY was not checked when creating containers. I created #2707 to fix that.

The limit is applicable to the whole number of blocks in the library, so we need to consider: the current number of blocks in the library + total number of blocks in the imported course (Including the sections, subsections & units). And then exclude the number from Total Blocks section as we don't know if the components will be excluded or the containers. Maybe also include a line in the alert above saying something like the library being close to limit of total number of blocks and the import will be stopped when it is crossed.

@edschema @sdaitzman Reaching the item limit in the library has become a special case, so before we continue, I'd like to ask you what it should look like. In summary, the following changes are proposed:

  • Exclude the number of items that will not be imported from the Total Blocks count. We won't know if they are containers or components until after the migration.
    • Q: After the migration, we know if they are containers or components. How should the summary in the import details page look when a container is not imported?
  • A text in the alert explaining this case.

Another option that occurred to me while writing the above is to completely block the import if the limit is reached, because: (1) how complex this case can become, (2) after that import, it will not be possible to create or make other imports in the library. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

3 participants