diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c6053e6c69780535c71b443f5d41b62f805d0312..04bc1e0b3433c5b2dae32fb72a1a2c720aaad81d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -107,7 +107,7 @@ build:go1.14: build:go1.13: <<: *build_definition - image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6-golang-1.13-git-2.24 + image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6-golang-1.13-git-2.25 binaries_go1.14: <<: *assemble_definition @@ -115,30 +115,22 @@ binaries_go1.14: binaries_go1.13: <<: *assemble_definition - image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6-golang-1.13-git-2.24 + image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6-golang-1.13-git-2.25 test:go1.14-git-2.26-ruby-2.6: image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6-golang-1.14-git-2.26 <<: *test_definition -test:go1.14-git-2.24-ruby-2.6: - image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6-golang-1.14-git-2.24 - <<: *test_definition - -test:go1.14-git-2.22-ruby-2.6: - image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6-golang-1.14-git-2.26 +test:go1.14-git-2.25-ruby-2.6: + image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6-golang-1.14-git-2.25 <<: *test_definition test:go1.13-git-2.26-ruby-2.6: image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6-golang-1.13-git-2.26 <<: *test_definition -test:go1.13-git-2.24-ruby-2.6: - image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6-golang-1.13-git-2.22 - <<: *test_definition - -test:go1.13-git-2.22-ruby-2.6: - image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6-golang-1.13-git-2.24 +test:go1.13-git-2.25-ruby-2.6: + image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6-golang-1.13-git-2.25 <<: *test_definition test:proxy: diff --git a/internal/service/repository/gc.go b/internal/service/repository/gc.go index ab4099855412f73eeec7328f13e813c6879b3e7d..c79e72d6dbc80e2eec5c02b78d1f78519d0665e0 100644 --- a/internal/service/repository/gc.go +++ b/internal/service/repository/gc.go @@ -43,10 +43,6 @@ func (*server) GarbageCollect(ctx context.Context, in *gitalypb.GarbageCollectRe return nil, err } - if err := configureCommitGraph(ctx, in); err != nil { - return nil, err - } - // Perform housekeeping post GC err = housekeeping.Perform(ctx, repoPath) if err != nil { @@ -61,11 +57,6 @@ func (*server) GarbageCollect(ctx context.Context, in *gitalypb.GarbageCollectRe func gc(ctx context.Context, in *gitalypb.GarbageCollectRequest) error { args := repackConfig(ctx, in.CreateBitmap) - // run garbage collect and also write the commit graph - args = append(args, - git.ValueFlag{"-c", "gc.writeCommitGraph=true"}, - ) - cmd, err := git.SafeCmd(ctx, in.GetRepository(), args, git.SubCmd{Name: "gc"}, ) @@ -87,28 +78,6 @@ func gc(ctx context.Context, in *gitalypb.GarbageCollectRequest) error { return nil } -func configureCommitGraph(ctx context.Context, in *gitalypb.GarbageCollectRequest) error { - cmd, err := git.SafeCmd(ctx, in.GetRepository(), nil, git.SubCmd{ - Name: "config", - Flags: []git.Option{ - git.ConfigPair{"core.commitGraph", "true"}, - }, - }) - if err != nil { - if _, ok := status.FromError(err); ok { - return err - } - - return helper.ErrInternal(fmt.Errorf("GarbageCollect: config gitCommand: %v", err)) - } - - if err := cmd.Wait(); err != nil { - return helper.ErrInternal(fmt.Errorf("GarbageCollect: config cmd wait: %v", err)) - } - - return nil -} - func cleanupKeepArounds(ctx context.Context, repo *gitalypb.Repository) error { repoPath, err := helper.GetRepoPath(repo) if err != nil { diff --git a/internal/service/repository/gc_test.go b/internal/service/repository/gc_test.go index 1295e32757ab4edac378d1a61e258934b6a8db17..7a3cbdd26c5034180ec9b96c8325c6649862b2d8 100644 --- a/internal/service/repository/gc_test.go +++ b/internal/service/repository/gc_test.go @@ -50,19 +50,6 @@ func TestGarbageCollectCommitGraph(t *testing.T) { filepath.Join(testRepoPath, "objects/info/commit-graph"), "pre-computed commit-graph should exist after running garbage collect", ) - - repoCfgPath := filepath.Join(testRepoPath, "config") - - cfgF, err := os.Open(repoCfgPath) - require.NoError(t, err) - defer cfgF.Close() - - cfg, err := testhelper.ParseConfig(cfgF) - require.NoError(t, err) - - actualValue, ok := cfg.GetValue("core", "commitGraph") - require.True(t, ok) - require.Equal(t, "true", actualValue) } func TestGarbageCollectSuccess(t *testing.T) {