Expose "Mode" in rails & gitaly ls_files endpoint for VS Code
Description
The Web IDE currently pulls all file objects from the repository using this endpoint:
For the VSCode Web IDE replacement, we are also looking at using this endpoint. However, we need the Mode of each git object in the response, since we will be initializing an in-browser filesystem implementation based on OverlayFS (to keep track of changes).
Investigation
-
repository#ls_files
calls the Gitaly server which in turn callsgit ls-tree
https://gitlab.com/gitlab-org/gitlab/blob/9a63b10c932d67014ceaf68ef72d5505ae0b2465/lib/gitlab/git/repository.rb#L732 - Gitaly actually receives the Mode (see relevant code), but only serializes the path in the response (see relevant code).
Questions:
- Do we need to do this in a backwards compatible way?
Changelog
- 2022-03-16 Increased scope to include "Mode"
Edited by Chad Woolley