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:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-07-29 09:51:30 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-07-29 09:51:43 +0300
commit1b9a20468a60b735d1aebc9bc24bed949dea35fe (patch)
tree25ec176d61be7235b254ba07163cc3ce16a7609f
parent0fa08d953e0d5497fe5366836d0ed54b9ff557d8 (diff)
git: Remove feature flag to hide refs in git-upload-pack(1)pks-git-upload-pack-remove-hide-refs-ff
With commit 4a789524c (git: Don't advertise internal references via git-upload-pack(1), 2022-07-19) we have started to hide a subset of internal references in git-upload-pack(1) so that these aren't advertised at all anymore. When this change was rolled out to canary initially we observed a short CPU burst and increase in writes on that Gitaly node. This was totally unexpected given that the change was supposed to only mirror what we have already configured in Omnibus anyway, so it shouldn't have caused any visible change in behaviour. We thus decided to retroactively introduce a feature flag for the change via bc34b47ac (git: Introduce feature flag for hiding refs in git-upload-pack(1), 2022-07-26). As it turns out though, the observed behaviour was completely unrelated to the change at hand, and we have subsequently rolled out the flag to production without any observed weirdnesses as initially expected. So let's remove the feature flag again.
-rw-r--r--internal/git/command_description.go4
-rw-r--r--internal/git/command_factory.go6
-rw-r--r--internal/git/hooks_options_test.go4
-rw-r--r--internal/gitaly/service/repository/archive_test.go9
-rw-r--r--internal/gitaly/service/smarthttp/inforefs_test.go123
-rw-r--r--internal/gitaly/service/smarthttp/upload_pack_test.go37
-rw-r--r--internal/gitaly/service/ssh/upload_pack_test.go32
-rw-r--r--internal/metadata/featureflag/ff_upload_pack_hide_refs.go9
8 files changed, 59 insertions, 165 deletions
diff --git a/internal/git/command_description.go b/internal/git/command_description.go
index 2ecd060b3..a1d2aa90e 100644
--- a/internal/git/command_description.go
+++ b/internal/git/command_description.go
@@ -298,12 +298,12 @@ var commandDescriptions = map[string]commandDescription{
},
"upload-pack": {
flags: scNoRefUpdates,
- opts: append([]GlobalOption{
+ opts: append(append([]GlobalOption{
ConfigPair{Key: "uploadpack.allowFilter", Value: "true"},
// Enables the capability to request individual SHA1's from the
// remote repo.
ConfigPair{Key: "uploadpack.allowAnySHA1InWant", Value: "true"},
- }, packConfiguration()...),
+ }, hiddenUploadPackRefPrefixes()...), packConfiguration()...),
},
"version": {
flags: scNoRefUpdates,
diff --git a/internal/git/command_factory.go b/internal/git/command_factory.go
index 23506f192..210288dd4 100644
--- a/internal/git/command_factory.go
+++ b/internal/git/command_factory.go
@@ -16,7 +16,6 @@ import (
"gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/storage"
"gitlab.com/gitlab-org/gitaly/v15/internal/log"
- "gitlab.com/gitlab-org/gitaly/v15/internal/metadata/featureflag"
)
// CommandFactory is designed to create and run git commands in a protected and fully managed manner.
@@ -452,11 +451,6 @@ func (cf *ExecCommandFactory) combineArgs(ctx context.Context, gitConfig []confi
}
combinedGlobals = append(combinedGlobals, commandDescription.opts...)
-
- if sc.Subcommand() == "upload-pack" && featureflag.UploadPackHideRefs.IsEnabled(ctx) {
- combinedGlobals = append(combinedGlobals, hiddenUploadPackRefPrefixes()...)
- }
-
combinedGlobals = append(combinedGlobals, cc.globals...)
for _, configPair := range gitConfig {
combinedGlobals = append(combinedGlobals, ConfigPair{
diff --git a/internal/git/hooks_options_test.go b/internal/git/hooks_options_test.go
index 384c3c5ed..24ebed76b 100644
--- a/internal/git/hooks_options_test.go
+++ b/internal/git/hooks_options_test.go
@@ -11,7 +11,6 @@ import (
"gitlab.com/gitlab-org/gitaly/v15/internal/git"
"gitlab.com/gitlab-org/gitaly/v15/internal/git/gittest"
"gitlab.com/gitlab-org/gitaly/v15/internal/metadata"
- "gitlab.com/gitlab-org/gitaly/v15/internal/metadata/featureflag"
"gitlab.com/gitlab-org/gitaly/v15/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/v15/internal/testhelper/testcfg"
grpcmetadata "google.golang.org/grpc/metadata"
@@ -75,9 +74,6 @@ func TestWithPackObjectsHookEnv(t *testing.T) {
ctx = grpcmetadata.AppendToOutgoingContext(ctx, "user_id", userID, "username", username)
ctx = metadata.OutgoingToIncoming(ctx)
- // We don't care about this feature flag as it doesn't impact behaviour of the system under
- // test.
- ctx = featureflag.IncomingCtxWithFeatureFlag(ctx, featureflag.UploadPackHideRefs, true)
cmd, err := gittest.NewCommandFactory(t, cfg, git.WithSkipHooks()).New(ctx, repo, subCmd, opt)
require.NoError(t, err)
diff --git a/internal/gitaly/service/repository/archive_test.go b/internal/gitaly/service/repository/archive_test.go
index e897af1cf..5f18f8679 100644
--- a/internal/gitaly/service/repository/archive_test.go
+++ b/internal/gitaly/service/repository/archive_test.go
@@ -5,7 +5,6 @@ package repository
import (
"archive/zip"
"bytes"
- "context"
"fmt"
"io"
"os"
@@ -20,7 +19,6 @@ import (
"gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/v15/internal/gitlab"
"gitlab.com/gitlab-org/gitaly/v15/internal/helper/text"
- "gitlab.com/gitlab-org/gitaly/v15/internal/metadata/featureflag"
"gitlab.com/gitlab-org/gitaly/v15/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/v15/internal/testhelper/testcfg"
"gitlab.com/gitlab-org/gitaly/v15/internal/testhelper/testserver"
@@ -167,13 +165,10 @@ func TestGetArchive_success(t *testing.T) {
}
}
-func TestGetArchiveIncludeLfsBlobs(t *testing.T) {
+func TestGetArchive_includeLfsBlobs(t *testing.T) {
t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testGetArchiveIncludeLfsBlobs)
-}
-func testGetArchiveIncludeLfsBlobs(t *testing.T, ctx context.Context) {
- t.Parallel()
+ ctx := testhelper.Context(t)
defaultOptions := gitlab.TestServerOptions{
SecretToken: secretToken,
diff --git a/internal/gitaly/service/smarthttp/inforefs_test.go b/internal/gitaly/service/smarthttp/inforefs_test.go
index 467282911..ef47aabb0 100644
--- a/internal/gitaly/service/smarthttp/inforefs_test.go
+++ b/internal/gitaly/service/smarthttp/inforefs_test.go
@@ -37,14 +37,10 @@ import (
func TestInfoRefsUploadPack_successful(t *testing.T) {
t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testInfoRefsUploadPackSuccessful)
-}
-
-func testInfoRefsUploadPackSuccessful(t *testing.T, ctx context.Context) {
- t.Parallel()
cfg := testcfg.Build(t)
cfg.SocketPath = runSmartHTTPServer(t, cfg)
+ ctx := testhelper.Context(t)
repo, repoPath := gittest.CreateRepository(ctx, t, cfg)
@@ -66,14 +62,10 @@ func testInfoRefsUploadPackSuccessful(t *testing.T, ctx context.Context) {
func TestInfoRefsUploadPack_internalRefs(t *testing.T) {
t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testInfoRefsUploadPackInternalRefs)
-}
-
-func testInfoRefsUploadPackInternalRefs(t *testing.T, ctx context.Context) {
- t.Parallel()
cfg := testcfg.Build(t)
cfg.SocketPath = runSmartHTTPServer(t, cfg)
+ ctx := testhelper.Context(t)
for _, tc := range []struct {
ref string
@@ -105,37 +97,17 @@ func testInfoRefsUploadPackInternalRefs(t *testing.T, ctx context.Context) {
},
{
ref: "refs/tmp/1",
- expectedAdvertisements: func() []string {
- if featureflag.UploadPackHideRefs.IsDisabled(ctx) {
- return []string{
- "HEAD",
- "refs/heads/main\n",
- "refs/tmp/1\n",
- }
- }
-
- return []string{
- "HEAD",
- "refs/heads/main\n",
- }
- }(),
+ expectedAdvertisements: []string{
+ "HEAD",
+ "refs/heads/main\n",
+ },
},
{
ref: "refs/keep-around/1",
- expectedAdvertisements: func() []string {
- if featureflag.UploadPackHideRefs.IsDisabled(ctx) {
- return []string{
- "HEAD",
- "refs/heads/main\n",
- "refs/keep-around/1\n",
- }
- }
-
- return []string{
- "HEAD",
- "refs/heads/main\n",
- }
- }(),
+ expectedAdvertisements: []string{
+ "HEAD",
+ "refs/heads/main\n",
+ },
},
} {
t.Run(tc.ref, func(t *testing.T) {
@@ -158,21 +130,18 @@ func testInfoRefsUploadPackInternalRefs(t *testing.T, ctx context.Context) {
}
}
-func TestInfoRefsUploadPackRepositoryDoesntExist(t *testing.T) {
- t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testInfoRefsUploadPackRepositoryDoesntExist)
-}
-
-func testInfoRefsUploadPackRepositoryDoesntExist(t *testing.T, ctx context.Context) {
+func TestInfoRefsUploadPack_repositoryDoesntExist(t *testing.T) {
t.Parallel()
cfg := testcfg.Build(t)
+
serverSocketPath := runSmartHTTPServer(t, cfg)
rpcRequest := &gitalypb.InfoRefsRequest{Repository: &gitalypb.Repository{
StorageName: cfg.Storages[0].Name,
RelativePath: "doesnt/exist",
}}
+ ctx := testhelper.Context(t)
_, err := makeInfoRefsUploadPackRequest(ctx, t, serverSocketPath, cfg.Auth.Token, rpcRequest)
@@ -184,16 +153,13 @@ func testInfoRefsUploadPackRepositoryDoesntExist(t *testing.T, ctx context.Conte
testhelper.RequireGrpcError(t, expectedErr, err)
}
-func TestInfoRefsUploadPackPartialClone(t *testing.T) {
- t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testInfoRefsUploadPackPartialClone)
-}
-
-func testInfoRefsUploadPackPartialClone(t *testing.T, ctx context.Context) {
+func TestInfoRefsUploadPack_partialClone(t *testing.T) {
t.Parallel()
cfg := testcfg.Build(t)
+
cfg.SocketPath = runSmartHTTPServer(t, cfg)
+ ctx := testhelper.Context(t)
repo, _ := gittest.CreateRepository(ctx, t, cfg, gittest.CreateRepositoryConfig{
Seed: gittest.SeedGitLabTest,
@@ -214,17 +180,13 @@ func testInfoRefsUploadPackPartialClone(t *testing.T, ctx context.Context) {
}
}
-func TestInfoRefsUploadPackGitConfigOptions(t *testing.T) {
- t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testInfoRefsUploadPackGitConfigOptions)
-}
-
-func testInfoRefsUploadPackGitConfigOptions(t *testing.T, ctx context.Context) {
+func TestInfoRefsUploadPack_gitConfigOptions(t *testing.T) {
t.Parallel()
cfg := testcfg.Build(t)
cfg.SocketPath = runSmartHTTPServer(t, cfg)
+ ctx := testhelper.Context(t)
repo, repoPath := gittest.CreateRepository(ctx, t, cfg)
commitID := gittest.WriteCommit(t, cfg, repoPath, gittest.WithBranch("main"), gittest.WithParents())
@@ -242,15 +204,11 @@ func testInfoRefsUploadPackGitConfigOptions(t *testing.T, ctx context.Context) {
})
}
-func TestInfoRefsUploadPackGitProtocol(t *testing.T) {
- t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testInfoRefsUploadPackGitProtocol)
-}
-
-func testInfoRefsUploadPackGitProtocol(t *testing.T, ctx context.Context) {
+func TestInfoRefsUploadPack_gitProtocol(t *testing.T) {
t.Parallel()
cfg := testcfg.Build(t)
+ ctx := testhelper.Context(t)
protocolDetectingFactory := gittest.NewProtocolDetectingCommandFactory(ctx, t, cfg)
@@ -304,16 +262,12 @@ func makeInfoRefsUploadPackRequest(ctx context.Context, t *testing.T, serverSock
return response, err
}
-func TestInfoRefsReceivePackSuccessful(t *testing.T) {
- t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testInfoRefsReceivePackSuccessful)
-}
-
-func testInfoRefsReceivePackSuccessful(t *testing.T, ctx context.Context) {
+func TestInfoRefsReceivePack_successful(t *testing.T) {
t.Parallel()
cfg := testcfg.Build(t)
cfg.SocketPath = runSmartHTTPServer(t, cfg)
+ ctx := testhelper.Context(t)
repo, repoPath := gittest.CreateRepository(ctx, t, cfg)
@@ -333,12 +287,7 @@ func testInfoRefsReceivePackSuccessful(t *testing.T, ctx context.Context) {
})
}
-func TestInfoRefsReceivePackHiddenRefs(t *testing.T) {
- t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testInfoRefsReceivePackHiddenRefs)
-}
-
-func testInfoRefsReceivePackHiddenRefs(t *testing.T, ctx context.Context) {
+func TestInfoRefsReceivePack_hiddenRefs(t *testing.T) {
t.Parallel()
cfg := testcfg.Build(t)
@@ -346,6 +295,7 @@ func testInfoRefsReceivePackHiddenRefs(t *testing.T, ctx context.Context) {
testcfg.BuildGitalyHooks(t, cfg)
cfg.SocketPath = runSmartHTTPServer(t, cfg)
+ ctx := testhelper.Context(t)
repoProto, _ := gittest.CreateRepository(ctx, t, cfg, gittest.CreateRepositoryConfig{
Seed: gittest.SeedGitLabTest,
@@ -380,12 +330,7 @@ func testInfoRefsReceivePackHiddenRefs(t *testing.T, ctx context.Context) {
require.NotContains(t, string(response), commitID+" .have")
}
-func TestInfoRefsReceivePackRepoNotFound(t *testing.T) {
- t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testInfoRefsReceivePackRepoNotFound)
-}
-
-func testInfoRefsReceivePackRepoNotFound(t *testing.T, ctx context.Context) {
+func TestInfoRefsReceivePack_repoNotFound(t *testing.T) {
t.Parallel()
cfg := testcfg.Build(t)
@@ -394,6 +339,7 @@ func testInfoRefsReceivePackRepoNotFound(t *testing.T, ctx context.Context) {
repo := &gitalypb.Repository{StorageName: cfg.Storages[0].Name, RelativePath: "testdata/scratch/another_repo"}
rpcRequest := &gitalypb.InfoRefsRequest{Repository: repo}
+ ctx := testhelper.Context(t)
_, err := makeInfoRefsReceivePackRequest(ctx, t, serverSocketPath, cfg.Auth.Token, rpcRequest)
expectedErr := helper.ErrNotFoundf(`GetRepoPath: not a git repository: "` + cfg.Storages[0].Path + "/" + repo.RelativePath + `"`)
@@ -404,12 +350,7 @@ func testInfoRefsReceivePackRepoNotFound(t *testing.T, ctx context.Context) {
testhelper.RequireGrpcError(t, expectedErr, err)
}
-func TestInfoRefsReceivePackRepoNotSet(t *testing.T) {
- t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testInfoRefsReceivePackRepoNotSet)
-}
-
-func testInfoRefsReceivePackRepoNotSet(t *testing.T, ctx context.Context) {
+func TestInfoRefsReceivePack_repoNotSet(t *testing.T) {
t.Parallel()
cfg := testcfg.Build(t)
@@ -417,6 +358,7 @@ func testInfoRefsReceivePackRepoNotSet(t *testing.T, ctx context.Context) {
serverSocketPath := runSmartHTTPServer(t, cfg)
rpcRequest := &gitalypb.InfoRefsRequest{}
+ ctx := testhelper.Context(t)
_, err := makeInfoRefsReceivePackRequest(ctx, t, serverSocketPath, cfg.Auth.Token, rpcRequest)
testhelper.RequireGrpcCode(t, err, codes.InvalidArgument)
}
@@ -476,12 +418,7 @@ func (ms *mockStreamer) PutStream(ctx context.Context, repo *gitalypb.Repository
return ms.Streamer.PutStream(ctx, repo, req, src)
}
-func TestInfoRefsUploadPackCache(t *testing.T) {
- t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testInfoRefsUploadPackCache)
-}
-
-func testInfoRefsUploadPackCache(t *testing.T, ctx context.Context) {
+func TestInfoRefsUploadPack_cache(t *testing.T) {
t.Parallel()
cfg := testcfg.Build(t)
@@ -497,6 +434,8 @@ func testInfoRefsUploadPackCache(t *testing.T, ctx context.Context) {
gitalyServer := startSmartHTTPServer(t, cfg, withInfoRefCache(mockInfoRefCache))
cfg.SocketPath = gitalyServer.Address()
+ ctx := testhelper.Context(t)
+
repo, repoPath := gittest.CreateRepository(ctx, t, cfg)
commitID := gittest.WriteCommit(t, cfg, repoPath, gittest.WithBranch("main"), gittest.WithParents())
diff --git a/internal/gitaly/service/smarthttp/upload_pack_test.go b/internal/gitaly/service/smarthttp/upload_pack_test.go
index 1bd42a95f..02ca6296e 100644
--- a/internal/gitaly/service/smarthttp/upload_pack_test.go
+++ b/internal/gitaly/service/smarthttp/upload_pack_test.go
@@ -20,7 +20,6 @@ import (
"gitlab.com/gitlab-org/gitaly/v15/internal/git"
"gitlab.com/gitlab-org/gitaly/v15/internal/git/gittest"
"gitlab.com/gitlab-org/gitaly/v15/internal/git/pktline"
- "gitlab.com/gitlab-org/gitaly/v15/internal/metadata/featureflag"
"gitlab.com/gitlab-org/gitaly/v15/internal/sidechannel"
"gitlab.com/gitlab-org/gitaly/v15/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/v15/internal/testhelper/testcfg"
@@ -46,15 +45,15 @@ func runTestWithAndWithoutConfigOptions(
makeRequest requestMaker,
opts ...testcfg.Option,
) {
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, func(t *testing.T, ctx context.Context) {
- t.Run("no config options", func(t *testing.T) { tf(t, ctx, makeRequest) })
+ ctx := testhelper.Context(t)
- if len(opts) > 0 {
- t.Run("with config options", func(t *testing.T) {
- tf(t, ctx, makeRequest, opts...)
- })
- }
- })
+ t.Run("no config options", func(t *testing.T) { tf(t, ctx, makeRequest) })
+
+ if len(opts) > 0 {
+ t.Run("with config options", func(t *testing.T) {
+ tf(t, ctx, makeRequest, opts...)
+ })
+ }
}
func TestServer_PostUpload(t *testing.T) {
@@ -263,18 +262,16 @@ func testServerPostUploadPackSuppressDeepenExitError(t *testing.T, ctx context.C
func TestServer_PostUploadPack_usesPackObjectsHook(t *testing.T) {
t.Parallel()
+ ctx := testhelper.Context(t)
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, func(t *testing.T, ctx context.Context) {
- testServerPostUploadPackUsesPackObjectsHook(t, ctx, makePostUploadPackRequest)
- })
+ testServerPostUploadPackUsesPackObjectsHook(t, ctx, makePostUploadPackRequest)
}
func TestServer_PostUploadPackWithSidechannel_usesPackObjectsHook(t *testing.T) {
t.Parallel()
+ ctx := testhelper.Context(t)
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, func(t *testing.T, ctx context.Context) {
- testServerPostUploadPackUsesPackObjectsHook(t, ctx, makePostUploadPackWithSidechannelRequest)
- })
+ testServerPostUploadPackUsesPackObjectsHook(t, ctx, makePostUploadPackWithSidechannelRequest)
}
func testServerPostUploadPackUsesPackObjectsHook(t *testing.T, ctx context.Context, makeRequest requestMaker, opts ...testcfg.Option) {
@@ -495,18 +492,16 @@ func testServerPostUploadPackPartialClone(t *testing.T, ctx context.Context, mak
func TestServer_PostUploadPack_allowAnySHA1InWant(t *testing.T) {
t.Parallel()
+ ctx := testhelper.Context(t)
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, func(t *testing.T, ctx context.Context) {
- testServerPostUploadPackAllowAnySHA1InWant(t, ctx, makePostUploadPackRequest)
- })
+ testServerPostUploadPackAllowAnySHA1InWant(t, ctx, makePostUploadPackRequest)
}
func TestServer_PostUploadPackWithSidechannel_allowAnySHA1InWant(t *testing.T) {
t.Parallel()
+ ctx := testhelper.Context(t)
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, func(t *testing.T, ctx context.Context) {
- testServerPostUploadPackAllowAnySHA1InWant(t, ctx, makePostUploadPackWithSidechannelRequest)
- })
+ testServerPostUploadPackAllowAnySHA1InWant(t, ctx, makePostUploadPackWithSidechannelRequest)
}
func testServerPostUploadPackAllowAnySHA1InWant(t *testing.T, ctx context.Context, makeRequest requestMaker, opts ...testcfg.Option) {
diff --git a/internal/gitaly/service/ssh/upload_pack_test.go b/internal/gitaly/service/ssh/upload_pack_test.go
index a366d0f80..c8b287b72 100644
--- a/internal/gitaly/service/ssh/upload_pack_test.go
+++ b/internal/gitaly/service/ssh/upload_pack_test.go
@@ -137,12 +137,7 @@ func testUploadPackTimeout(t *testing.T, opts ...testcfg.Option) {
})
}
-func TestUploadPackWithSidechannelClient(t *testing.T) {
- t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testUploadPackWithSidechannelClient)
-}
-
-func testUploadPackWithSidechannelClient(t *testing.T, ctx context.Context) {
+func TestUploadPackWithSidechannel_client(t *testing.T) {
t.Parallel()
cfg := testcfg.Build(t)
@@ -381,7 +376,7 @@ func testUploadPackWithSidechannelClient(t *testing.T, ctx context.Context) {
},
} {
t.Run(tc.desc, func(t *testing.T) {
- ctx, cancel := context.WithCancel(ctx)
+ ctx, cancel := context.WithCancel(testhelper.Context(t))
ctx, waiter := sidechannel.RegisterSidechannel(ctx, registry, func(clientConn *sidechannel.ClientConn) (returnedErr error) {
errCh := make(chan error, 1)
@@ -647,13 +642,10 @@ func testUploadPackSuccessful(t *testing.T, sidechannel bool, opts ...testcfg.Op
}
}
-func TestUploadPackPackObjectsHook(t *testing.T) {
+func TestUploadPack_packObjectsHook(t *testing.T) {
t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testUploadPackPackObjectsHook)
-}
-func testUploadPackPackObjectsHook(t *testing.T, ctx context.Context) {
- t.Parallel()
+ ctx := testhelper.Context(t)
cfg := testcfg.Build(t, testcfg.WithPackObjectsCacheEnabled())
@@ -746,14 +738,10 @@ func testUploadPackWithoutSideband(t *testing.T, opts ...testcfg.Option) {
require.Contains(t, string(out), "PACK")
}
-func TestUploadPackInvalidStorage(t *testing.T) {
- t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testUploadPackInvalidStorage)
-}
-
-func testUploadPackInvalidStorage(t *testing.T, ctx context.Context) {
+func TestUploadPack_invalidStorage(t *testing.T) {
t.Parallel()
+ ctx := testhelper.Context(t)
cfg := testcfg.Build(t)
cfg.SocketPath = runSSHServer(t, cfg)
@@ -785,14 +773,10 @@ func testUploadPackInvalidStorage(t *testing.T, ctx context.Context) {
}
}
-func TestUploadPackGitFailure(t *testing.T) {
- t.Parallel()
- testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, testUploadPackGitFailure)
-}
-
-func testUploadPackGitFailure(t *testing.T, ctx context.Context) {
+func TestUploadPack_gitFailure(t *testing.T) {
t.Parallel()
+ ctx := testhelper.Context(t)
cfg := testcfg.Build(t)
cfg.SocketPath = runSSHServer(t, cfg)
diff --git a/internal/metadata/featureflag/ff_upload_pack_hide_refs.go b/internal/metadata/featureflag/ff_upload_pack_hide_refs.go
deleted file mode 100644
index 1e26e33e5..000000000
--- a/internal/metadata/featureflag/ff_upload_pack_hide_refs.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package featureflag
-
-// UploadPackHideRefs causes git-upload-pack(1) to hide internal references.
-var UploadPackHideRefs = NewFeatureFlag(
- "upload_pack_hide_refs",
- "v15.3.0",
- "https://gitlab.com/gitlab-org/gitaly/-/issues/4390",
- false,
-)