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:
authorVladimir Shushlin <vshushlin@gitlab.com>2022-07-05 18:44:40 +0300
committerVladimir Shushlin <vshushlin@gitlab.com>2022-07-05 18:44:40 +0300
commite5c6fb48bfa08c6ebc6034909781007190bde6ec (patch)
treee28cfd52159d967cc280784586549761f1b0fbe7
parentd23089e4c705d46c6ee61601df75e49ca2ebd677 (diff)
parent8011c2899bb31ca316eed7fec1321fae2016863d (diff)
Merge branch '619-enable-placeholders-by-default' into 'master'
Enable FF_ENABLE_PLACEHOLDERS by default Closes #619 See merge request gitlab-org/gitlab-pages!807
-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