API should support looking up all deployments by user

Proposal

In addition to being able to look up deployments by project (`/projects/:id/deployments), customers with an interest in measuring developer productivity may want to be able to filter by the user who triggered the deployment. A couple of possible endpoints to consider:

  • /projects/:id/deployments?user_id=:user_id would collect all deployments for the given project whose user had the given user ID. I'm proposing user_id here because user is a first-level element of the deployment object returned by the API, and therefore would be predictable according to the pattern we often use for ID lookups in other endpoints (cf. looking up merge requests by author_id).
  • /user/:id/deployments would collect all deployments created by the given user, regardless of project. This would be particularly useful for people in leadership roles wanting to measure their teams' contributions across a large set of projects all at once.