diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-12-04 11:25:37 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-12-04 15:35:58 +0300 |
commit | c47dd732f03780b67133e57b04b9c003f5a1b0a5 (patch) | |
tree | af14b29bda33492a5f3ae080bf56bcacb75630a5 | |
parent | 65cef6e601f996fbbeaed5332dda5719b9021d3c (diff) |
operations: Remove GoUserMergeToRef feature flag
The Go port of UserMergeToRef has been introduced in 13.5, enabled by
default in 13.6 and until now didn't cause any known bugs or
regressions. So let's remove the feature flag altogether.
Note that we still cannot completely get rid of the Ruby codepath. After
porting the feature to Go, the Ruby codepath grew another feature which
is to accept conflicts. As Go doesn't handle this yet, we thus need to
retain the Ruby codepath for now.
4 files changed, 16 insertions, 16 deletions
diff --git a/changelogs/unreleased/pks-go-user-merge-to-ref-remove-ff.yml b/changelogs/unreleased/pks-go-user-merge-to-ref-remove-ff.yml new file mode 100644 index 000000000..321d2ee7b --- /dev/null +++ b/changelogs/unreleased/pks-go-user-merge-to-ref-remove-ff.yml @@ -0,0 +1,5 @@ +--- +title: 'operations: Remove GoUserMergeToRef feature flag' +merge_request: 2879 +author: +type: added diff --git a/internal/gitaly/service/operations/merge.go b/internal/gitaly/service/operations/merge.go index 3cbd0a465..f4c729bb8 100644 --- a/internal/gitaly/service/operations/merge.go +++ b/internal/gitaly/service/operations/merge.go @@ -350,7 +350,9 @@ func (s *Server) UserMergeToRef(ctx context.Context, in *gitalypb.UserMergeToRef return nil, helper.ErrInvalidArgument(err) } - if featureflag.IsEnabled(ctx, featureflag.GoUserMergeToRef) && !in.AllowConflicts { + // Ruby has grown a new feature since being ported to Go, and we don't + // handle that yet. + if !in.AllowConflicts { return s.userMergeToRef(ctx, in) } diff --git a/internal/gitaly/service/operations/merge_test.go b/internal/gitaly/service/operations/merge_test.go index c9b467fb1..1f3ec0240 100644 --- a/internal/gitaly/service/operations/merge_test.go +++ b/internal/gitaly/service/operations/merge_test.go @@ -494,10 +494,9 @@ func TestFailedUserFFBranchDueToHooks(t *testing.T) { } func TestSuccessfulUserMergeToRefRequest(t *testing.T) { - testWithFeature(t, featureflag.GoUserMergeToRef, testSuccessfulUserMergeToRefRequest) -} + ctx, cleanup := testhelper.Context() + defer cleanup() -func testSuccessfulUserMergeToRefRequest(t *testing.T, ctx context.Context) { serverSocketPath, stop := runOperationServiceServer(t) defer stop() @@ -604,10 +603,9 @@ func testSuccessfulUserMergeToRefRequest(t *testing.T, ctx context.Context) { } func TestConflictsOnUserMergeToRefRequest(t *testing.T) { - testWithFeature(t, featureflag.GoUserMergeToRef, testConflictsOnUserMergeToRefRequest) -} + ctx, cleanup := testhelper.Context() + defer cleanup() -func testConflictsOnUserMergeToRefRequest(t *testing.T, ctx context.Context) { serverSocketPath, stop := runOperationServiceServer(t) defer stop() @@ -655,10 +653,9 @@ func testConflictsOnUserMergeToRefRequest(t *testing.T, ctx context.Context) { } func TestFailedUserMergeToRefRequest(t *testing.T) { - testWithFeature(t, featureflag.GoUserMergeToRef, testFailedUserMergeToRefRequest) -} + ctx, cleanup := testhelper.Context() + defer cleanup() -func testFailedUserMergeToRefRequest(t *testing.T, ctx context.Context) { serverSocketPath, stop := runOperationServiceServer(t) defer stop() @@ -758,10 +755,9 @@ func testFailedUserMergeToRefRequest(t *testing.T, ctx context.Context) { } func TestUserMergeToRefIgnoreHooksRequest(t *testing.T) { - testWithFeature(t, featureflag.GoUserMergeToRef, testUserMergeToRefIgnoreHooksRequest) -} + ctx, cleanup := testhelper.Context() + defer cleanup() -func testUserMergeToRefIgnoreHooksRequest(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 18fd4f58e..ad184ab3f 100644 --- a/internal/metadata/featureflag/feature_flags.go +++ b/internal/metadata/featureflag/feature_flags.go @@ -20,8 +20,6 @@ var ( LogCommandStats = FeatureFlag{Name: "log_command_stats", OnByDefault: false} // GoUserMergeBranch enables the Go implementation of UserMergeBranch GoUserMergeBranch = FeatureFlag{Name: "go_user_merge_branch", OnByDefault: false} - // GoUserMergeToRef enable the Go implementation of UserMergeToRef - GoUserMergeToRef = FeatureFlag{Name: "go_user_merge_to_ref", OnByDefault: true} // GoUserFFBranch enables the Go implementation of UserFFBranch GoUserFFBranch = FeatureFlag{Name: "go_user_ff_branch", OnByDefault: false} // GoUserCreateBranch enables the Go implementation of UserCreateBranch @@ -54,7 +52,6 @@ var All = []FeatureFlag{ RubyReferenceTransactionHook, LogCommandStats, GoUserMergeBranch, - GoUserMergeToRef, GoUserFFBranch, GoUserCreateBranch, GoUserDeleteBranch, |