Skip to content

blackbox: Implement support for "push" probes

Patrick Steinhardt requested to merge pks-blackbox-pushes into master

Implement support for "push" probes for gitaly-blackbox. These probes take as input a set of commands which specify which references are to be updated on the remote side as well as a packfile containing necessary objects to complete the request.

The packfile is being provided by the user as a simple path name. While this is a bit awkward given that the user thus has to pre-generate the packfile and put it on disk somewhere, we cannot really assume that the gitaly-blackbox host has a valid Git installation and repository. It's thus not safe to say that we're able to generate the packfile on the fly. So the only alternative to having a packfile on-disk is to manually assemble the packfile via a reimplementation or to have a packfile as static data. Neither of these options seem like the right thing to do, so requiring pre-generated packfiles feels like the least-awful choice.

Note that the commands are static for each probe, which essentially means that the same set of probes will be executed repeatedly. This again is a bit awkward for the user: if executing the same mutating operation multiple times, then latter executions behave differently given that the target reference is likely already at the target reference. While we could implement custom cleanup logic in gitaly-blackbox which automatically removes or resets updated references to their previous state again. For simplicity's sake, we instead put the burden one the user for now: for each probe which does a change, the user can implement a second probe which reverts the change again.

Together, this provides a very simple interface which, given a packfile and a set of commands, updates remote references.

Implements #3650 (closed)

Merge request reports