diff options
author | John Cai <jcai@gitlab.com> | 2022-04-06 18:32:12 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2022-04-06 18:32:12 +0300 |
commit | eef4eb7da5ce89305c01077e6628836a3caf6ee6 (patch) | |
tree | 82d07c5880727245b41501a891253891eeb23f62 /internal/git | |
parent | 02f95f0b6651ac8e81d0f02b9f15ed86a09019d6 (diff) |
featureflag: Remove TransactionalSymbolicRefUpdates featureflag
This feature flag has been set to default on, and deleted from
production. There have been no observable issues, so it's now safe to
fully remove the feature flag.
Changelog: changed
Diffstat (limited to 'internal/git')
-rw-r--r-- | internal/git/localrepo/refs.go | 13 | ||||
-rw-r--r-- | internal/git/localrepo/refs_test.go | 33 |
2 files changed, 13 insertions, 33 deletions
diff --git a/internal/git/localrepo/refs.go b/internal/git/localrepo/refs.go index 30cc93000..5b0f9e4df 100644 --- a/internal/git/localrepo/refs.go +++ b/internal/git/localrepo/refs.go @@ -14,7 +14,6 @@ import ( "gitlab.com/gitlab-org/gitaly/v14/internal/command" "gitlab.com/gitlab-org/gitaly/v14/internal/git" "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/transaction" - "gitlab.com/gitlab-org/gitaly/v14/internal/metadata/featureflag" "gitlab.com/gitlab-org/gitaly/v14/internal/safe" ) @@ -168,17 +167,7 @@ func (repo *Repo) UpdateRef(ctx context.Context, reference git.ReferenceName, ne // SetDefaultBranch sets the repository's HEAD to point to the given reference. // It will not verify the reference actually exists. func (repo *Repo) SetDefaultBranch(ctx context.Context, txManager transaction.Manager, reference git.ReferenceName) error { - if featureflag.TransactionalSymbolicRefUpdates.IsEnabled(ctx) { - return repo.setDefaultBranchWithTransaction(ctx, txManager, reference) - } - - if err := repo.ExecAndWait(ctx, git.SubCmd{ - Name: "symbolic-ref", - Args: []string{"HEAD", reference.String()}, - }, git.WithRefTxHook(repo)); err != nil { - return err - } - return nil + return repo.setDefaultBranchWithTransaction(ctx, txManager, reference) } // setDefaultBranchWithTransaction sets the repostory's HEAD to point to the given reference diff --git a/internal/git/localrepo/refs_test.go b/internal/git/localrepo/refs_test.go index df5c1c7ec..bd50f1347 100644 --- a/internal/git/localrepo/refs_test.go +++ b/internal/git/localrepo/refs_test.go @@ -18,7 +18,6 @@ import ( "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/config" "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/transaction" "gitlab.com/gitlab-org/gitaly/v14/internal/helper/text" - "gitlab.com/gitlab-org/gitaly/v14/internal/metadata/featureflag" "gitlab.com/gitlab-org/gitaly/v14/internal/safe" "gitlab.com/gitlab-org/gitaly/v14/internal/testhelper" "gitlab.com/gitlab-org/gitaly/v14/internal/testhelper/testcfg" @@ -456,10 +455,7 @@ func TestRepo_UpdateRef(t *testing.T) { } func TestRepo_SetDefaultBranch(t *testing.T) { - testhelper.NewFeatureSets(featureflag.TransactionalSymbolicRefUpdates).Run(t, testRepoSetBranchFeatures) -} - -func testRepoSetBranchFeatures(t *testing.T, ctx context.Context) { + ctx := testhelper.Context(t) _, repo, _ := setupRepo(t) txManager := transaction.NewTrackingManager() @@ -498,19 +494,17 @@ func testRepoSetBranchFeatures(t *testing.T, ctx context.Context) { require.Equal(t, tc.expectedRef, newRef) - if featureflag.TransactionalSymbolicRefUpdates.IsEnabled(ctx) { - require.Len(t, txManager.Votes(), 2) - h := voting.NewVoteHash() - _, err = h.Write([]byte("ref: " + tc.ref.String() + "\n")) - require.NoError(t, err) - vote, err := h.Vote() - require.NoError(t, err) + require.Len(t, txManager.Votes(), 2) + h := voting.NewVoteHash() + _, err = h.Write([]byte("ref: " + tc.ref.String() + "\n")) + require.NoError(t, err) + vote, err := h.Vote() + require.NoError(t, err) - require.Equal(t, voting.Prepared, txManager.Votes()[0].Phase) - require.Equal(t, vote.String(), txManager.Votes()[0].Vote.String()) - require.Equal(t, voting.Committed, txManager.Votes()[1].Phase) - require.Equal(t, vote.String(), txManager.Votes()[1].Vote.String()) - } + require.Equal(t, voting.Prepared, txManager.Votes()[0].Phase) + require.Equal(t, vote.String(), txManager.Votes()[0].Vote.String()) + require.Equal(t, voting.Committed, txManager.Votes()[1].Phase) + require.Equal(t, vote.String(), txManager.Votes()[1].Vote.String()) }) } } @@ -535,10 +529,7 @@ func (b *blockingManager) Stop(_ context.Context, _ txinfo.Transaction) error { } func TestRepo_SetDefaultBranch_errors(t *testing.T) { - ctx := featureflag.ContextWithFeatureFlag( - testhelper.Context(t), - featureflag.TransactionalSymbolicRefUpdates, - true) + ctx := testhelper.Context(t) t.Run("malformed refname", func(t *testing.T) { _, repo, _ := setupRepo(t) |