Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2022-07-01 06:30:43 +0300
committerJaime Martinez <jmartinez@gitlab.com>2022-07-01 06:55:07 +0300
commit8011c2899bb31ca316eed7fec1321fae2016863d (patch)
treede9399e370d31d378b80ea0a345f073fb3fa6e15
parent30f67e89a01173207bd1e40d151c700c18ccddc7 (diff)
Enable FF_ENABLE_PLACEHOLDERS by default619-enable-placeholders-by-default
Changelog: added
-rw-r--r--internal/feature/feature.go3
-rw-r--r--internal/redirects/matching_test.go3
-rw-r--r--internal/redirects/validations_test.go3
3 files changed, 8 insertions, 1 deletions
diff --git a/internal/feature/feature.go b/internal/feature/feature.go
index a012fc49..337bf2f1 100644
--- a/internal/feature/feature.go
+++ b/internal/feature/feature.go
@@ -34,7 +34,8 @@ var EnforceIPTLSRateLimits = Feature{
// RedirectsPlaceholders enables support for placeholders in redirects file
// TODO: remove https://gitlab.com/gitlab-org/gitlab-pages/-/issues/620
var RedirectsPlaceholders = Feature{
- EnvVariable: "FF_ENABLE_PLACEHOLDERS",
+ EnvVariable: "FF_ENABLE_PLACEHOLDERS",
+ defaultEnabled: true,
}
// HandleReadErrors reports vfs.ReadErrors to sentry and enable error handling
diff --git a/internal/redirects/matching_test.go b/internal/redirects/matching_test.go
index 1460dfb1..23815b97 100644
--- a/internal/redirects/matching_test.go
+++ b/internal/redirects/matching_test.go
@@ -312,6 +312,9 @@ func Test_matchesRule(t *testing.T) {
// feature flag is not enabled. These tests can be removed when the
// `FF_ENABLE_PLACEHOLDERS` flag is removed.
func Test_matchesRule_NoPlaceholders(t *testing.T) {
+ // disable placeholders on purpose
+ t.Setenv(feature.RedirectsPlaceholders.EnvVariable, "false")
+
tests := mergeTestSuites(testsWithoutPlaceholders, map[string]testCaseData{
// Note: the following 3 case behaves differently when
// placeholders are enabled. See the similar test cases above.
diff --git a/internal/redirects/validations_test.go b/internal/redirects/validations_test.go
index 0d6df3ec..5f3a24ec 100644
--- a/internal/redirects/validations_test.go
+++ b/internal/redirects/validations_test.go
@@ -73,6 +73,9 @@ func TestRedirectsValidateUrl(t *testing.T) {
// feature flag is not enabled. These tests can be removed when the
// `FF_ENABLE_PLACEHOLDERS` flag is removed.
func TestRedirectsValidateUrlNoPlaceholders(t *testing.T) {
+ // disable placeholders on purpose
+ t.Setenv(feature.RedirectsPlaceholders.EnvVariable, "false")
+
tests := map[string]struct {
url string
expectedErr error