ubclaunchpad / rocket2

🚀 The official UBC Launch Pad Slack bot and team management platform
https://rocket2.readthedocs.io
Other
18 stars 6 forks source link

404 error for webhooks when Github expects 200 always #584

Closed chuck-sys closed 4 years ago

chuck-sys commented 4 years ago

Summary

Server sends 404 statuses responding to Github webhooks when it should only send 200 statuses.

Reproduction steps

image

Context

There might be other places that are also using 4xx error codes instead of the correct 2xx statuses. Fix those as well.

chuck-sys commented 4 years ago

See https://docs.github.com/en/free-pro-team@latest/rest/guides/best-practices-for-integrators#favor-asynchronous-work-over-synchronous for their opinions on this. Like slack, we want to respond as soon as possible. Since webhook things usually terminate in less than a second, we shouldn't need to set up async with this. But we still need to change the status codes to be more reflective of intent. Mainly it should reflect whether the webhook event is processed or not.