fix: do not warn on valid known experiments (#18514)

Fixes https://github.com/coder/coder/issues/18024

* drive-by: renames `handleExperimentsSafe` to
`handleExperimentsAvailable` to better match semantics
* defines list of `codersdk.ExperimentsKnown` and updates
`ReadExperiments` to log on invalid experiments
* typescript-ignores `codersdk.Experiments` so apitypings generates a
valid enum list of possible values of experiment
* updates OverviewPageView to distinguish between known 'hidden'
experiments and unknown 'invalid' experiments
This commit is contained in:
Cian Johnston
2025-06-24 09:14:41 +01:00
committed by GitHub
parent 4f98fd4e6e
commit d892427b78
10 changed files with 54 additions and 21 deletions
+15
View File
@@ -3372,6 +3372,18 @@ const (
ExperimentAITasks Experiment = "ai-tasks" // Enables the new AI tasks feature.
)
// ExperimentsKnown should include all experiments defined above.
var ExperimentsKnown = Experiments{
ExperimentExample,
ExperimentAutoFillParameters,
ExperimentNotifications,
ExperimentWorkspaceUsage,
ExperimentWebPush,
ExperimentWorkspacePrebuilds,
ExperimentAgenticChat,
ExperimentAITasks,
}
// ExperimentsSafe should include all experiments that are safe for
// users to opt-in to via --experimental='*'.
// Experiments that are not ready for consumption by all users should
@@ -3384,6 +3396,9 @@ var ExperimentsSafe = Experiments{
// Multiple experiments may be enabled at the same time.
// Experiments are not safe for production use, and are not guaranteed to
// be backwards compatible. They may be removed or renamed at any time.
// The below typescript-ignore annotation allows our typescript generator
// to generate an enum list, which is used in the frontend.
// @typescript-ignore Experiments
type Experiments []Experiment
// Returns a list of experiments that are enabled for the deployment.