Ask: Fix the splitIntoStages helper in Dockerfile.test.ts so a FROM --platform=... base AS name line is parsed into stage name mapping to the correct base image.
Found while reviewing PR #1175 (pre-existing, not introduced there; that PR's new MCP-wiring tests depend on this helper).
The regex used by splitIntoStages in Dockerfile.test.ts captures the first token after FROM as the base image, so a line like FROM --platform=$BUILDPLATFORM base AS builder would capture --platform=$BUILDPLATFORM / mis-associate the stage name. The current Dockerfile happens to have no --platform usage, so the bug is latent, but any future multi-platform stage would silently produce a wrong stage map and give false pass/fail results across every stage-scoped assertion in the file.
Suggested fix: strip leading --platform=... (and any other -- flags) before capturing the image and optional AS name, and add a unit test covering the FROM --platform=linux/amd64 node:24 AS foo shape.
Expected file to touch: Dockerfile.test.ts.
Ask: Fix the
splitIntoStageshelper inDockerfile.test.tsso aFROM --platform=... base AS nameline is parsed into stagenamemapping to the correct base image.Found while reviewing PR #1175 (pre-existing, not introduced there; that PR's new MCP-wiring tests depend on this helper).
The regex used by
splitIntoStagesinDockerfile.test.tscaptures the first token afterFROMas the base image, so a line likeFROM --platform=$BUILDPLATFORM base AS builderwould capture--platform=$BUILDPLATFORM/ mis-associate the stage name. The current Dockerfile happens to have no--platformusage, so the bug is latent, but any future multi-platform stage would silently produce a wrong stage map and give false pass/fail results across every stage-scoped assertion in the file.Suggested fix: strip leading
--platform=...(and any other--flags) before capturing the image and optionalAS name, and add a unit test covering theFROM --platform=linux/amd64 node:24 AS fooshape.Expected file to touch:
Dockerfile.test.ts.