code_corps v0.0.1 CodeCorps.GitHub.Webhook.Handler View Source

Receives and handles GitHub event payloads.

Link to this section Summary

Functions

Handles a fully supported GitHub event based on its type and action

Handles an unsupported supported GitHub event

Link to this section Functions

Link to this function handle_supported(type, id, payload) View Source
handle_supported(String.t(), String.t(), map()) :: {:ok, CodeCorps.GithubEvent.t()}

Handles a fully supported GitHub event based on its type and action.

The handling process consistes of 3 steps

  • create event record marked as “unprocessed”
  • mark event record as processing and handle it
  • mark event record as processed or errored depending on handling outcome
Link to this function handle_unsupported(type, id, payload) View Source
handle_unsupported(String.t(), String.t(), map()) :: {:ok, CodeCorps.GithubEvent.t()}

Handles an unsupported supported GitHub event.

“unsupported” means that, while we generally support this event type, we do not yet support this specific event action.

The process consistes of simply storing the event and marking it as “unsupported”.