Skip to content

Generate Ruby's Protobuf sources ad-hoc when building Gem and drop generated code

Patrick Steinhardt requested to merge pks-ruby-drop-protobuf-sources into master

The Ruby sidecar is slowly nearing its end: right now, it only implements a single RPC that is in the process of being migrated to Go. This means we'll start to soon remove all the Ruby infrastructure in the Gitaly project.

Part of the infrastructure is the Ruby code generated from our Protobuf definitions. And while we won't need that code ourselves anymore, it is important for clients written in Ruby that want to interface with us. As such, the Gitaly project still has to release the gitaly Gem. In the past, we built the Gem by simply soaking up the code in ruby/proto. But as it does not make any sense for us to keep the Ruby code around anymore this strategy will fail once we have removed it.

Merge the generate-proto-ruby any publish-gem scripts into a single script that:

1. Generates all required Ruby sources into a temporary directory.

2. Writes the `gitaly.gemspec` file into the same directory.

3. Builds the Gitaly Gem from those temporary files.

Like this, all code is generated ad-hoc and doesn't need to be committed to the repository anymore.

Change the Makefile's proto target to not generate Ruby code anymore. Instead, there are two new Makefile targets build-proto-gem and publish-proto-gem that are responsible for building and publishing the Gem, respecfively.

The generated Ruby code is thus stale and removed.

Merge request reports