Skip to content

HTTP 207 Multi-Status #17

@eddies

Description

@eddies

HTTP 207 Multi-Status

pull_request events with action opened can result in multiple API calls to Trello, e.g.:

  • POST an attachment URL
  • GET boardId
  • GET Custom Fields for a board
  • POST Custom Field to a board
  • PUT custom field to a card

If the Custom Fields Power-Up is not enabled for a board, the POST Custom Field will fail with a 403 Forbidden.

If the board has a Custom Field named 'PR' but is missing one of 'Open', 'Closed' or 'Merged' list options, the PUT will fail with a 500.

So, the attachment URL could succeed but one or more of the subsequent operations could fail. One way to handle this in the response is to return an HTTP 207 Multi-Status.

Alternatively, we could use a 200 with a better response body. Presently, however, we're returning 200s for events that we are not supporting (but doesn't represent an error), e.g. a pull_request event with action 'labeled'. Because we use a different status code (201) for events we do support, it's easy to distinguish the two when parsing logs on GCP and Webhook results from GitHub.

Relevant Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions