Remove `ref` from the allowed sort options in Deployments API
Context
The index_deployments_on_project_id_and_ref
index in the deployments
table is one of the indexes that we are aiming to drop as part of the epic Remove unused indexes on deployments table (&10185)
This has a usage of about 0.0004166688087973783
according to Thanos
The index could possibly be used when the list deployments API call has an order_by=ref
parameter. However, ordering by ref
has no practical use case, and there are no requests that actually specify this parameter.
We need to remove the ref
from the allowed sort options so that we can then safely drop index_deployments_on_project_id_and_ref
.
See discussion here: #402511 (comment 1379456505)
Proposal
Remove ref
from the allowed sort options in the Deployments API -> List deployments endpoint.
You can do this by updating the DeploymentsFinder
class: https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/finders/deployments_finder.rb#L28
Datapoint
- Looking at Kibana, there are no requests that specifies the parameter, so it's less likely that impacts end users.