Merge request tree view sorts differently from file list in changes
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
In certain constellations, the order of files in the tree view differs from the order of files in the main view. This can confuse reviewers making them believe they look at one file while looking at the other.
Steps to reproduce
- Create a merge request with changes that fulfill the following criteria (Demonstrated in the screenshot)
- Change files in 2 different directories with a multi level parent directory
- Directory names start with the same string consisting of letters
- One dir name is just the string
- Other dir name is the string with a prefix of "-" and letters
- Changes are in a identically named subdirectory of each directory.
- View the "Changes" tab of the MR
- Select tree view for the list of files on the left.
- Compare order of files in the tree view with the main content view.
Example Project
cb-perbelding/mr-order-reproducer!1 (diffs)
What is the current bug behavior?
Directory with the suffix is shown first in tree view and second in flat view and main display of changes.
What is the expected correct behavior?
Ordering is consistent across all 3 views.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: \`sudo gitlab-rake gitlab:env:info\`) (For installations from source run and paste the output of: \`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production\`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:check SANITIZE=true`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true`) (we will only investigate if the tests are passing)
Possible fixes
Potentially fixed by switching to diffBlobs RPC: #545058 (comment 2570795992).
Patch release information for backports
If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.
Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.
High-severity bug remediation
To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.