Allow filtering of deployments in the API by their status
In !17620 (merged) we changed the deployments API to return deployments regardless of their status (minus deployments with the status "created"). It was revealed that we have some code that only expects deployments with a status of "success".
We should add an optional status parameter and use this to filter deployments by their status. By default, all deployments should be produced. The deployments API currently uses AR code directly (e.g. present paginate(user_project.deployments.order(params[:order_by] => params[:sort])), with: Entities::Deployment). We should move this logic to a finder class, and add support for the necessary parameters there.