From 53e52255ffd5f40052bdf22a14fb391d76cb5013 Mon Sep 17 00:00:00 2001 From: Alex Tugarev Date: Mon, 2 Oct 2023 07:22:59 +0000 Subject: [PATCH] fix getPrebuildSettings --- .../gitpod-protocol/src/teams-projects-protocol.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/gitpod-protocol/src/teams-projects-protocol.ts b/components/gitpod-protocol/src/teams-projects-protocol.ts index efde327542a06f..e67b82abe34b7e 100644 --- a/components/gitpod-protocol/src/teams-projects-protocol.ts +++ b/components/gitpod-protocol/src/teams-projects-protocol.ts @@ -122,11 +122,15 @@ export namespace Project { * contain default values for properties which are not set explicitly for this project. */ export function getPrebuildSettings(project: Project): PrebuildSettingsWithDefaults { - const effective = { + // ignoring persisted properties with `undefined` values to exclude them from the override. + const overrides = Object.fromEntries( + Object.entries(project.settings?.prebuilds ?? {}).filter(([_, value]) => value !== undefined), + ); + + return { ...PREBUILD_SETTINGS_DEFAULTS, - ...project.settings?.prebuilds, + ...overrides, }; - return effective; } export function hasPrebuildSettings(project: Project) {