automatize deployment to k8s (⚠️ ZIMIT_KUBE_CONFIG secret must be set in repo before merging ⚠️)
align CI with Python bootstrap conventions
Changes
add a development stack based on Docker-Compose to test the whole stuff (Zimit + Zimfarm) locally
simplify the Exception handling logic in Zimit API to produce consistent results / simplify code maintenance
in case of Zimfarm error, log the Zimfarm response in API under all all log levels (not just DEBUG) since this is useful (including for detecting what is most common user error) and not supposed to happen a lot (UI should prevent user to do silly things)
change first part of Zimit UI error message from "Unable to create schedule" to "Unable to request ZIM creation". At this stage of the message this is the only thing we know. Details are added on the next line (did we encountered an error at schedule creation or task request).
simplify second part of Zimit UI error message which was handling many potential situation:
stop considering that API response may contain either error or error_description or message fields ; in fact this response comes from Zimit API and we know there is only a potential error field
if error field is present in the API response, display it "as-is" and without Zimit API HTTP response code (this is too technical for the end user + we return almost always the same one) ; display it no matter the HTTP response code (it was only done for HTTP 400 before)
otherwise, display API HTTP response status code + status text message (as before)
NOTA:
this still displays the Zimfarm HTTP error code because it is impossible to retrieve this info from the UI otherwise, even for an expert user
the fact that "INTERNAL SERVER ERROR" is in capital letters is probably only a side-effect link to the fact that in the dev stack I do not use nginx reverse proxy but directly the Flask app
Screenshots
Before:
After, when API provides error data:
After, when API does not provide error data but just HTTP status code (and maybe other data we do not know how to use):
Rationale
ZIMIT_KUBE_CONFIG
secret must be set in repo before merging ⚠️)Changes
error
orerror_description
ormessage
fields ; in fact this response comes from Zimit API and we know there is only a potentialerror
fielderror
field is present in the API response, display it "as-is" and without Zimit API HTTP response code (this is too technical for the end user + we return almost always the same one) ; display it no matter the HTTP response code (it was only done for HTTP 400 before)NOTA:
Screenshots
Before:
After, when API provides error data:
After, when API does not provide error data but just HTTP status code (and maybe other data we do not know how to use):