diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-08-01 12:13:44 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-08-01 12:13:44 +0300 |
commit | d02fe745eb87ef2301d18d04ae0a4964ee3b2d56 (patch) | |
tree | 5c1b4d1a881da39f5348c63d1ddd96c1c3635698 | |
parent | c61904befa4e882cc3990db5f9021c4a559cd8f1 (diff) | |
parent | d1e3c8956384f4c923d20bc4f7fa098a49955d1e (diff) |
Merge branch 'pks-git-upload-pack-remove-hide-refs-ff' into 'master'
git: Remove feature flag to hide refs in git-upload-pack(1)
Closes #4390
See merge request gitlab-org/gitaly!4768
-rw-r--r-- | internal/git/command_description.go | 4 | ||||
-rw-r--r-- | internal/git/command_factory.go | 6 | ||||
-rw-r--r-- | internal/git/hooks_options_test.go | 4 | ||||
-rw-r--r-- | internal/gitaly/service/repository/archive_test.go | 9 | ||||
-rw-r--r-- | internal/gitaly/service/smarthttp/inforefs_test.go | 123 | ||||
-rw-r--r-- | internal/gitaly/service/smarthttp/upload_pack_test.go | 37 | ||||
-rw-r--r-- | internal/gitaly/service/ssh/upload_pack_test.go | 41 | ||||
-rw-r--r-- | internal/metadata/featureflag/ff_upload_pack_hide_refs.go | 9 |
8 files changed, 62 insertions, 171 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 d7b311fc7..02940020b 100644 --- a/internal/gitaly/service/ssh/upload_pack_test.go +++ b/internal/gitaly/service/ssh/upload_pack_test.go @@ -96,14 +96,11 @@ func requireRevisionsEqual(t *testing.T, cfg config.Cfg, repoPathA, repoPathB, r func TestUploadPack_timeout(t *testing.T) { t.Parallel() - testhelper.NewFeatureSets(featureflag.UploadPackHideRefs).Run(t, func(t *testing.T, ctx context.Context) { - runTestWithAndWithoutConfigOptions(t, func(t *testing.T, opts ...testcfg.Option) { - testUploadPackTimeout(t, ctx, opts...) - }, testcfg.WithPackObjectsCacheEnabled()) - }) + runTestWithAndWithoutConfigOptions(t, testUploadPackTimeout, testcfg.WithPackObjectsCacheEnabled()) } -func testUploadPackTimeout(t *testing.T, ctx context.Context, opts ...testcfg.Option) { +func testUploadPackTimeout(t *testing.T, opts ...testcfg.Option) { + ctx := testhelper.Context(t) cfg := testcfg.Build(t, opts...) cfg.SocketPath = runSSHServerWithOptions(t, cfg, []ServerOpt{WithUploadPackRequestTimeout(1)}) @@ -138,12 +135,7 @@ func testUploadPackTimeout(t *testing.T, ctx context.Context, opts ...testcfg.Op }) } -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) @@ -382,7 +374,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) @@ -655,13 +647,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()) @@ -754,14 +743,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) @@ -793,14 +778,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, -) |