Implement a new Gitaly call that fetches objects by ID
The Go module proxy (!27746 (merged)) needs to fetch go.mod
at some known path for all valid tags*. Go packages support (!29642 (closed)) needs to fetch go.mod
at all paths for all valid tags*. Currently this causes N+1 Gitaly calls. Other package types that use Git to define resources and versions, such as Puppet, may benefit from this work.
#221109 proposes adding an interface to locate files across a set of refs, returning (object ID, ref name, path) records. In combination with the former interface, another interface for retrieving blobs by object ID would be a more efficient solution to Go's needs than the existing interface, BlobService.GetBlobs
, which requires (commit, path) queries
*A valid Go tag is one that is prefixed with v
and conforms to semantic versioning: vX.Y.Z[-<prerelease>][+<build>]
.
BlobService.GetBlobs
fetches (commit, path) pairs. I'm looking for something that would support fetching blobs directly by object ID. If you look at the sample output on the snippet, there are 99 entries for 98 tags (v1.56.0
also hasproto/go.mod
), but there are only 21 unique objects. It would be feasible to do this with the existing (commit, path) interface, but commits are not intrinsically useful to Go and it would be simpler to work directly with object IDs.