runbot/runbot_merge/controllers
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
..
__init__.py [IMP] runbot_merge: return proper http responses from webhooks 2024-12-18 14:07:22 +01:00
dashboard.py [MERGE] runbot_merge, forwardport: latest updates 2024-11-19 12:18:59 +01:00
reviewer_provisioning.py [FIX] runbot_merge: make provisioning more resilient 2023-06-21 14:26:19 +02:00