Add Workhorse-side Gitaly proxy pieces

What does this MR do and why?

This adds the Workhorse side of the Gitaly proxy: a WebSocket transport layer, metrics, package docs, goleak setup and round-trip tests. It builds on the exported Gitaly proxy package that master already requires. Route wiring, preauthorization and session integration come in the follow-up.

I also bumped Gitaly to v19.5.0-rc3, so importing the proxy no longer pulls in the Sentry SDK. That raises the Go floor to 1.26, so I dropped Go 1.25 from the Workhorse CI matrices.

References

Related to gitlab-org/orbit/knowledge-graph#1252

Gitaly package: gitaly!9243 (merged) (merged)

Follow-up route: !253431

Screenshots or screen recordings

Not applicable: no UI.

How to set up and validate locally

cd workhorse
go build ./...
go vet ./internal/gitalyproxy/...
golangci-lint run ./internal/gitalyproxy/...
go test -race ./internal/gitalyproxy/...
make verify

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Agent context - package import, dependency delta, and chained follow-up

Scope

This MR adds workhorse/internal/gitalyproxy with:

  • A WebSocket net.Conn adapter and a one-connection listener. Unit tests cover framing, deadlines, close handling, byte counters and concurrency.
  • Prometheus metrics for the proxy, with a smoke test that registers every collector.
  • Package docs and goleak test setup.
  • A round-trip gRPC test through Gitaly's exported proxy, using proxy.NewCodec, proxy.TransparentHandler, proxy.StreamPeeker, proxy.StreamParameters and proxy.Destination over Workhorse's WebSocket connection and listener.

The package itself is additive and makes no depguard changes.

Dependencies

  • gitlab.com/gitlab-org/gitaly/v19 goes from v19.5.0-rc2 to v19.5.0-rc3. rc3 is the lowest tag that contains gitaly!9300 (merged). rc2 doesn't have it, rc42 does.
  • With rc3, importing the proxy package no longer adds github.com/getsentry/sentry-go to go.mod.
  • The bump forces the other go.mod / go.sum changes. The go directive moves to 1.26.0, and we get newer labkit, labkit/v2, x/* and otel modules, plus a few new indirect ones (arrow-go, goccy/go-json, lz4, xxh3, cpuid). All of it comes from go get and go mod tidy.
  • Go floor: I dropped "1.25" from the three Workhorse matrices in .gitlab/ci/workhorse.gitlab-ci.yml and moved workhorse/.tool-versions to golang 1.26.9.
  • Binary size: gitlab-workhorse grows by about 8% (94.2 MB to 101.8 MB with -trimpath), mostly from arrow-go, which comes in through azblob.
  • Lint: logging.go now sets Format instead of the deprecated UseTextFormat. JSON still leaves it empty, so GITLAB_LOG_FORMAT keeps its precedence. chainDirector annotates the deprecated ReverseProxy.Director uses, since moving to Rewrite changes header handling and fits better in a follow-up.

Work boundary: follow-up MR

The chained route MR (!253431) handles route wiring, preauthorization, session integration, HTTP/2 draining and runtime setup. This MR is the standalone package addition, and the follow-up adapts the route, lifecycle and contract logic to use it.

Edited by Dmitry Gruzd

Merge request reports

Loading
Loading