RepositoryService: implement GetArchive
This has a direct application to heptapod#204 (closed), without going through the Rails application.
- Show closed items
Related merge requests 1
When this merge request is accepted, this issue will be closed automatically.
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Georges Racinet changed milestone to %Heptapod 0.17.0
changed milestone to %Heptapod 0.17.0
- Author Owner
Of course, this needs to be full tests.
I don't yet how it's done in Gitaly (I suppose it's calling
git archive
), but I can take a look if needed.Amazingly, the response message is specified as just
bytes
. I suppose gRPC is a streaming protocol anyway. Collapse replies - Author Owner
that was wrong, it's actually a stream of
GetArchiveResponse
messages and these are just bytes.
- Georges Racinet added New Service Method label
added New Service Method label
- Author Owner
Gitaly implementation in GitLab 13.4.3 (possible upstream target for %Heptapod 0.17.0 )
I think with this:
writer := streamio.NewWriter(func(p []byte) error { return stream.Send(&gitalypb.GetArchiveResponse{Data: p}) }) return handleArchive(ctx, writer, in, compressCmd, format, path, exclude)
and later on, in
handleArchive
, no-o
in thegit archive
subprocess, so that it writes onstdout
, followed byif _, err = io.Copy(writer, archiveCommand); err != nil { return err }
They are effectively piping the output of
git archive
right in the response, but I didn't really check and I'm silencing compression options (what are they useful for if the format is bz2 anyway?).Edited by Georges Racinet - Author Owner
Writing to an anonymous tempfile and then re-reading that would be good enough, but I suppose something better can be done by internal Mercurial calls if a file-like object can be passed down, without eating up too much RAM.
At this point, I don't know what the internals behind
hg archive
really are. - Georges Racinet assigned to @gracinet
assigned to @gracinet
- Georges Racinet mentioned in commit 0074497384d8
mentioned in commit 0074497384d8
- Georges Racinet mentioned in commit d37a9b101a41
mentioned in commit d37a9b101a41
- Georges Racinet mentioned in commit 545303eda485
mentioned in commit 545303eda485
- Georges Racinet mentioned in merge request !5 (merged)
mentioned in merge request !5 (merged)
- Georges Racinet mentioned in commit fe6737d19352
mentioned in commit fe6737d19352
- Georges Racinet closed with merge request !5 (merged)
closed with merge request !5 (merged)