Find file no longer respects selected branch/tag/revision
Summary
The "Find file" button no longer respects the selected branch/tag/revision when searching for files. This appears like it may have been broken with the changes made to the find file UI at !148025 (merged).
Steps to reproduce
- Open any of:
- the
15-0-stable-ee
branch at https://gitlab.com/gitlab-org/gitlab/-/tree/15-0-stable-ee - the
v15.0.0-ee
tag at https://gitlab.com/gitlab-org/gitlab/-/tree/v15.0.0-ee - the cfbe6615 revision at https://gitlab.com/gitlab-org/gitlab/-/tree/cfbe66152221e145887292210a430679c48d64af
- the
- Hit the
t
keyboard shortcut to find a file - Search for
onboarding_progress.rb
and observe the results - Change the file being searched for to
.gitlab-ci.yml
and select the first result
What is the current bug behavior?
After step 3, no onboarding_progress.rb
file result is displayed.
After step 4, the .gitlab-ci.yml
file in the default branch is opened, i.e. https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab-ci.yml
The same behaviour occurs for branches.
What is the expected correct behavior?
After step 3, an onboarding_progress.rb
file result is displayed that will open:
-
https://gitlab.com/gitlab-org/gitlab/-/blob/15-0-stable-ee/app/models/onboarding_progress.rb if the
15-0-stable-ee
branch was originally opened -
https://gitlab.com/gitlab-org/gitlab/-/blob/v15.0.0-ee/app/models/onboarding_progress.rb if the
v15.0.0-ee
tag was originally opened - https://gitlab.com/gitlab-org/gitlab/-/blob/cfbe66152221e145887292210a430679c48d64af/app/models/onboarding_progress.rb if the repository was opened at the cfbe6615 revision
After step 4, the .gitlab-ci.yml
file in the v15.0.0
tag is opened, i.e. https://gitlab.com/gitlab-org/gitlab/-/blob/v15.0.0-ee/.gitlab-ci.yml
Impact
This hampers inspecting code when investigating problems that have been identified against a specific tag/branch:
- if the file doesn't exist in the default branch:
- it causes confusion when a file which is known to exist for a specific branch/tag/revision isn't returned in the search results dialog
- to view the file you'll need to know where the file is in the directory structure of the branch/tag/revision, or otherwise you'll potentially have to resort to locating it in the directory structure manually
- if the file exists in both the selected branch/tag/revision and the default branch:
- if you didn't notice the repository was reset back to the default branch it can mislead and confuse the investigation
- if you did notice the repository was reset back to the default branch you then have to reselect the original branch/tag/revision again to see the file at that branch/tag/revision