This repository was archived by the owner on Sep 30, 2024. It is now read-only.
gitserver: Implement Stat and ReadDir in gRPC API#62107
Merged
Conversation
Member
Author
ac42853 to
dcd785d
Compare
eseliger
commented
May 7, 2024
46b7f62 to
7a03a1c
Compare
This was referenced May 8, 2024
7a03a1c to
6454f98
Compare
This was referenced May 8, 2024
6454f98 to
f2bf72e
Compare
eseliger
commented
May 10, 2024
f2bf72e to
ecd1764
Compare
6d0b40a to
0a08be5
Compare
This was referenced May 10, 2024
ggilmore
reviewed
May 10, 2024
ggilmore
reviewed
May 10, 2024
ggilmore
reviewed
May 10, 2024
ggilmore
reviewed
May 10, 2024
ggilmore
reviewed
May 10, 2024
ggilmore
reviewed
May 10, 2024
ggilmore
reviewed
May 10, 2024
ggilmore
approved these changes
May 10, 2024
0a08be5 to
4e1c78e
Compare
4e1c78e to
4efccd4
Compare
Member
Author
This was referenced May 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR migrates the calls to git ls-tree to gRPC.
Since ReadDir and Stat used the same git command under the hood, I migrated those two together.
Stat and ReadDir are now simply moved to the backend with the usual layering we did so far.
ListDirectoryChildreneffectively was aReadDirwith some post-request processing into a map, so I moved that logic to the only caller instead and made it just useReadDir.LsFilesuses thels-filescommand which is meant for worktrees and is not a plumbing command so I tried to best replicate its use-cases usingReadDirinstead.There were three use-cases for
LsFilesso far:ReadDirinstead as well.ls-treedoes not support globbing whilels-filesdoes, so we can not do that anymore. BUT: the logic already did filtering in-app, it just used that to reduce the result set to iterate over. So we decided that for now we will go with a ReadDir and then later we can try to find a better replacement here.Closes https://github.com/sourcegraph/sourcegraph/issues/47420
Closes https://github.com/sourcegraph/sourcegraph/issues/60413
Closes https://github.com/sourcegraph/sourcegraph/issues/60414
Test plan
Verified that inference still returns the same results. Also browsed files, opened file trees etc from the web app. Existing E2E test suites also still pass.