Skip to content

Validate sort parameter for branches page and branches API

Vasilii Iakliushin requested to merge improve_sort_validation_for_branches into master

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

Screenshot_2022-01-30_at_15.15.28

Screenshot_2022-01-30_at_15.15.55

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.

Merge request reports