Skip to content

Commit df36498

Browse files
committed
chore(webview): address CodeRabbit review feedback
1 parent 32b1842 commit df36498

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/visual-regression.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
steps:
2727
- name: Checkout code
2828
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
29+
with:
30+
persist-credentials: false
2931
- name: Setup Node.js and pnpm
3032
uses: ./.github/actions/setup-node-pnpm
3133
with:

webview-ui/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"test": "vitest run",
1010
"test:coverage": "vitest run --coverage",
1111
"test:visual": "playwright test -c playwright-ct.config.ts",
12-
"test:visual:update": "playwright test -c playwright-ct.config.ts --update-snapshots",
1312
"test:visual:docker": "node playwright/run-docker.mjs",
1413
"test:visual:docker:update": "node playwright/run-docker.mjs --update",
1514
"format": "prettier --write src",

webview-ui/playwright/run-docker.mjs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,25 @@ const updateSnapshots = process.argv.includes("--update")
99
const composeArgs = ["-f", composeFile, "run", "--rm", "visual"]
1010

1111
if (updateSnapshots) {
12-
composeArgs.push("sh", "-lc", "corepack pnpm --filter @roo-code/vscode-webview test:visual:update")
12+
// Inlined so host-rendered baselines aren't reachable via a `pnpm` script.
13+
composeArgs.push(
14+
"sh",
15+
"-lc",
16+
"corepack pnpm --filter @roo-code/vscode-webview exec playwright test -c playwright-ct.config.ts --update-snapshots",
17+
)
18+
}
19+
20+
// Compose falls back to UID 1000 if not passed; that mis-owns generated files.
21+
const spawnEnv = {
22+
...process.env,
23+
UID: String(process.getuid?.() ?? 1000),
24+
GID: String(process.getgid?.() ?? 1000),
1325
}
1426

1527
const hasComposePlugin = spawnSync("docker", ["compose", "version"], { stdio: "ignore" }).status === 0
1628
const command = hasComposePlugin ? "docker" : "docker-compose"
1729
const args = hasComposePlugin ? ["compose", ...composeArgs] : composeArgs
18-
const result = spawnSync(command, args, { stdio: "inherit" })
30+
const result = spawnSync(command, args, { stdio: "inherit", env: spawnEnv })
1931

2032
if (result.error) {
2133
console.error(`Unable to run ${command}: ${result.error.message}`)

0 commit comments

Comments
 (0)