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:
authorWill Chandler <wchandler@gitlab.com>2022-06-29 21:23:16 +0300
committerWill Chandler <wchandler@gitlab.com>2022-06-29 21:23:16 +0300
commitc54d613d0eb9c573d79f5da0975655f11f007932 (patch)
tree5a3251fd96fef7457683c40f92a877d5d63486e6
parent774cf3e15d783db45504c939b162b1c2425603bc (diff)
parent3e466e74e72b5b02c5da0b57bb771995f199efae (diff)
Merge branch 'pks-gitaly-git2go-feature-flag-with-overridden-default' into 'master'
command: Export environment variable to force-enable all feature flags Closes #4318 See merge request gitlab-org/gitaly!4672
-rw-r--r--internal/command/command.go5
-rw-r--r--internal/metadata/featureflag/featureflag.go6
2 files changed, 10 insertions, 1 deletions
diff --git a/internal/command/command.go b/internal/command/command.go
index abf008f3d..5f3f3a8f1 100644
--- a/internal/command/command.go
+++ b/internal/command/command.go
@@ -105,6 +105,11 @@ var (
// libcurl settings: https://curl.haxx.se/libcurl/c/CURLOPT_NOPROXY.html
"no_proxy",
"NO_PROXY",
+
+ // We must export this variable to child processes or otherwise we end up in
+ // an inconsistent state, where the parent process has all feature flags
+ // force-enabled while the child is using the usual defaults.
+ featureflag.EnableAllFeatureFlagsEnvVar,
}
// envInjector is responsible for injecting environment variables required for tracing into
diff --git a/internal/metadata/featureflag/featureflag.go b/internal/metadata/featureflag/featureflag.go
index 9607c9b55..edb0f8b16 100644
--- a/internal/metadata/featureflag/featureflag.go
+++ b/internal/metadata/featureflag/featureflag.go
@@ -13,12 +13,16 @@ import (
)
var (
+ // EnableAllFeatureFlagsEnvVar will cause Gitaly to treat all feature flags as
+ // enabled in case its value is set to `true`. Only used for testing purposes.
+ EnableAllFeatureFlagsEnvVar = "GITALY_TESTING_ENABLE_ALL_FEATURE_FLAGS"
+
// featureFlagsOverride allows to enable all feature flags with a
// single environment variable. If the value of
// GITALY_TESTING_ENABLE_ALL_FEATURE_FLAGS is set to "true", then all
// feature flags will be enabled. This is only used for testing
// purposes such that we can run integration tests with feature flags.
- featureFlagsOverride, _ = env.GetBool("GITALY_TESTING_ENABLE_ALL_FEATURE_FLAGS", false)
+ featureFlagsOverride, _ = env.GetBool(EnableAllFeatureFlagsEnvVar, false)
flagChecks = promauto.NewCounterVec(
prometheus.CounterOpts{