runbot/runbot_merge/models
Xavier Morel 89411f968f [IMP] runbot_merge: return proper http responses from webhooks
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
2024-12-18 14:07:22 +01:00
..
backport [FIX] runbot_merge: backport wizard 2024-11-18 09:48:48 +01:00
crons [IMP] runbot_merge: auto-trigger cron for issue closing 2024-12-16 09:11:19 +01:00
project_freeze [REM] runbot_merge: freeze wizard auto-refresh 2024-12-02 16:32:53 +01:00
staging_cancel [ADD] runbot_merge: stagings canceling wizard 2022-12-08 10:46:22 +01:00
__init__.py [MERGE] runbot_merge, forwardport: latest updates 2024-11-19 12:18:59 +01:00
batch.py [MERGE] runbot_merge, forwardport: latest updates 2024-11-19 12:18:59 +01:00
commands.py [FIX] *: UX around fw=no 2024-09-17 11:31:20 +02:00
events_sources.py [ADD] *: per-repository webhook secret 2024-06-06 11:07:57 +02:00
ir_actions.py [IMP] runbot_merge: add json & requests to server actions context 2023-02-20 10:13:05 +01:00
ir_ui_view.py [IMP] runbot_merge: suppress view validation warning 2024-09-27 12:53:51 +02:00
mail_thread.py [MERGE] bot from 16.0 to 17.0 2024-08-12 13:13:03 +02:00
patcher.py [IMP] runbot_merge: inspectability of patch parsing 2024-12-02 16:32:53 +01:00
project.py [FIX] project creation: handling of mergebot info 2024-12-02 16:32:53 +01:00
pull_requests.py [IMP] runbot_merge: return proper http responses from webhooks 2024-12-18 14:07:22 +01:00
res_partner.py [MERGE] bot from 16.0 to 17.0 2024-08-12 13:13:03 +02:00
stagings_create.py [ADD] runbot_merge: basic support for false positive detection 2024-12-09 16:02:28 +01:00
utils.py [FIX] runbot_merge: reset markdown renderer 2024-10-29 13:13:59 +01:00