docker: compose file list is single-sourced by prose only — mod.ts, actions.ts and the page header can diverge again #50

Open
opened 2026-08-21 23:21:02 +02:00 by julian · 0 comments
Owner

Follow-up from the approving review on #48 (non-blocking items 1 and 2).

Two reads of the answering container's configFiles are guarded only by a comment: packages/modules/docker/backend/mod.ts:607 and packages/modules/docker/backend/actions.ts:511. Reverting either to stack.containers[0] keeps the whole suite green (494 passed) — the page-seam test exercises composeProjectwantedEnvFiles directly, not collectStackFiles, so it cannot see these lines. Contrast with the env-file seam, which a type refuses (TS2345).

On top of that, packages/shell/src/pages/StackDetailPage.svelte:132 is a third read of the same label off containers[0] raw: subtitle={data.stack.containers[0]?.configFiles ?? ""}. With a one-off as the newest container the page header names compose.yaml,/tmp/debug.yaml while the file list below it — correctly the answering container's — lists only compose.yaml.

Suggested fix from the review: a projectComposeFiles(stack) = splitLabel(answeringContainer(stack)?.configFiles ?? "") in compose_update.ts, used by both backend call sites (and feeding the page), so one test covers all readers and nothing spells containers[0] or a raw split any more.

Source: #48 (comment) (inline comments 1028, and follow-up 2 in the review body).

Follow-up from the approving review on #48 (non-blocking items 1 and 2). Two reads of the answering container's `configFiles` are guarded only by a comment: `packages/modules/docker/backend/mod.ts:607` and `packages/modules/docker/backend/actions.ts:511`. Reverting either to `stack.containers[0]` keeps the whole suite green (494 passed) — the page-seam test exercises `composeProject` → `wantedEnvFiles` directly, not `collectStackFiles`, so it cannot see these lines. Contrast with the env-file seam, which a type refuses (`TS2345`). On top of that, `packages/shell/src/pages/StackDetailPage.svelte:132` is a third read of the same label off `containers[0]` raw: `subtitle={data.stack.containers[0]?.configFiles ?? ""}`. With a one-off as the newest container the page header names `compose.yaml,/tmp/debug.yaml` while the file list below it — correctly the answering container's — lists only `compose.yaml`. Suggested fix from the review: a `projectComposeFiles(stack) = splitLabel(answeringContainer(stack)?.configFiles ?? "")` in `compose_update.ts`, used by both backend call sites (and feeding the page), so one test covers all readers and nothing spells `containers[0]` or a raw split any more. Source: https://git.imhof.cloud/OpsDeck/core/pulls/48#issuecomment-1030 (inline comments 1028, and follow-up 2 in the review body).
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
OpsDeck/core#50
No description provided.