Skip to content

Feature improved branch filter sorting

What does this MR do?

This improves branch filter dropdown results for repositories that have many (hundreds) of branches, especially with branch naming conventions like 1234-feature-x-develop which was branched from the develop branch. In some cases searching a branch dropdown for develop would not return the develop in the dropdown list due to list limit and the large number of matches sorted by name.

1111-develop
2222-develop
...
bugfix-develop

What this MR does is improve the branch filter ordering so that more relevant results are first:

  1. List exact matches first
  2. Previous matching behavior
  3. Added support for begins_with matching (ex. ^develop)
  4. Added support for ends_with matching (ex. develop$)

So a search for develop returns:

develop
1111-develop
2222-develop
...
bugfix-develop

And a search for ^develop returns:

develop
develop-7777
develop-8888
...

And a search for -develop$ returns:

1111-develop
2222-develop
3333-develop
...

What are the relevant issue numbers?

Solves #32063 (closed) Solves #41575 (closed)

Does this MR meet the acceptance criteria?

Edited by Jason Rutherford

Merge request reports