From 368ce8559cdd53ffcaee48d0d85392f483d394dd Mon Sep 17 00:00:00 2001 From: Jan Keromnes Date: Tue, 25 Jan 2022 09:26:34 +0000 Subject: [PATCH] [server] Ensure incremental prebuilds always use the latest config --- components/server/ee/src/workspace/workspace-factory.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/server/ee/src/workspace/workspace-factory.ts b/components/server/ee/src/workspace/workspace-factory.ts index b888106e1566f8..e33b9331e94d5e 100644 --- a/components/server/ee/src/workspace/workspace-factory.ts +++ b/components/server/ee/src/workspace/workspace-factory.ts @@ -108,6 +108,13 @@ export class WorkspaceFactoryEE extends WorkspaceFactory { prebuiltWorkspace: parentPrebuild, } ws = await this.createForPrebuiltWorkspace({span}, user, incrementalPrebuildContext, normalizedContextURL); + // Overwrite the config from the parent prebuild: + // `createForPrebuiltWorkspace` 1:1 copies the config from the parent prebuild. + // Above, we've made sure that the parent's prebuild tasks (before/init/prebuild) are still the same as now. + // However, other non-prebuild config items might be outdated (e.g. any command task, VS Code extension, ...) + // To fix this, we overwrite the new prebuild's config with the most-recently fetched config. + // See also: https://github.com/gitpod-io/gitpod/issues/7475 + ws.config = config; break; }