Validate sort parameter for branches page and branches API
What does this MR do and why?
Sentry error: https://sentry.gitlab.net/gitlab/gitlabcom/issues/3174990
Problem
Incorrect sort value for branches query causes an ArgumentError
Solution
- Add a validation that sort has an accepted value.
- Notify user about the error
Screenshots or screen recordings
How to set up and validate locally
http://127.0.0.1:3000/flightjs/Flight/-/branches?state=all&sort=unknown
http://127.0.0.1:3000/api/v4/projects/6/repository/branches?sort=unknown
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.