[CRAFTING] Add Screenshot Updater CLI tool for updating widgets e2e screenshots locally#1874
Conversation
1998411 to
1a1e18c
Compare
4c274f3 to
732c1cf
Compare
732c1cf to
1418a39
Compare
AI Code Review
What was reviewed
Skipped (out of scope): Findings
|
AI Code Review
What was reviewed
Skipped (out of scope):
Findings🔶 Medium — Shell command built by string join breaks on paths with spaces and accepts unvalidated user inputFile: Problem:
Fix: // buildDeploymentBundle — use spawnSync with an args array
const result = spawnSync(
"docker",
[
"run", "--tty", "--rm",
"--volume", `${REPO_ROOT}:/source`,
mxbuildImage, // safe: no shell expansion on array items
"bash", "-c",
`mx update-widgets --loose-version-check '${mprPath}' && mxbuild --output=/source/automation.mda '${mprPath}'`
],
{ stdio: VERBOSE ? "inherit" : "pipe" }
);
if (result.status !== 0) throw new Error("mxbuild failed");
// runPlaywrightTests — replace execSync(dockerCmd.join(" "), …) with:
const result = spawnSync(dockerCmd[0], dockerCmd.slice(1), { stdio: "inherit" });
if (result.status !== 0) throw new Error(`Docker exited ${result.status}`);Add a simple guard on the if (!/^[\d.]+$/.test(mendixVersion)) {
bail(`Invalid Mendix version format: ${mendixVersion}`);
}
|
Pull request type
Test related change (New E2E test, test automation, etc.)
Description
Implemented a new CLI tool for updating Playwright screenshots using Docker and Mendix runtime.