diff options
author | karthik nayak <knayak@gitlab.com> | 2023-08-24 15:36:12 +0300 |
---|---|---|
committer | karthik nayak <knayak@gitlab.com> | 2023-08-24 15:36:12 +0300 |
commit | d62c05df4a1a1a3ae5c2aa249676758e31bf5ae3 (patch) | |
tree | 112c70e283ceb1935504168675d97c264c46e74f | |
parent | e836dcbf46c68b6c5011ff482e753ddad55c6b95 (diff) | |
parent | 269fac4efa91adeca1ecd297e89b3cdd6678a038 (diff) |
Merge branch '5534-rollout-git-version-v2-42-0' into 'master'
git: Wire up Git v2.42 execution environment
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6274
Merged-by: karthik nayak <knayak@gitlab.com>
Approved-by: James Fargher <jfargher@gitlab.com>
Approved-by: Justin Tobler <jtobler@gitlab.com>
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | internal/featureflag/ff_git_v242.go | 9 | ||||
-rw-r--r-- | internal/git/execution_environment.go | 7 | ||||
-rw-r--r-- | internal/testhelper/testhelper.go | 2 |
4 files changed, 28 insertions, 2 deletions
@@ -130,6 +130,8 @@ GIT_EXECUTABLES += git-http-backend GIT_VERSION ?= ## The Git version used for bundled Git v2.41. GIT_VERSION_2_41 ?= v2.41.0.gl1 +## The Git version used for bundled Git v2.42. +GIT_VERSION_2_42 ?= v2.42.0 ## Skip overriding the Git version and instead use the Git version as specified ## in the Git sources. This is required when building Git from a version that @@ -321,14 +323,16 @@ install: build .PHONY: build-bundled-git ## Build bundled Git binaries. -build-bundled-git: build-bundled-git-v2.41 +build-bundled-git: build-bundled-git-v2.41 build-bundled-git-v2.42 build-bundled-git-v2.41: $(patsubst %,${BUILD_DIR}/bin/gitaly-%-v2.41,${GIT_EXECUTABLES}) +build-bundled-git-v2.42: $(patsubst %,${BUILD_DIR}/bin/gitaly-%-v2.42,${GIT_EXECUTABLES}) .PHONY: install-bundled-git ## Install bundled Git binaries. The target directory can be modified by ## setting PREFIX and DESTDIR. -install-bundled-git: install-bundled-git-v2.41 +install-bundled-git: install-bundled-git-v2.41 install-bundled-git-v2.42 install-bundled-git-v2.41: $(patsubst %,${INSTALL_DEST_DIR}/gitaly-%-v2.41,${GIT_EXECUTABLES}) +install-bundled-git-v2.42: $(patsubst %,${INSTALL_DEST_DIR}/gitaly-%-v2.42,${GIT_EXECUTABLES}) ifdef WITH_BUNDLED_GIT build: build-bundled-git @@ -578,6 +582,10 @@ ${BUILD_DIR}/bin/gitaly-%-v2.41: override GIT_VERSION = ${GIT_VERSION_2_41} ${BUILD_DIR}/bin/gitaly-%-v2.41: ${DEPENDENCY_DIR}/git-v2.41/% | ${BUILD_DIR}/bin ${Q}install $< $@ +${BUILD_DIR}/bin/gitaly-%-v2.42: override GIT_VERSION = ${GIT_VERSION_2_42} +${BUILD_DIR}/bin/gitaly-%-v2.42: ${DEPENDENCY_DIR}/git-v2.42/% | ${BUILD_DIR}/bin + ${Q}install $< $@ + ${BUILD_DIR}/bin/%: ${BUILD_DIR}/intermediate/% | ${BUILD_DIR}/bin @ # To compute a unique and deterministic value for GNU build-id, we use an @ # intermediate binary which has a fixed build ID of "TEMP_GITALY_BUILD_ID", diff --git a/internal/featureflag/ff_git_v242.go b/internal/featureflag/ff_git_v242.go new file mode 100644 index 000000000..20615dca0 --- /dev/null +++ b/internal/featureflag/ff_git_v242.go @@ -0,0 +1,9 @@ +package featureflag + +// GitV242 enables the use of Git v2.42. +var GitV242 = NewFeatureFlag( + "git_v242", + "v16.4.0", + "https://gitlab.com/gitlab-org/gitaly/-/issues/5539", + false, +) diff --git a/internal/git/execution_environment.go b/internal/git/execution_environment.go index e613020ff..c4f7608e5 100644 --- a/internal/git/execution_environment.go +++ b/internal/git/execution_environment.go @@ -25,6 +25,13 @@ var ( // case `IsEnabled()` returns `false` though. defaultExecutionEnvironmentConstructors = []ExecutionEnvironmentConstructor{ BundledGitEnvironmentConstructor{ + Suffix: "-v2.42", + FeatureFlags: []featureflag.FeatureFlag{ + featureflag.GitV242, + }, + }, + + BundledGitEnvironmentConstructor{ Suffix: "-v2.41", }, DistributedGitEnvironmentConstructor{}, diff --git a/internal/testhelper/testhelper.go b/internal/testhelper/testhelper.go index 64e2269df..673836f2d 100644 --- a/internal/testhelper/testhelper.go +++ b/internal/testhelper/testhelper.go @@ -237,6 +237,8 @@ func ContextWithoutCancel(opts ...ContextOpt) context.Context { ctx = featureflag.ContextWithFeatureFlag(ctx, featureflag.RunCommandsInCGroup, true) // Randomly enable mailmap ctx = featureflag.ContextWithFeatureFlag(ctx, featureflag.MailmapOptions, rand.Int()%2 == 0) + // Randomly enable either Git v2.41 or 2.42. + ctx = featureflag.ContextWithFeatureFlag(ctx, featureflag.GitV242, rand.Int()%2 == 0) for _, opt := range opts { ctx = opt(ctx) |