From 6e232b522977a58a21a6560808191cd23b4fbae3 Mon Sep 17 00:00:00 2001 From: Catherine Date: Thu, 28 May 2026 11:58:19 +0000 Subject: [PATCH] Add an index of all known features. This helps avoid incorrect behavior on typos and notifies end users that a feature has been stabilized and removed. It also helps us avoid reusing feature names by accident. --- src/main.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main.go b/src/main.go index 7b77c0f..08cfb64 100644 --- a/src/main.go +++ b/src/main.go @@ -40,6 +40,23 @@ func configureFeatures(ctx context.Context) (err error) { if len(config.Features) > 0 { logc.Println(ctx, "features:", strings.Join(config.Features, ", ")) } + for _, feature := range config.Features { + switch feature { + // Work-in-progress features: + case "preview", "existence-cache": + // Permanently unstable features: + case "codeberg-pages-compat", "relaxed-idna": + // Stabilized features: + case "archive-site", "audit", "compress", "patch", "serve-h2c": + logc.Printf(ctx, "feature %s has been stabilized", feature) + // Removed or renamed features: + case "h2c", "sentry-telemetry-buffer", "site-existence-cache", "domain-existence-cache": + logc.Printf(ctx, "feature %s has been removed", feature) + // Invalid features: + default: + return fmt.Errorf("unknown feature %q", feature) + } + } return }