diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-12-04 11:13:09 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-12-04 11:18:09 +0300 |
commit | e58464bac5e2e60da3ddc8a7696b079d61763f94 (patch) | |
tree | e49246057a0ad52392be8ef0e717ab074267c025 | |
parent | 65cef6e601f996fbbeaed5332dda5719b9021d3c (diff) |
conflicts: Remove GoListConflictFiles feature flag
The ListConflictFiles has been ported to Go in 13.5 and has been
default-enabled in 13.6. No bug reports have surfaced since, so let's
remove the feature flag altogether.
4 files changed, 16 insertions, 69 deletions
diff --git a/changelogs/unreleased/pks-go-list-conflict-files-remove-ff.yml b/changelogs/unreleased/pks-go-list-conflict-files-remove-ff.yml new file mode 100644 index 000000000..ece4c18bd --- /dev/null +++ b/changelogs/unreleased/pks-go-list-conflict-files-remove-ff.yml @@ -0,0 +1,5 @@ +--- +title: 'conflicts: Remove GoListConflictFiles feature flag' +merge_request: 2878 +author: +type: added diff --git a/internal/gitaly/service/conflicts/list_conflict_files.go b/internal/gitaly/service/conflicts/list_conflict_files.go index eb7b0f294..34c8d0fd2 100644 --- a/internal/gitaly/service/conflicts/list_conflict_files.go +++ b/internal/gitaly/service/conflicts/list_conflict_files.go @@ -9,16 +9,12 @@ import ( "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" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) -func (s *server) listConflictFiles(request *gitalypb.ListConflictFilesRequest, stream gitalypb.ConflictsService_ListConflictFilesServer) error { +func (s *server) ListConflictFiles(request *gitalypb.ListConflictFilesRequest, stream gitalypb.ConflictsService_ListConflictFilesServer) error { ctx := stream.Context() if err := validateListConflictFilesRequest(request); err != nil { @@ -129,43 +125,6 @@ func (s *server) listConflictFiles(request *gitalypb.ListConflictFilesRequest, s return nil } -func (s *server) ListConflictFiles(in *gitalypb.ListConflictFilesRequest, stream gitalypb.ConflictsService_ListConflictFilesServer) error { - ctx := stream.Context() - - if featureflag.IsEnabled(ctx, featureflag.GoListConflictFiles) { - return s.listConflictFiles(in, stream) - } - - if err := validateListConflictFilesRequest(in); err != nil { - return status.Errorf(codes.InvalidArgument, "ListConflictFiles: %v", err) - } - - client, err := s.ruby.ConflictsServiceClient(ctx) - if err != nil { - return err - } - - clientCtx, err := rubyserver.SetHeaders(ctx, s.locator, in.GetRepository()) - if err != nil { - return err - } - - rubyStream, err := client.ListConflictFiles(clientCtx, in) - if err != nil { - return err - } - - return rubyserver.Proxy(func() error { - resp, err := rubyStream.Recv() - if err != nil { - md := rubyStream.Trailer() - stream.SetTrailer(md) - return err - } - return stream.Send(resp) - }) -} - func validateListConflictFilesRequest(in *gitalypb.ListConflictFilesRequest) error { if in.GetRepository() == nil { return fmt.Errorf("empty Repository") diff --git a/internal/gitaly/service/conflicts/list_conflict_files_test.go b/internal/gitaly/service/conflicts/list_conflict_files_test.go index fa18db0db..dd10dd0e8 100644 --- a/internal/gitaly/service/conflicts/list_conflict_files_test.go +++ b/internal/gitaly/service/conflicts/list_conflict_files_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitaly/internal/git" - "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" @@ -21,19 +20,10 @@ type conflictFile struct { content []byte } -func testListConflictFiles(t *testing.T, testcase func(t *testing.T, ctx context.Context)) { - testhelper.NewFeatureSets([]featureflag.FeatureFlag{ - featureflag.GoListConflictFiles, - }).Run(t, func(t *testing.T, ctx context.Context) { - testcase(t, ctx) - }) -} - func TestSuccessfulListConflictFilesRequest(t *testing.T) { - testListConflictFiles(t, testSuccessfulListConflictFilesRequest) -} + ctx, cleanup := testhelper.Context() + defer cleanup() -func testSuccessfulListConflictFilesRequest(t *testing.T, ctx context.Context) { serverSocketPath, stop := runConflictsServer(t) defer stop() @@ -105,10 +95,9 @@ end } func TestSuccessfulListConflictFilesRequestWithAncestor(t *testing.T) { - testListConflictFiles(t, testSuccessfulListConflictFilesRequestWithAncestor) -} + ctx, cleanup := testhelper.Context() + defer cleanup() -func testSuccessfulListConflictFilesRequestWithAncestor(t *testing.T, ctx context.Context) { serverSocketPath, stop := runConflictsServer(t) defer stop() @@ -160,10 +149,9 @@ func testSuccessfulListConflictFilesRequestWithAncestor(t *testing.T, ctx contex } func TestListConflictFilesHugeDiff(t *testing.T) { - testListConflictFiles(t, testListConflictFilesHugeDiff) -} + ctx, cleanup := testhelper.Context() + defer cleanup() -func testListConflictFilesHugeDiff(t *testing.T, ctx context.Context) { serverSocketPath, stop := runConflictsServer(t) defer stop() @@ -229,10 +217,9 @@ func buildCommit(t *testing.T, ctx context.Context, repo *gitalypb.Repository, r } func TestListConflictFilesFailedPrecondition(t *testing.T) { - testListConflictFiles(t, testListConflictFilesFailedPrecondition) -} + ctx, cleanup := testhelper.Context() + defer cleanup() -func testListConflictFilesFailedPrecondition(t *testing.T, ctx context.Context) { serverSocketPath, stop := runConflictsServer(t) defer stop() @@ -295,10 +282,9 @@ func testListConflictFilesFailedPrecondition(t *testing.T, ctx context.Context) } func TestFailedListConflictFilesRequestDueToValidation(t *testing.T) { - testListConflictFiles(t, testFailedListConflictFilesRequestDueToValidation) -} + ctx, cleanup := testhelper.Context() + defer cleanup() -func testFailedListConflictFilesRequestDueToValidation(t *testing.T, ctx context.Context) { serverSocketPath, stop := runConflictsServer(t) defer stop() diff --git a/internal/metadata/featureflag/feature_flags.go b/internal/metadata/featureflag/feature_flags.go index 18fd4f58e..2fcdcd47d 100644 --- a/internal/metadata/featureflag/feature_flags.go +++ b/internal/metadata/featureflag/feature_flags.go @@ -30,8 +30,6 @@ var ( GoUserDeleteBranch = FeatureFlag{Name: "go_user_delete_branch", OnByDefault: false} // GoUserSquash enables the Go implementation of UserSquash GoUserSquash = FeatureFlag{Name: "go_user_squash", OnByDefault: true} - // GoListConflictFiles enables the Go implementation of ListConflictFiles - GoListConflictFiles = FeatureFlag{Name: "go_list_conflict_files", OnByDefault: true} // GoUserCommitFiles enables the Go implementation of UserCommitFiles GoUserCommitFiles = FeatureFlag{Name: "go_user_commit_files", OnByDefault: false} // GoResolveConflicts enables the Go implementation of ResolveConflicts @@ -59,7 +57,6 @@ var All = []FeatureFlag{ GoUserCreateBranch, GoUserDeleteBranch, GoUserSquash, - GoListConflictFiles, GoUserCommitFiles, GoResolveConflicts, GoUserUpdateSubmodule, |