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-04 09:44:57 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-07-04 10:04:16 +0300
commit8132c2bb33acbe76fbb86500d8d5fef9e063bb30 (patch)
treeed226a349a35091ba69eb3f1e0a8a82a0cf2c07c
parent0c72a4ba3de2125098d72fce52b99df3d4ad5475 (diff)
featureflags: Require version and rollout issue URL for flagspks-feature-flags-with-rollout-issue-url
When creating a new feature flag it is mandatory to create a feature flag rollout issue that keeps track of the current status of any flag. This issue is used both to not forget about rolling out a flag, and also for the sake of documenting whole rollout process. We have nothing in our process though that enforces creation of any such issue, and thus it happens from time to time that we forget to create it. Add two new parameters to `NewFeatureFlag()` that document the version a flag has been introduced in and the URL of the issue that's tracking the rollout. This brings us several benefits: - It's hard to forget about creating the issue given that you now have to specify the link when creating the flag. - Reviewers immediately spot a missing link and can verify that it's referring to the correct flag. Furthermore, they may review the rollout issue itself to see whether it documents important details. - When checking up on a feature flag after it has been merged it becomes trivial to find the rollout issue as a developer. Furthermore, this commit also adds a new version parameter to keep track of the version a flag has been introduced in. This also makes it easier for reviewers to see whether a flag can really already be removed or not. Adjust all existing feature flag definitions to have this information.
-rw-r--r--internal/git2go/featureflags_test.go4
-rw-r--r--internal/metadata/featureflag/featureflag.go5
-rw-r--r--internal/metadata/featureflag/ff_cherry_pick_structured_errors.go7
-rw-r--r--internal/metadata/featureflag/ff_exact_pagination_token_match.go7
-rw-r--r--internal/metadata/featureflag/ff_git_v2361.go7
-rw-r--r--internal/metadata/featureflag/ff_go_find_license.go7
-rw-r--r--internal/metadata/featureflag/ff_praefect_generated_paths.go7
-rw-r--r--internal/metadata/featureflag/ff_rate_limiter.go7
-rw-r--r--internal/metadata/featureflag/ff_repo_size_revlist.go7
-rw-r--r--internal/metadata/featureflag/ff_run_cmd_in_cgroup.go7
-rw-r--r--internal/metadata/featureflag/ff_transactional_restore_custom_hooks.go7
-rw-r--r--internal/metadata/featureflag/ff_user_rebase_confirmable_improved_error_handling.go7
-rw-r--r--internal/praefect/coordinator_test.go4
13 files changed, 68 insertions, 15 deletions
diff --git a/internal/git2go/featureflags_test.go b/internal/git2go/featureflags_test.go
index 1ea54df52..06741fb05 100644
--- a/internal/git2go/featureflags_test.go
+++ b/internal/git2go/featureflags_test.go
@@ -35,8 +35,8 @@ func (b *Executor) FeatureFlags(ctx context.Context, repo repository.GitRepo) (f
}
var (
- featureA = featureflag.NewFeatureFlag("feature-a", false)
- featureB = featureflag.NewFeatureFlag("feature-b", true)
+ featureA = featureflag.NewFeatureFlag("feature-a", "", "", false)
+ featureB = featureflag.NewFeatureFlag("feature-b", "", "", true)
)
func TestFeatureFlagsExecutor_FeatureFlags(t *testing.T) {
diff --git a/internal/metadata/featureflag/featureflag.go b/internal/metadata/featureflag/featureflag.go
index edb0f8b16..70f90d2d9 100644
--- a/internal/metadata/featureflag/featureflag.go
+++ b/internal/metadata/featureflag/featureflag.go
@@ -69,7 +69,10 @@ type FeatureFlag struct {
}
// NewFeatureFlag creates a new feature flag and adds it to the array of all existing feature flags.
-func NewFeatureFlag(name string, onByDefault bool) FeatureFlag {
+// The name must be of the format `some_feature_flag`. Accepts a version and rollout issue URL as
+// input that are not used for anything but only for the sake of linking to the feature flag rollout
+// issue in the Gitaly project.
+func NewFeatureFlag(name, version, rolloutIssueURL string, onByDefault bool) FeatureFlag {
featureFlag := FeatureFlag{
Name: name,
OnByDefault: onByDefault,
diff --git a/internal/metadata/featureflag/ff_cherry_pick_structured_errors.go b/internal/metadata/featureflag/ff_cherry_pick_structured_errors.go
index 65e67b0ed..594fddf3c 100644
--- a/internal/metadata/featureflag/ff_cherry_pick_structured_errors.go
+++ b/internal/metadata/featureflag/ff_cherry_pick_structured_errors.go
@@ -2,4 +2,9 @@ package featureflag
// CherryPickStructuredErrors enables the UserCherryPick RPC to return
// structured errors.
-var CherryPickStructuredErrors = NewFeatureFlag("cherry_pick_structured_errors", false)
+var CherryPickStructuredErrors = NewFeatureFlag(
+ "cherry_pick_structured_errors",
+ "v15.2.0",
+ "https://gitlab.com/gitlab-org/gitaly/-/issues/4325",
+ false,
+)
diff --git a/internal/metadata/featureflag/ff_exact_pagination_token_match.go b/internal/metadata/featureflag/ff_exact_pagination_token_match.go
index 607896507..ad9392f80 100644
--- a/internal/metadata/featureflag/ff_exact_pagination_token_match.go
+++ b/internal/metadata/featureflag/ff_exact_pagination_token_match.go
@@ -2,4 +2,9 @@ package featureflag
// ExactPaginationTokenMatch enables exact matching for provided pagination tokens and
// returns an error if the match is not found.
-var ExactPaginationTokenMatch = NewFeatureFlag("exact_pagination_token_match", true)
+var ExactPaginationTokenMatch = NewFeatureFlag(
+ "exact_pagination_token_match",
+ "v14.10.0",
+ "https://gitlab.com/gitlab-org/gitaly/-/issues/3817",
+ true,
+)
diff --git a/internal/metadata/featureflag/ff_git_v2361.go b/internal/metadata/featureflag/ff_git_v2361.go
index 693206477..869f3d8e6 100644
--- a/internal/metadata/featureflag/ff_git_v2361.go
+++ b/internal/metadata/featureflag/ff_git_v2361.go
@@ -1,4 +1,9 @@
package featureflag
// GitV2361Gl1 will enable use of Git v2.36.1.gl1.
-var GitV2361Gl1 = NewFeatureFlag("git_v2361gl1", false)
+var GitV2361Gl1 = NewFeatureFlag(
+ "git_v2361gl1",
+ "v15.0.0",
+ "https://gitlab.com/gitlab-org/gitaly/-/issues/4194",
+ false,
+)
diff --git a/internal/metadata/featureflag/ff_go_find_license.go b/internal/metadata/featureflag/ff_go_find_license.go
index 95639870e..a3c63b2c9 100644
--- a/internal/metadata/featureflag/ff_go_find_license.go
+++ b/internal/metadata/featureflag/ff_go_find_license.go
@@ -1,4 +1,9 @@
package featureflag
// GoFindLicense enables Go implementation of FindLicense
-var GoFindLicense = NewFeatureFlag("go_find_license", false)
+var GoFindLicense = NewFeatureFlag(
+ "go_find_license",
+ "v14.3.0",
+ "https://gitlab.com/gitlab-org/gitaly/-/issues/3759",
+ false,
+)
diff --git a/internal/metadata/featureflag/ff_praefect_generated_paths.go b/internal/metadata/featureflag/ff_praefect_generated_paths.go
index 4109bd636..8858043ca 100644
--- a/internal/metadata/featureflag/ff_praefect_generated_paths.go
+++ b/internal/metadata/featureflag/ff_praefect_generated_paths.go
@@ -1,4 +1,9 @@
package featureflag
// PraefectGeneratedReplicaPaths will enable Praefect generated replica paths for new repositories.
-var PraefectGeneratedReplicaPaths = NewFeatureFlag("praefect_generated_replica_paths", false)
+var PraefectGeneratedReplicaPaths = NewFeatureFlag(
+ "praefect_generated_replica_paths",
+ "v15.0.0",
+ "https://gitlab.com/gitlab-org/gitaly/-/issues/4218",
+ false,
+)
diff --git a/internal/metadata/featureflag/ff_rate_limiter.go b/internal/metadata/featureflag/ff_rate_limiter.go
index 7207e4b37..7bdbe9afa 100644
--- a/internal/metadata/featureflag/ff_rate_limiter.go
+++ b/internal/metadata/featureflag/ff_rate_limiter.go
@@ -2,4 +2,9 @@ package featureflag
// RateLimit will enable the rate limiter to reject requests beyond a configured
// rate.
-var RateLimit = NewFeatureFlag("rate_limit", false)
+var RateLimit = NewFeatureFlag(
+ "rate_limit",
+ "v14.10.0",
+ "https://gitlab.com/gitlab-org/gitaly/-/issues/4181",
+ false,
+)
diff --git a/internal/metadata/featureflag/ff_repo_size_revlist.go b/internal/metadata/featureflag/ff_repo_size_revlist.go
index 8be87e482..b630ccfc6 100644
--- a/internal/metadata/featureflag/ff_repo_size_revlist.go
+++ b/internal/metadata/featureflag/ff_repo_size_revlist.go
@@ -2,4 +2,9 @@ package featureflag
// RevlistForRepoSize enables the RepositorySize RPC to use git rev-list to
// calculate the disk usage of the repository.
-var RevlistForRepoSize = NewFeatureFlag("revlist_for_repo_size", false)
+var RevlistForRepoSize = NewFeatureFlag(
+ "revlist_for_repo_size",
+ "v14.10.0",
+ "https://gitlab.com/gitlab-org/gitaly/-/issues/4317",
+ false,
+)
diff --git a/internal/metadata/featureflag/ff_run_cmd_in_cgroup.go b/internal/metadata/featureflag/ff_run_cmd_in_cgroup.go
index 5c84995b1..a92948c4e 100644
--- a/internal/metadata/featureflag/ff_run_cmd_in_cgroup.go
+++ b/internal/metadata/featureflag/ff_run_cmd_in_cgroup.go
@@ -1,4 +1,9 @@
package featureflag
// RunCommandsInCGroup allows all commands to be run within a cgroup
-var RunCommandsInCGroup = NewFeatureFlag("run_cmds_in_cgroup", false)
+var RunCommandsInCGroup = NewFeatureFlag(
+ "run_cmds_in_cgroup",
+ "v14.10.0",
+ "https://gitlab.com/gitlab-org/gitaly/-/issues/4102",
+ false,
+)
diff --git a/internal/metadata/featureflag/ff_transactional_restore_custom_hooks.go b/internal/metadata/featureflag/ff_transactional_restore_custom_hooks.go
index 8f3e2337d..c8b8d9ee2 100644
--- a/internal/metadata/featureflag/ff_transactional_restore_custom_hooks.go
+++ b/internal/metadata/featureflag/ff_transactional_restore_custom_hooks.go
@@ -2,4 +2,9 @@ package featureflag
// TransactionalRestoreCustomHooks will use transactional voting in the
// RestoreCustomHooks RPC
-var TransactionalRestoreCustomHooks = NewFeatureFlag("tx_restore_custom_hooks", false)
+var TransactionalRestoreCustomHooks = NewFeatureFlag(
+ "tx_restore_custom_hooks",
+ "v15.0.0",
+ "https://gitlab.com/gitlab-org/gitaly/-/issues/4203",
+ false,
+)
diff --git a/internal/metadata/featureflag/ff_user_rebase_confirmable_improved_error_handling.go b/internal/metadata/featureflag/ff_user_rebase_confirmable_improved_error_handling.go
index 9f49b4559..1065b92e8 100644
--- a/internal/metadata/featureflag/ff_user_rebase_confirmable_improved_error_handling.go
+++ b/internal/metadata/featureflag/ff_user_rebase_confirmable_improved_error_handling.go
@@ -4,4 +4,9 @@ package featureflag
// RPC. When this flag is disabled many error cases were returning successfully with an error message
// embedded in the response. With this flag enabled, this is converted to return real gRPC errors with
// structured errors.
-var UserRebaseConfirmableImprovedErrorHandling = NewFeatureFlag("user_rebase_confirmable_improved_error_handling", false)
+var UserRebaseConfirmableImprovedErrorHandling = NewFeatureFlag(
+ "user_rebase_confirmable_improved_error_handling",
+ "v14.10.0",
+ "https://gitlab.com/gitlab-org/gitaly/-/issues/4326",
+ false,
+)
diff --git a/internal/praefect/coordinator_test.go b/internal/praefect/coordinator_test.go
index f728744c0..0b8201f33 100644
--- a/internal/praefect/coordinator_test.go
+++ b/internal/praefect/coordinator_test.go
@@ -2689,8 +2689,8 @@ func TestNewRequestFinalizer_contextIsDisjointedFromTheRPC(t *testing.T) {
func TestStreamParametersContext(t *testing.T) {
// Because we're using NewFeatureFlag, they'll end up in the All array.
- enabledFF := featureflag.NewFeatureFlag("default-enabled", true)
- disabledFF := featureflag.NewFeatureFlag("default-disabled", false)
+ enabledFF := featureflag.NewFeatureFlag("default-enabled", "", "", true)
+ disabledFF := featureflag.NewFeatureFlag("default-disabled", "", "", false)
type expectedFlag struct {
flag featureflag.FeatureFlag