diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-10-12 14:34:42 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-10-12 14:58:49 +0300 |
commit | e17f73ebc22d792ea9c8d8f4eb1ee674c211c393 (patch) | |
tree | b80054ef8c29a3e0bd2d2d787e91576e093148e4 /internal/gitaly/service/operations | |
parent | d4585848afa0d9a02a84f04b45b5bf6c26b3f55d (diff) |
operations: Drop dependency on Ruby server
The Operations service doesn't need the Ruby server anymore. Drop its
dependency on it.
Diffstat (limited to 'internal/gitaly/service/operations')
6 files changed, 11 insertions, 23 deletions
diff --git a/internal/gitaly/service/operations/branches_test.go b/internal/gitaly/service/operations/branches_test.go index 2bb6c47b5..129c066a3 100644 --- a/internal/gitaly/service/operations/branches_test.go +++ b/internal/gitaly/service/operations/branches_test.go @@ -129,7 +129,6 @@ func TestUserCreateBranchWithTransaction(t *testing.T) { addr := testserver.RunGitalyServer(t, cfg, nil, func(srv *grpc.Server, deps *service.Dependencies) { gitalypb.RegisterOperationServiceServer(srv, NewServer( deps.GetCfg(), - nil, deps.GetHookManager(), deps.GetTxManager(), deps.GetLocator(), @@ -492,7 +491,6 @@ func TestUserDeleteBranch_transaction(t *testing.T) { testserver.RunGitalyServer(t, cfg, nil, func(srv *grpc.Server, deps *service.Dependencies) { gitalypb.RegisterOperationServiceServer(srv, NewServer( deps.GetCfg(), - nil, deps.GetHookManager(), deps.GetTxManager(), deps.GetLocator(), diff --git a/internal/gitaly/service/operations/merge_test.go b/internal/gitaly/service/operations/merge_test.go index ad6b79794..c60b3b236 100644 --- a/internal/gitaly/service/operations/merge_test.go +++ b/internal/gitaly/service/operations/merge_test.go @@ -602,8 +602,8 @@ func TestUserMergeBranch_allowed(t *testing.T) { gitlab.MockPostReceive, ), cfg) - ctx, cfg, repoProto, repoPath, client := setupOperationsServiceWithRuby( - t, ctx, cfg, nil, + ctx, cfg, repoProto, repoPath, client := setupOperationsServiceWithCfg( + t, ctx, cfg, testserver.WithBackchannelRegistry(backchannelRegistry), testserver.WithTransactionManager(txManager), testserver.WithHookManager(hookManager), diff --git a/internal/gitaly/service/operations/rebase_test.go b/internal/gitaly/service/operations/rebase_test.go index 483135b46..6d6221649 100644 --- a/internal/gitaly/service/operations/rebase_test.go +++ b/internal/gitaly/service/operations/rebase_test.go @@ -17,7 +17,6 @@ import ( "gitlab.com/gitlab-org/gitaly/v14/internal/metadata" "gitlab.com/gitlab-org/gitaly/v14/internal/testhelper" "gitlab.com/gitlab-org/gitaly/v14/internal/testhelper/testassert" - "gitlab.com/gitlab-org/gitaly/v14/internal/testhelper/testcfg" "gitlab.com/gitlab-org/gitaly/v14/internal/testhelper/testserver" "gitlab.com/gitlab-org/gitaly/v14/internal/transaction/txinfo" "gitlab.com/gitlab-org/gitaly/v14/internal/transaction/voting" @@ -103,8 +102,8 @@ func TestUserRebaseConfirmableTransaction(t *testing.T) { }, } - ctx, cfg, repoProto, repoPath, client := setupOperationsServiceWithRuby( - t, ctx, testcfg.Build(t), nil, + ctx, cfg, repoProto, repoPath, client := setupOperationsService( + t, ctx, // Praefect would intercept our call and inject its own transaction. testserver.WithDisablePraefect(), testserver.WithTransactionManager(txManager), diff --git a/internal/gitaly/service/operations/server.go b/internal/gitaly/service/operations/server.go index 120af06c6..3f8fd84e4 100644 --- a/internal/gitaly/service/operations/server.go +++ b/internal/gitaly/service/operations/server.go @@ -13,7 +13,6 @@ import ( "gitlab.com/gitlab-org/gitaly/v14/internal/git2go" "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/config" "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/hook" - "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/rubyserver" "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/storage" "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/transaction" "gitlab.com/gitlab-org/gitaly/v14/internal/helper" @@ -23,7 +22,6 @@ import ( type Server struct { gitalypb.UnimplementedOperationServiceServer cfg config.Cfg - ruby *rubyserver.Server hookManager hook.Manager txManager transaction.Manager locator storage.Locator @@ -41,7 +39,6 @@ type Server struct { // NewServer creates a new instance of a grpc OperationServiceServer func NewServer( cfg config.Cfg, - rs *rubyserver.Server, hookManager hook.Manager, txManager transaction.Manager, locator storage.Locator, @@ -50,7 +47,6 @@ func NewServer( catfileCache catfile.Cache, ) *Server { return &Server{ - ruby: rs, cfg: cfg, hookManager: hookManager, txManager: txManager, diff --git a/internal/gitaly/service/operations/tags_test.go b/internal/gitaly/service/operations/tags_test.go index 0a51b392a..1bf43e6f3 100644 --- a/internal/gitaly/service/operations/tags_test.go +++ b/internal/gitaly/service/operations/tags_test.go @@ -278,7 +278,6 @@ func TestUserCreateTagWithTransaction(t *testing.T) { testserver.RunGitalyServer(t, cfg, nil, func(srv *grpc.Server, deps *service.Dependencies) { gitalypb.RegisterOperationServiceServer(srv, NewServer( deps.GetCfg(), - nil, deps.GetHookManager(), deps.GetTxManager(), deps.GetLocator(), diff --git a/internal/gitaly/service/operations/testhelper_test.go b/internal/gitaly/service/operations/testhelper_test.go index 3e8996740..2987d42ee 100644 --- a/internal/gitaly/service/operations/testhelper_test.go +++ b/internal/gitaly/service/operations/testhelper_test.go @@ -9,7 +9,6 @@ import ( "gitlab.com/gitlab-org/gitaly/v14/internal/git/gittest" internalclient "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/client" "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/config" - "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/rubyserver" "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/service" "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/service/commit" "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/service/hook" @@ -38,14 +37,12 @@ func TestMain(m *testing.M) { func setupOperationsService(t testing.TB, ctx context.Context, options ...testserver.GitalyServerOpt) (context.Context, config.Cfg, *gitalypb.Repository, string, gitalypb.OperationServiceClient) { cfg := testcfg.Build(t) - - ctx, cfg, repo, repoPath, client := setupOperationsServiceWithRuby(t, ctx, cfg, nil, options...) - + ctx, cfg, repo, repoPath, client := setupOperationsServiceWithCfg(t, ctx, cfg, options...) return ctx, cfg, repo, repoPath, client } -func setupOperationsServiceWithRuby( - t testing.TB, ctx context.Context, cfg config.Cfg, rubySrv *rubyserver.Server, options ...testserver.GitalyServerOpt, +func setupOperationsServiceWithCfg( + t testing.TB, ctx context.Context, cfg config.Cfg, options ...testserver.GitalyServerOpt, ) (context.Context, config.Cfg, *gitalypb.Repository, string, gitalypb.OperationServiceClient) { repo, repoPath := gittest.CloneRepo(t, cfg, cfg.Storages[0]) @@ -53,7 +50,7 @@ func setupOperationsServiceWithRuby( testhelper.BuildGitalyGit2Go(t, cfg) testhelper.BuildGitalyHooks(t, cfg) - serverSocketPath := runOperationServiceServer(t, cfg, rubySrv, options...) + serverSocketPath := runOperationServiceServer(t, cfg, options...) cfg.SocketPath = serverSocketPath client, conn := newOperationClient(t, serverSocketPath) @@ -65,13 +62,12 @@ func setupOperationsServiceWithRuby( return ctx, cfg, repo, repoPath, client } -func runOperationServiceServer(t testing.TB, cfg config.Cfg, rubySrv *rubyserver.Server, options ...testserver.GitalyServerOpt) string { +func runOperationServiceServer(t testing.TB, cfg config.Cfg, options ...testserver.GitalyServerOpt) string { t.Helper() - return testserver.RunGitalyServer(t, cfg, rubySrv, func(srv *grpc.Server, deps *service.Dependencies) { + return testserver.RunGitalyServer(t, cfg, nil, func(srv *grpc.Server, deps *service.Dependencies) { operationServer := NewServer( deps.GetCfg(), - deps.GetRubyServer(), deps.GetHookManager(), deps.GetTxManager(), deps.GetLocator(), @@ -85,7 +81,7 @@ func runOperationServiceServer(t testing.TB, cfg config.Cfg, rubySrv *rubyserver gitalypb.RegisterHookServiceServer(srv, hook.NewServer(cfg, deps.GetHookManager(), deps.GetGitCmdFactory(), deps.GetPackObjectsCache())) gitalypb.RegisterRepositoryServiceServer(srv, repository.NewServer( deps.GetCfg(), - rubySrv, + nil, deps.GetLocator(), deps.GetTxManager(), deps.GetGitCmdFactory(), |