test(server): align issue workspace environment expectations

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Nicky LeachandPaperclip committed 2026-07-08 16:13:44 +00:00
1 parent e68ee09809
commit e8f2db3a2c
2 files changed
+7 -2

No files matched your search

+4 -2
View File
@@ -2737,7 +2737,7 @@ describeEmbeddedPostgres("issueService.create workspace inheritance", () => {
});
});
it("strips legacy environmentId values from execution workspace settings updates", async () => {
it("preserves explicit environmentId values on execution workspace settings updates", async () => {
const companyId = randomUUID();
const projectId = randomUUID();
const projectWorkspaceId = randomUUID();
@@ -2804,6 +2804,7 @@ describeEmbeddedPostgres("issueService.create workspace inheritance", () => {
});
expect(overridden!.executionWorkspaceSettings).toEqual({
mode: "shared_workspace",
environmentId: operatorEnvironmentId,
});
const reassigned = await svc.update(created.id, {
@@ -2811,6 +2812,7 @@ describeEmbeddedPostgres("issueService.create workspace inheritance", () => {
});
expect(reassigned!.executionWorkspaceSettings).toEqual({
mode: "shared_workspace",
environmentId: operatorEnvironmentId,
});
});
@@ -4398,7 +4400,7 @@ describeEmbeddedPostgres("issueService.create workspace inheritance", () => {
expect(workspace?.metadata).toEqual({
config: {
environmentId: null,
environmentId: "env-new",
provisionCommand: "bash ./scripts/provision-new.sh",
teardownCommand: "bash ./scripts/teardown-new.sh",
cleanupCommand: null,
@@ -112,6 +112,9 @@ export function parseIssueExecutionWorkspaceSettings(raw: unknown): IssueExecuti
...(normalizedMode
? { mode: normalizedMode as IssueExecutionWorkspaceSettings["mode"] }
: {}),
...(parsed.environmentId && typeof parsed.environmentId === "string"
? { environmentId: parsed.environmentId }
: {}),
...(workspaceStrategy ? { workspaceStrategy } : {}),
...(parsed.workspaceRuntime && typeof parsed.workspaceRuntime === "object" && !Array.isArray(parsed.workspaceRuntime)
? { workspaceRuntime: { ...(parsed.workspaceRuntime as Record<string, unknown>) } }