Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Okstad <pokstad@gitlab.com>2021-01-14 19:59:11 +0300
committerPaul Okstad <pokstad@gitlab.com>2021-01-14 19:59:11 +0300
commit75547ba7b2a1634e2def88aa2c44dbbfa7908eef (patch)
treea79f2d86f1d0f5b9eed8be183a8efeffd08e4c09
parent64625df11e8add7e64cce44a47984512e5f42d72 (diff)
Remove feature flag for Go version of UserUpdateSubmodule
-rw-r--r--changelogs/unreleased/po-remove-ruby-userupdatesubmodule.yml5
-rw-r--r--internal/gitaly/service/operations/submodules.go18
-rw-r--r--internal/gitaly/service/operations/submodules_test.go43
-rw-r--r--internal/metadata/featureflag/feature_flags.go4
4 files changed, 18 insertions, 52 deletions
diff --git a/changelogs/unreleased/po-remove-ruby-userupdatesubmodule.yml b/changelogs/unreleased/po-remove-ruby-userupdatesubmodule.yml
new file mode 100644
index 000000000..b2056a316
--- /dev/null
+++ b/changelogs/unreleased/po-remove-ruby-userupdatesubmodule.yml
@@ -0,0 +1,5 @@
+---
+title: Remove Ruby implementation of UserUpdateSubmodule
+merge_request: 3005
+author:
+type: performance
diff --git a/internal/gitaly/service/operations/submodules.go b/internal/gitaly/service/operations/submodules.go
index 32eaf6a99..897464dd2 100644
--- a/internal/gitaly/service/operations/submodules.go
+++ b/internal/gitaly/service/operations/submodules.go
@@ -11,9 +11,7 @@ import (
"github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus/ctxlogrus"
"gitlab.com/gitlab-org/gitaly/internal/git"
"gitlab.com/gitlab-org/gitaly/internal/git2go"
- "gitlab.com/gitlab-org/gitaly/internal/gitaly/rubyserver"
"gitlab.com/gitlab-org/gitaly/internal/helper"
- "gitlab.com/gitlab-org/gitaly/internal/metadata/featureflag"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@@ -26,21 +24,7 @@ func (s *Server) UserUpdateSubmodule(ctx context.Context, req *gitalypb.UserUpda
return nil, status.Errorf(codes.InvalidArgument, userUpdateSubmoduleName+": %v", err)
}
- if featureflag.IsEnabled(ctx, featureflag.GoUserUpdateSubmodule) {
- return s.userUpdateSubmodule(ctx, req)
- }
-
- client, err := s.ruby.OperationServiceClient(ctx)
- if err != nil {
- return nil, err
- }
-
- clientCtx, err := rubyserver.SetHeaders(ctx, s.locator, req.GetRepository())
- if err != nil {
- return nil, err
- }
-
- return client.UserUpdateSubmodule(clientCtx, req)
+ return s.userUpdateSubmodule(ctx, req)
}
func validateUserUpdateSubmoduleRequest(req *gitalypb.UserUpdateSubmoduleRequest) error {
diff --git a/internal/gitaly/service/operations/submodules_test.go b/internal/gitaly/service/operations/submodules_test.go
index d1b7e2088..a98a14ef7 100644
--- a/internal/gitaly/service/operations/submodules_test.go
+++ b/internal/gitaly/service/operations/submodules_test.go
@@ -11,19 +11,15 @@ import (
"gitlab.com/gitlab-org/gitaly/internal/git/log"
"gitlab.com/gitlab-org/gitaly/internal/git/lstree"
"gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
- "gitlab.com/gitlab-org/gitaly/internal/metadata/featureflag"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"google.golang.org/grpc/codes"
)
func TestSuccessfulUserUpdateSubmoduleRequest(t *testing.T) {
- testhelper.NewFeatureSets(
- []featureflag.FeatureFlag{featureflag.GoUserUpdateSubmodule},
- ).Run(t, testSuccessfulUserUpdateSubmoduleRequest)
-}
+ ctx, cancel := testhelper.Context()
+ defer cancel()
-func testSuccessfulUserUpdateSubmoduleRequest(t *testing.T, ctx context.Context) {
locator := config.NewLocator(config.Config)
serverSocketPath, stop := runOperationServiceServer(t)
@@ -90,12 +86,9 @@ func testSuccessfulUserUpdateSubmoduleRequest(t *testing.T, ctx context.Context)
}
func TestFailedUserUpdateSubmoduleRequestDueToValidations(t *testing.T) {
- testhelper.NewFeatureSets(
- []featureflag.FeatureFlag{featureflag.GoUserUpdateSubmodule},
- ).Run(t, testFailedUserUpdateSubmoduleRequestDueToValidations)
-}
+ ctx, cancel := testhelper.Context()
+ defer cancel()
-func testFailedUserUpdateSubmoduleRequestDueToValidations(t *testing.T, ctx context.Context) {
serverSocketPath, stop := runOperationServiceServer(t)
defer stop()
@@ -221,12 +214,9 @@ func testFailedUserUpdateSubmoduleRequestDueToValidations(t *testing.T, ctx cont
}
func TestFailedUserUpdateSubmoduleRequestDueToInvalidBranch(t *testing.T) {
- testhelper.NewFeatureSets(
- []featureflag.FeatureFlag{featureflag.GoUserUpdateSubmodule},
- ).Run(t, testFailedUserUpdateSubmoduleRequestDueToInvalidBranch)
-}
+ ctx, cancel := testhelper.Context()
+ defer cancel()
-func testFailedUserUpdateSubmoduleRequestDueToInvalidBranch(t *testing.T, ctx context.Context) {
serverSocketPath, stop := runOperationServiceServer(t)
defer stop()
@@ -251,12 +241,9 @@ func testFailedUserUpdateSubmoduleRequestDueToInvalidBranch(t *testing.T, ctx co
}
func TestFailedUserUpdateSubmoduleRequestDueToInvalidSubmodule(t *testing.T) {
- testhelper.NewFeatureSets(
- []featureflag.FeatureFlag{featureflag.GoUserUpdateSubmodule},
- ).Run(t, testFailedUserUpdateSubmoduleRequestDueToInvalidSubmodule)
-}
+ ctx, cancel := testhelper.Context()
+ defer cancel()
-func testFailedUserUpdateSubmoduleRequestDueToInvalidSubmodule(t *testing.T, ctx context.Context) {
serverSocketPath, stop := runOperationServiceServer(t)
defer stop()
@@ -281,12 +268,9 @@ func testFailedUserUpdateSubmoduleRequestDueToInvalidSubmodule(t *testing.T, ctx
}
func TestFailedUserUpdateSubmoduleRequestDueToSameReference(t *testing.T) {
- testhelper.NewFeatureSets(
- []featureflag.FeatureFlag{featureflag.GoUserUpdateSubmodule},
- ).Run(t, testFailedUserUpdateSubmoduleRequestDueToSameReference)
-}
+ ctx, cancel := testhelper.Context()
+ defer cancel()
-func testFailedUserUpdateSubmoduleRequestDueToSameReference(t *testing.T, ctx context.Context) {
serverSocketPath, stop := runOperationServiceServer(t)
defer stop()
@@ -314,12 +298,9 @@ func testFailedUserUpdateSubmoduleRequestDueToSameReference(t *testing.T, ctx co
}
func TestFailedUserUpdateSubmoduleRequestDueToRepositoryEmpty(t *testing.T) {
- testhelper.NewFeatureSets(
- []featureflag.FeatureFlag{featureflag.GoUserUpdateSubmodule},
- ).Run(t, testFailedUserUpdateSubmoduleRequestDueToRepositoryEmpty)
-}
+ ctx, cancel := testhelper.Context()
+ defer cancel()
-func testFailedUserUpdateSubmoduleRequestDueToRepositoryEmpty(t *testing.T, ctx context.Context) {
serverSocketPath, stop := runOperationServiceServer(t)
defer stop()
diff --git a/internal/metadata/featureflag/feature_flags.go b/internal/metadata/featureflag/feature_flags.go
index c1022357a..18a987a6b 100644
--- a/internal/metadata/featureflag/feature_flags.go
+++ b/internal/metadata/featureflag/feature_flags.go
@@ -31,9 +31,6 @@ var (
GoUserCommitFiles = FeatureFlag{Name: "go_user_commit_files", OnByDefault: false}
// GoResolveConflicts enables the Go implementation of ResolveConflicts
GoResolveConflicts = FeatureFlag{Name: "go_resolve_conflicts", OnByDefault: false}
- // GoUserUpdateSubmodule enables the Go implementation of
- // UserUpdateSubmodules
- GoUserUpdateSubmodule = FeatureFlag{Name: "go_user_update_submodule", OnByDefault: false}
// GoFetchRemote enables the Go implementation of FetchRemote
GoFetchRemote = FeatureFlag{Name: "go_fetch_remote", OnByDefault: true}
// GoUserDeleteTag enables the Go implementation of UserDeleteTag
@@ -120,7 +117,6 @@ var All = []FeatureFlag{
GoUserSquash,
GoUserCommitFiles,
GoResolveConflicts,
- GoUserUpdateSubmodule,
GoFetchRemote,
GoUserDeleteTag,
GoUserCreateTag,