Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: handle null value for experiments#17584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 1 commit intomainfrombq/fix-null-experiments
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletionssite/src/pages/DeploymentSettingsPage/optionValue.test.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -120,6 +120,15 @@ describe("optionValue", () => {
additionalValues: ["single_tailnet"],
expected: { single_tailnet: true },
},
{
option: {
...defaultOption,
name: "Experiments",
value: null,
},
additionalValues: ["single_tailnet"],
expected: "",
},
{
option: {
...defaultOption,
Expand Down
15 changes: 9 additions & 6 deletionssite/src/pages/DeploymentSettingsPage/optionValue.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,8 +40,10 @@ export function optionValue(
case "Experiments": {
const experimentMap = additionalValues?.reduce<Record<string, boolean>>(
(acc, v) => {
// biome-ignore lint/suspicious/noExplicitAny: opt.value is any
acc[v] = (option.value as any).includes("*");
const isIncluded = Array.isArray(option.value)
? option.value.includes("*")
: false;
acc[v] = isIncluded;
return acc;
},
{},
Expand All@@ -57,10 +59,11 @@ export function optionValue(

// We show all experiments (including unsafe) that are currently enabled on a deployment
// but only show safe experiments that are not.
// biome-ignore lint/suspicious/noExplicitAny: opt.value is any
for (const v of option.value as any) {
if (v !== "*") {
experimentMap[v] = true;
if (Array.isArray(option.value)) {
for (const v of option.value) {
if (v !== "*") {
experimentMap[v] = true;
}
}
}
return experimentMap;
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp