fix: TypeError when restoring published containers#551
Merged
kdmccormick merged 1 commit intomainfrom Apr 20, 2026
Merged
Conversation
aea9cd2 to
8430cf3
Compare
The original version of this code depended upon `version_num` being popped out of `valid_published` before `valid_published` got expanded. A recent change changed the argument order, leading to: TypeError: create_next_container_version() got an unexpected keyword argument 'version_num' whenever restoring an archive with any published containers. This commit restores the original code's order of operations, but a bit more explicitly. Bumps from 0.39.2 to 0.40.0 (it would be 0.39.3, but the previous commit had breaking changes and neglected to bump the minor version)
8430cf3 to
d0281d1
Compare
kdmccormick
commented
Apr 19, 2026
| assert container.created_by.username == "lp_user" | ||
| # The unit has been published. The other two containers haven't been. | ||
| # It's important that we test with at least one published container in order to | ||
| # fully cover _create_container in zipper.py. |
Member
Author
There was a problem hiding this comment.
Suggested change
| # fully cover _create_container in zipper.py. | |
| # fully cover _save_container in zipper.py. |
(I typo'd the function name)
Member
Author
|
@bradenmacdonald @ormsbee a quick fix to a bug on openedx-core main, could you take a look? |
2de714b to
d0281d1
Compare
ormsbee
approved these changes
Apr 20, 2026
Contributor
ormsbee
left a comment
There was a problem hiding this comment.
Code looks fine. Just a comment about the version.
|
|
||
| # The version for the entire repository | ||
| __version__ = "0.39.2" | ||
| __version__ = "0.40.0" |
Contributor
There was a problem hiding this comment.
Since it's a bugfix, shouldn't this be 0.39.3?
Member
Author
There was a problem hiding this comment.
The collection_code change is also released by this, which makes it a breaking release
bradenmacdonald
approved these changes
Apr 20, 2026
Contributor
bradenmacdonald
left a comment
There was a problem hiding this comment.
Thanks! Yeah the current backup/restore code doesn't have enough test coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The original version of this code depended upon
version_numbeing popped outof
valid_publishedbeforevalid_publishedgot expanded. A recent changechanged the argument order, leading to:
whenever restoring an archive with any published containers. This commit
restores the original code's order of operations, but a bit more explicitly.
Bumps from 0.39.2 to 0.40.0 (it would be 0.39.3, but the previous
commit had breaking changes and neglected to bump the minor version)
Testing
On openedx-platform master and openedx-core==v0.39.0, back up any library with at least one published component.
Try to restore it. It'll fail. You should see a TypeError in the logs.
Cherry-pick this commit on top of openedx-core v0.39.0. Try again to restore the archive. It should succeed.