Skip to content

Commit 9f3a955

Browse files
authored
fix: show all experiments in deployments list if opted into (coder#10722)
1 parent 0e5eecd commit 9f3a955

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

site/src/components/DeploySettingsLayout/optionValue.test.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ describe("optionValue", () => {
9797
value: ["moons"],
9898
},
9999
additionalValues: ["single_tailnet", "deployment_health_page"],
100-
expected: { single_tailnet: false, deployment_health_page: false },
100+
expected: {
101+
single_tailnet: false,
102+
deployment_health_page: false,
103+
moons: true,
104+
},
101105
},
102106
{
103107
option: {
@@ -108,6 +112,15 @@ describe("optionValue", () => {
108112
additionalValues: ["single_tailnet", "deployment_health_page"],
109113
expected: { single_tailnet: true, deployment_health_page: true },
110114
},
115+
{
116+
option: {
117+
...defaultOption,
118+
name: "Experiments",
119+
value: ["*", "moons", "single_tailnet"],
120+
},
121+
additionalValues: ["single_tailnet"],
122+
expected: { moons: true, single_tailnet: true },
123+
},
111124
{
112125
option: {
113126
...defaultOption,

site/src/components/DeploySettingsLayout/optionValue.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ export function optionValue(
5050
break;
5151
}
5252

53+
// We show all experiments (including unsafe) that are currently enabled on a deployment
54+
// but only show safe experiments that are not.
5355
for (const v of option.value) {
54-
if (Object.hasOwn(experimentMap, v)) {
56+
if (v !== "*") {
5557
experimentMap[v] = true;
5658
}
5759
}

0 commit comments

Comments
 (0)