upload zim to collection and create zimfarm task - #469
Conversation
|
@benoit74 , if PR is approved, we will need to set policies on Wasabi to delete aborted/incomplete uploads and possibly retention policy on bucket too. |
|
Because uploads are done by editors, I have opted to keep the upload section in the collections page so collection_editor and global_editor can upload zims. But i'm stuck on the issue when book arrives and there's no title for it in which case @benoit74 , wdyt? |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #469 +/- ##
==========================================
+ Coverage 81.13% 81.17% +0.03%
==========================================
Files 64 69 +5
Lines 3881 4281 +400
Branches 473 507 +34
==========================================
+ Hits 3149 3475 +326
- Misses 581 643 +62
- Partials 151 163 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Good point ; can you develop what you mean by "enhance promote book logic to only allow edits to the collection title when none is set"? |
|
I realized we need the recipe_id in order to be able to reconstruct this path. So, I think maybe we shouldn't delete recipe till zimfarm has published book to CMS or mill has detected task has failed/canceled. |
sorry to intervene here as @benoit74 is out for a few days, but here there onviously no recipe-id to link to the book/title. |
Zimfarm advertises the recipe_id as part of the payload that gets sent in the CMS notification. And before we create the task on zimfarm, we create a recipe and store the recipe_id. But, I'm proposing to delay the deletion of the recipe on zimfarm (which is currently done immediately after creation) till it gets advertised to CMS. |


Rationale
This PR enhances the CMS by allowing editors to upload an already created zim from their local filesystem. The CMS on receiving such files creates the task on zimfarm which will advertise the book back to the CMS once checks and processing are done by a worker
Changes
This closes #322