diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-03-29 15:17:46 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-03-29 15:18:11 +0300 |
commit | e246efa00fae54ffa943f7b5b0ae2cb87273f91c (patch) | |
tree | 6ab9073d779bd0a1aaf4b1f284684b7ae4f01c16 | |
parent | 7f792c876e1eb1983dd92aca52c223ec5a09ff02 (diff) |
blob: Remove dependency on Ruby sidecar
Now that the LFS RPCs have been ported from Ruby to Go, the blob service
server has no dependency on the Ruby server anymore. Remove the
dependency both from the server itself as well as from our testcode.
-rw-r--r-- | internal/gitaly/service/blob/server.go | 5 | ||||
-rw-r--r-- | internal/gitaly/service/blob/testhelper_test.go | 10 | ||||
-rw-r--r-- | internal/gitaly/service/register.go | 2 |
3 files changed, 4 insertions, 13 deletions
diff --git a/internal/gitaly/service/blob/server.go b/internal/gitaly/service/blob/server.go index 42b0809ab..4567d2ff2 100644 --- a/internal/gitaly/service/blob/server.go +++ b/internal/gitaly/service/blob/server.go @@ -3,22 +3,19 @@ package blob import ( "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/gitaly/config" - "gitlab.com/gitlab-org/gitaly/internal/gitaly/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/storage" "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" ) type server struct { - ruby *rubyserver.Server cfg config.Cfg locator storage.Locator gitCmdFactory git.CommandFactory } // NewServer creates a new instance of a grpc BlobServer -func NewServer(rs *rubyserver.Server, cfg config.Cfg, locator storage.Locator, gitCmdFactory git.CommandFactory) gitalypb.BlobServiceServer { +func NewServer(cfg config.Cfg, locator storage.Locator, gitCmdFactory git.CommandFactory) gitalypb.BlobServiceServer { return &server{ - ruby: rs, cfg: cfg, locator: locator, gitCmdFactory: gitCmdFactory, diff --git a/internal/gitaly/service/blob/testhelper_test.go b/internal/gitaly/service/blob/testhelper_test.go index af059b28c..4dd6986a4 100644 --- a/internal/gitaly/service/blob/testhelper_test.go +++ b/internal/gitaly/service/blob/testhelper_test.go @@ -8,7 +8,6 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/git/gittest" "gitlab.com/gitlab-org/gitaly/internal/gitaly/config" - "gitlab.com/gitlab-org/gitaly/internal/gitaly/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/internal/testhelper/testcfg" "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" @@ -30,24 +29,19 @@ func testMain(m *testing.M) int { func setup(t *testing.T) (config.Cfg, *gitalypb.Repository, string, gitalypb.BlobServiceClient) { cfg := testcfg.Build(t) - repo, repoPath, client := setupWithRuby(t, cfg, nil) - return cfg, repo, repoPath, client -} - -func setupWithRuby(t *testing.T, cfg config.Cfg, rubySrv *rubyserver.Server) (*gitalypb.Repository, string, gitalypb.BlobServiceClient) { repo, repoPath, cleanup := gittest.CloneRepoAtStorage(t, cfg.Storages[0], t.Name()) t.Cleanup(cleanup) srv := testhelper.NewServer(t, nil, nil) t.Cleanup(srv.Stop) - gitalypb.RegisterBlobServiceServer(srv.GrpcServer(), NewServer(rubySrv, cfg, config.NewLocator(cfg), git.NewExecCommandFactory(cfg))) + gitalypb.RegisterBlobServiceServer(srv.GrpcServer(), NewServer(cfg, config.NewLocator(cfg), git.NewExecCommandFactory(cfg))) srv.Start(t) conn, err := grpc.Dial("unix://"+srv.Socket(), grpc.WithInsecure()) require.NoError(t, err) t.Cleanup(func() { conn.Close() }) - return repo, repoPath, gitalypb.NewBlobServiceClient(conn) + return cfg, repo, repoPath, gitalypb.NewBlobServiceClient(conn) } diff --git a/internal/gitaly/service/register.go b/internal/gitaly/service/register.go index 89df6b041..7b9934bf2 100644 --- a/internal/gitaly/service/register.go +++ b/internal/gitaly/service/register.go @@ -71,7 +71,7 @@ func RegisterAll( gitCmdFactory git.CommandFactory, ling *linguist.Instance, ) { - gitalypb.RegisterBlobServiceServer(grpcServer, blob.NewServer(rubyServer, cfg, locator, gitCmdFactory)) + gitalypb.RegisterBlobServiceServer(grpcServer, blob.NewServer(cfg, locator, gitCmdFactory)) gitalypb.RegisterCleanupServiceServer(grpcServer, cleanup.NewServer(cfg, gitCmdFactory)) gitalypb.RegisterCommitServiceServer(grpcServer, commit.NewServer(cfg, locator, gitCmdFactory, ling)) gitalypb.RegisterDiffServiceServer(grpcServer, diff.NewServer(cfg, locator, gitCmdFactory)) |