Allow feature flags to be set through workhorse
Gitaly has one client that now sets the feature flags in the metadata, or gRPC headers. This is GitLab-Rails as it's the only one with a database and an interface to add feature flags to the database. However, for long running requests it would be great to support feature flags through workhorse too, as that application handles long running HTTP requests.
Info/refs could be cached soon, but the request flow is as follows:
sequenceDiagram
participant Workhorse
participant Rails
participant Gitaly
Workhorse->Rails: Request `https://gitlab.com/gitlab-org/gitlab-ce.git/info/refs?service=git-upload-pack`
Rails->Workhorse: Authentication successful, go to Gitaly now
Workhorse->Gitaly: Request for info/refs on `gitlab-ce`
Gitaly->Workhorse: Here's the data
As you can see, no direct communication is done between Rails and Gitaly. However, if workhorse could relay certain or all headers to Gitaly for internal requests that would allow for setting of feature flags to rails. This mechanism could be extended for GitLab-Shell in a later iteration.