Skip to content

hooks: Call reference-transaction hook from Ruby HooksService

Patrick Steinhardt requested to merge pks-ruby-reftx-hook into master

When modifying Git references, we want to perform voting on the change that's about to be made to enable strong consistency. While we're currently emulating this behaviour mostly via the pre-receive hook, eventually we'll want to fully migrate to the new reference-transaction hook. This buys us more granularity, allows us to capture reference updates across all commands and also allows us to abort any update.

To reach this goal, there's two steps we need to do: first we need to always invoke Git with appropriate environment variables to make our reference-transaction hook implementation aware of the ongoing transaction. And second we'll need to adjust places where we manually call out to Git hooks.

This commit addresses the second part for our Ruby sidecar, invoking the reference-transaction hook in the hooks service. As the hook implementation is currently hidden behind a feature flag, this commit also sets up a separate feature flag for Ruby. If set, it knows to set up the correct environment variables required by our hook implementation to execute the actual logic.

Implements #3034 (closed).

Edited by Patrick Steinhardt

Merge request reports