Skip to content

fix: Issue when migrating legacy libraries with large keys [FC-0107]#37520

Merged
ChrisChV merged 2 commits intoopenedx:masterfrom
open-craft:chris/FAL-4262-fix-migration-issues
Oct 22, 2025
Merged

fix: Issue when migrating legacy libraries with large keys [FC-0107]#37520
ChrisChV merged 2 commits intoopenedx:masterfrom
open-craft:chris/FAL-4262-fix-migration-issues

Conversation

@ChrisChV
Copy link
Copy Markdown
Contributor

@ChrisChV ChrisChV commented Oct 21, 2025

Description

Supporting information

Testing instructions

  • Create a legacy library with a large key, like: library-v1:LibraryOrganizationField_NOSPACES+LibraryCodeField_NOSPACESALLOWED
  • Follow the migration flow to migrate that library
  • Verify that the migration finished successfully.

Deadline

Before Ulmo Cut

Other information

N/A

@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @ChrisChV!

This repository is currently maintained by @openedx/wg-maintenance-edx-platform.

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.

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

Copy link
Copy Markdown
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, @ChrisChV !

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

PS: I had to use a commit before 7c8020d to be able to access the page to create a new legacy library

@edschema
Copy link
Copy Markdown

Linking bug tracking issue for this work: openedx/frontend-app-authoring#2557

@bradenmacdonald
Copy link
Copy Markdown
Contributor

Code looks fine, but why was the code that was there before causing the bug?

@ChrisChV
Copy link
Copy Markdown
Contributor Author

Code looks fine, but why was the code that was there before causing the bug?

The length of purpose in StagedContent is 64 (ref). The previous code used the legacy content key. So if the library had a very long key, an error occurred. The new code uses the pk instead of the key

@ChrisChV ChrisChV merged commit 774f3b3 into openedx:master Oct 22, 2025
49 checks passed
@ChrisChV ChrisChV deleted the chris/FAL-4262-fix-migration-issues branch October 22, 2025 20:42
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Contributions Oct 22, 2025
@bradenmacdonald
Copy link
Copy Markdown
Contributor

Ah, that makes sense.

haftamuk pushed a commit to haftamuk/edx-platform that referenced this pull request Nov 3, 2025
…7520)

The length of `purpose` in `StagedContent` is 64. The previous code used the legacy content key. So if the library had a very long key, an error occurred. The new code uses the `pk` instead of the `key`
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

Archived in project

Development

Successfully merging this pull request may close these issues.

Legacy libraries w/ long keys cause migration failures

5 participants