Modify GetBlobs RPC to return type
Since we need a batch finder for tree entries, we can use the FindBlobs RPC to return any object that is at a revision:path
Fixes: #1608 (closed)
The problem in https://gitlab.com/gitlab-org/gitlab-ce/issues/58657 that this is meant to address is that Commit#uri_type
calls Gitlab::Git::Commit#tree_entry
, and Commit#uri_type
gets called repeatedly.
It seems that all Commit#uri_type
cares about is the type of the object in question at the revision:path of the repository.
Since the GetTreeEntry
RPC is more or less doing the same thing as the GetBlobs
RPC, it is easy to retrofit the GetBlobs
RPC with the following:
- add
Type
field toGetBlobsResponse
- allow the RPC to return non-blob, non-commit objects (right now if its not a commit nor a blob it returns an error)
This is not a great solution since now GetBlobs
really means GetTheObjectAtPathAndRevision
- but, since GetBlobs
already mixes the concepts of Commit
and Blob
, this may be the lesser of two evils. (The other option being create a brand new batch tree entry RPC)