Age | Commit message (Collapse) | Author |
|
When `bundleuri.UploadPackGitConfig()` returns an empty slice, we see
the `PostUploadPackWithSidechannel` RPC fail with `FailedPrecondition`.
The git-upload-pack(1) process started here quits with the error:
fatal: invalid command 'bundle-uri'
Looking at the source code of Git, we see when git-upload-pack(1)
receives the 'bundle-uri' command, it checks if the that capability
should be advertised. To query for this, Git checks if the config
`uploadpack.advertiseBundleURIs` is set to `true`. When Gitaly could not
build a bundle URI to pass to the git-upload-pack(1), this config was
not set, and Git did not accept this command.
For the SmartHTTP protocol Gitaly uses separate processes to handle
'GET info/refs' and 'POST upload-pack', using option `--stateless-rpc`.
Due to this, the server advertised to the client it supports
'bundle-uri' in the 'GET info/refs' response, but in the consecutive
requests we might spawn git-upload-pack(1) without this config, and Git
will not accept the 'bundle-uri' command.
Inject the config `uploadpack.advertiseBundleURIs=true` into all calls
to git-upload-pack(1), even when the bundle-URI cannot be built.
Label: bug::availability
|
|
We want to know if bundle-uri is being used and has been sent along in
the packfile response. This can be useful in RPC logs for
PostUploadPackWithSidechannel and SSHUploadPack, for instance, to tell
whether or not less CPU was used as a result of a client's prefetch of a
bundle through the bundle uri.
|
|
Now all is set up to make it possible to advertise server-side bundles
to be used for bundle-URI. Inject all the git configuration into the
git-upload-pack(1) command to advertise these when possible.
Label: feature::addition
|
|
The first step toward using bundle-URI is making the server advertise it
supports this capability.
Insert uploadpack.advertiseBundleURIs in the git config so the info/refs
response contains the bundle-uri capability.
With this we also introduce the feature flag that allows us to toggle
the use of bundle-URIs.
|