Skip to content

GitLab Next

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 2
    • Merge requests 2
  • Requirements
    • Requirements
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLab FOSSGitLab FOSS
  • Merge requests
  • !22166

Merged
Created Oct 06, 2018 by Jason Rutherford@jrutherfordContributor5 of 7 tasks completed5/7 tasks

Feature improved branch filter sorting

  • Overview 43
  • Commits 10
  • Pipelines 11
  • Changes 7

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?

  • Changelog entry added, if necessary
  • Documentation created/updated
  • Tests added for this feature/bug
  • Conforms to the code review guidelines
  • Conforms to the merge request performance guidelines
  • Conforms to the style guides
  • Conforms to the database guides
Edited Oct 10, 2018 by Jason Rutherford
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: feature-improved-branch-filter-sorting

Enable Gitpod?

To use Gitpod you must first enable the feature in the integrations section of your user preferences.

Cancel Enable Gitpod