-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request Task to farm #69
Merged
Merged
Conversation
This file contains 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
- Updated ArchiveConfig to use single language (we'll only alow single-lang ZIMs for now) - New zimfarm module for ZF API communication - New endpoint /{project_id}/archives/{archive_id}/request to request a ZIM to be created by zimfarm. - generates collection.json based on files in project - uploads collection.json to S3 - calls zimfarm to create a dedicated, manual, schedule (passing a webhook url) - calls zimfarm to request a task for this schedule - calls zimfarm to delete schedule - records ZF task_id and status change in DB - New email sending capability via Mailgun API - DB Archive Model has new completed_on property - New endpoint /{project_id}/archives/{archive_id}/hook for the zimfarm to inform about status changes - records update in DB - sends notification emails with Templates - Lots of new configuration points (via environs) - Reorganized constants by feature - Reorganized some utils functions into utils modules - Updated alembic post-write hooks to use ruff instead of former isort
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #69 +/- ##
===========================================
- Coverage 94.81% 77.08% -17.74%
===========================================
Files 9 18 +9
Lines 193 912 +719
Branches 15 105 +90
===========================================
+ Hits 183 703 +520
- Misses 8 187 +179
- Partials 2 22 +20 ☔ View full report in Codecov by Sentry. |
Instead of having an ArchiveConfig model in code that's serialized/deserialized into a dict to enter DB (stored as JSONB) We now declare the Archive.config as a proper ArchiveConfig and have the serialization done automatically. This preserves type hints all the way and allows properties access ArchiveConfig now moved to model as it's part (sub) of a model. In addition, ArchiveConfig gets an `is_ready()` method that checks values with scraperlib preventing request of incorrect archive config
- introducing a new AsynClient for proper stacktrace in tests errors (all tests should be converted to use it!) - better ArchiveConfig fixture - mock (only success for now) of requests calls in zimfarm - mock (only success for now) of calls to S3 - added test of empty project list (actually tests that fixture works OK)
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.
/{project_id}/archives/{archive_id}/request
to request a ZIM to be created by zimfarm./{project_id}/archives/{archive_id}/hook
for the zimfarm to inform about status changesFixes #10