Resolve archives through Studio's contents_sha256 index before upload
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start with TreeManager.get_file_diff and do_file_upload in ricecooker/managers/tree.py, then trace FileMetadata and get_filename() in ricecooker/classes/files.py and archive sealing in ricecooker/utils/pipeline/convert.py. Check config.get_storage_url and the zlib-ng guard in ricecooker/utils/zip.py. Done means cache hits and fresh conversions resolve valid contents_sha256 matches, while misses and failed checks retain local-MD5 upload behavior and the listed CI/content cases pass.
Written by the indexing model from the issue text.
Description
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
ricecooker should resolve each archive through Studio's contents_sha256/ index before uploading, so content Studio already holds keeps its existing MD5 whatever zlib build produced the local bytes. With that in place, the zlib-ng guard added in #720 should be removed. Part of #722.
Complexity: Medium
Target branch: main
Context
TreeManager.get_file_diffHEADs each<md5>.<ext>atconfig.get_storage_url; misses go todo_file_upload.- A file's checksum and its serialized reference both derive from
get_filename(), so the tree references whatever<md5>.<ext>the file holds locally. _seal_directory_to_fileseals every archive throughcreate_predictable_zip.- #720 adds the zlib-ng guard to
ricecooker/utils/zip.py.
The Change
ArchiveProcessingBaseHandlershould recordcontents_sha256(learningequality/le-utils#241) of the sealed archive as optionalFileMetadata, preserved on pipeline cache hits.- Before the HEAD diff, ricecooker should GET
{domain}/content/contents_sha256/<hash>.<ext>, on the hostget_storage_urluses, for each file carrying that metadata. - On a hit whose target passes the HEAD check, the file should take the canonical
<md5>.<ext>, so it is neither uploaded nor referenced under its local MD5. - Anything that reads the local file by its filename, such as the size lookup, should keep working after the rename.
Acceptance Criteria
- On a zlib-ng interpreter, archives whose content Studio holds under other MD5s are not uploaded, and the created nodes reference the existing MD5s.
- A pipeline cache hit resolves through the index the same as a fresh conversion.
- A lookup 404, a network error, or an index hit whose target fails the HEAD check uploads the file under its local MD5.
- Files without
contents_sha256metadata make no index request. - HTML5, ePub, KPUB, H5P and Bloom content process on zlib-ng interpreters.
-
windows-latest, 3.14is in the CI matrix and passing.
AI usage
I chose the design, including computing the hash in the archive handler; Claude Code traced the upload path and drafted the sections.
- Dominant language
- Python
- Stars
- 33
- Forks
- 83
- Avg merge
- 5d 16h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from learningequality/ricecooker
-
bug TAG: unit tests
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
learningequality/ricecooker#898 ·
-
dependencies python TAG: tech update / debt
Difficulty 4/5 3-5 days Newbie friendliness 55/100
learningequality/ricecooker#899 ·
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
learningequality/ricecooker#893 ·
-
TAG: tech update / debt
Difficulty 3/5 1-2 days Newbie friendliness 1/100
learningequality/ricecooker#891 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
learningequality/ricecooker#890 · 4 comments ·
All issues in learningequality/ricecooker
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
jxxghp/MoviePilot#7699 ·
Maintainers usually reply within 1 day
-
next
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
j3ko/agent-plugins#80 ·
Maintainers usually reply within 1 day
-
bug:unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Heroic-Games-Launcher/HeroicGamesLauncher#6187 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
BCStudentSoftwareDevTeam/cas#491 ·
Maintainers usually reply within 8 days
-
task
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
freelawproject/litigant-portal#1285 ·
Maintainers usually reply within 2 days