mirror of
https://github.com/odoo/runbot.git
synced 2025-03-19 17:35:45 +07:00
![]() The old controller system required `type='json'` which only did JSON-RPC and prevented returning proper responses. As of 17.0 this is not the case anymore, `type='http'` controllers can get `content-type: application/json` requests just fine and return whatever they want. So change that: - `type='json'`. - Return `Response` objects with nice status codes (and text mimetypes, as otherwise werkzeug defaults to html). - Update ping to bypass normal flow as otherwise it requires authentication and event sources which is annoying (it might be a good idea to have both in order to check for configuration, however it's not possible to just send a ping via the webhook UI on github so not sure how useful that would be). - Add some typing and improve response messages while at it. Note: some "internal" errors (e.g. ignoring event actions) are reported as successes because as far as I can tell webhooks only support success (2xy) / failure (4xy, 5xy) and an event that's ignored is not really *failed* per se. Some things are reported as failures even though they are on the edge because that can be useful to see what's happening e.g. comment too large or unable to lock rows. Fixes #1019 |
||
---|---|---|
.. | ||
backport | ||
crons | ||
project_freeze | ||
staging_cancel | ||
__init__.py | ||
batch.py | ||
commands.py | ||
events_sources.py | ||
ir_actions.py | ||
ir_ui_view.py | ||
mail_thread.py | ||
patcher.py | ||
project.py | ||
pull_requests.py | ||
res_partner.py | ||
stagings_create.py | ||
utils.py |