diff --git a/.github/workflows/daily-multi-device-docs-tester.lock.yml b/.github/workflows/daily-multi-device-docs-tester.lock.yml index b2e1fc1775f..5873d1bb287 100644 --- a/.github/workflows/daily-multi-device-docs-tester.lock.yml +++ b/.github/workflows/daily-multi-device-docs-tester.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"1ecb91321a81f3257b700f2b91ec8045ae96883c7352a0cb48d2ee1a5d00bbbc","body_hash":"dcf9d2d09055c25941e881ebad704af94ad6a85d1f4ee9cbb8e2b89f44a018e3","strict":true,"agent_id":"pi","agent_model":"copilot/gpt-5.4","engine_versions":{"pi":"0.80.10"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"6510c9a1bc596cc084ebf6537ea87fe01cd7d6352282e6ca9f11489419d6a027","body_hash":"6dafcfbcbb5d0a4267de2a2c9c3b14390cf05498266d69c3adcb6ca7762a220d","strict":true,"agent_id":"pi","agent_model":"copilot/gpt-5.4","engine_versions":{"pi":"0.80.10"}} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GH_AW_OTEL_GRAFANA_AUTHORIZATION","GH_AW_OTEL_GRAFANA_ENDPOINT","GH_AW_OTEL_SENTRY_AUTHORIZATION","GH_AW_OTEL_SENTRY_ENDPOINT","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"820762786026740c76f36085b0efc47a31fe5020","version":"v7.0.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.35","digest":"sha256:2202f63e8650b2b8b0d38033b44a05387b2b71ad3e690c4d23a34786f5462aed","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.35@sha256:2202f63e8650b2b8b0d38033b44a05387b2b71ad3e690c4d23a34786f5462aed"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.35","digest":"sha256:755b79d0dfda82bd6b43a208d68666721e504110c5d342a4eeb199802644ff04","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.35@sha256:755b79d0dfda82bd6b43a208d68666721e504110c5d342a4eeb199802644ff04"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.27.35","digest":"sha256:fe83cd274636efa9de3f456e2b078fae137328b9bb6ee4986ae510acaef0cec5","pinned_image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.27.35@sha256:fe83cd274636efa9de3f456e2b078fae137328b9bb6ee4986ae510acaef0cec5"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.35","digest":"sha256:f69282ec7b1326ba53891c399cf5b10475c0d3ccf4e1519b33d234a5427b57d3","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.35@sha256:f69282ec7b1326ba53891c399cf5b10475c0d3ccf4e1519b33d234a5427b57d3"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.1","digest":"sha256:ad2a979c2cd8b50098e84938ca9c9c1580eb8e91526f101a90adfba7859b2c32","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.1@sha256:ad2a979c2cd8b50098e84938ca9c9c1580eb8e91526f101a90adfba7859b2c32"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.6.0","digest":"sha256:2b0c48b070f61e9d3969269ead600f62d00fb237b60ac849ef3d166ee7de9ad3","pinned_image":"ghcr.io/github/github-mcp-server:v1.6.0@sha256:2b0c48b070f61e9d3969269ead600f62d00fb237b60ac849ef3d166ee7de9ad3"}]} # This file was automatically generated by gh-aw. DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -574,11 +574,13 @@ jobs: run: | cd "$EXPR_GITHUB_WORKSPACE/docs" node ../scripts/ensure-docs-slide-pdf.js + - name: Configure Chrome sandbox + run: "# The chrome-sandbox helper must be owned by root with mode 4755 (SUID) for Chrome\n# to launch inside the agent container. The runner has mode 0777 by default.\nif [ -f /opt/google/chrome/chrome-sandbox ]; then\n sudo chmod 4755 /opt/google/chrome/chrome-sandbox\n echo \"chrome-sandbox configured (mode 4755)\"\nelse\n echo \"chrome-sandbox not found — skipping\"\nfi\n" - env: EXPR_GITHUB_RUN_ID: ${{ github.run_id }} EXPR_GITHUB_WORKSPACE: ${{ github.workspace }} name: Start docs server - run: "LOG_FILE=\"/tmp/gh-aw/agent/docs-server-$EXPR_GITHUB_RUN_ID.log\"\nPID_FILE=\"/tmp/gh-aw/agent/docs-server-$EXPR_GITHUB_RUN_ID.pid\"\ncd \"$EXPR_GITHUB_WORKSPACE/docs\"\nnpm run build\nnohup npm run preview -- --host 127.0.0.1 --port 4321 > \"$LOG_FILE\" 2>&1 &\nPID=$!\necho $PID > \"$PID_FILE\"\necho \"Server PID: $PID\"\necho \"Server log: $LOG_FILE\"\n" + run: "LOG_FILE=\"/tmp/gh-aw/agent/docs-server-$EXPR_GITHUB_RUN_ID.log\"\nPID_FILE=\"/tmp/gh-aw/agent/docs-server-$EXPR_GITHUB_RUN_ID.pid\"\ncd \"$EXPR_GITHUB_WORKSPACE/docs\"\nnpm run build\nnohup npm run preview -- --host 0.0.0.0 --port 4321 > \"$LOG_FILE\" 2>&1 &\nPID=$!\necho $PID > \"$PID_FILE\"\necho \"Server PID: $PID\"\necho \"Server log: $LOG_FILE\"\n" - env: EXPR_GITHUB_RUN_ID: ${{ github.run_id }} name: Wait for server readiness diff --git a/.github/workflows/daily-multi-device-docs-tester.md b/.github/workflows/daily-multi-device-docs-tester.md index 971177dd910..056c5d306ed 100644 --- a/.github/workflows/daily-multi-device-docs-tester.md +++ b/.github/workflows/daily-multi-device-docs-tester.md @@ -94,6 +94,16 @@ pre-agent-steps: run: | cd "$EXPR_GITHUB_WORKSPACE/docs" node ../scripts/ensure-docs-slide-pdf.js + - name: Configure Chrome sandbox + run: | + # The chrome-sandbox helper must be owned by root with mode 4755 (SUID) for Chrome + # to launch inside the agent container. The runner has mode 0777 by default. + if [ -f /opt/google/chrome/chrome-sandbox ]; then + sudo chmod 4755 /opt/google/chrome/chrome-sandbox + echo "chrome-sandbox configured (mode 4755)" + else + echo "chrome-sandbox not found — skipping" + fi - name: Start docs server env: EXPR_GITHUB_RUN_ID: ${{ github.run_id }} @@ -103,7 +113,7 @@ pre-agent-steps: PID_FILE="/tmp/gh-aw/agent/docs-server-$EXPR_GITHUB_RUN_ID.pid" cd "$EXPR_GITHUB_WORKSPACE/docs" npm run build - nohup npm run preview -- --host 127.0.0.1 --port 4321 > "$LOG_FILE" 2>&1 & + nohup npm run preview -- --host 0.0.0.0 --port 4321 > "$LOG_FILE" 2>&1 & PID=$! echo $PID > "$PID_FILE" echo "Server PID: $PID" @@ -183,11 +193,11 @@ Start the documentation preview server and perform comprehensive multi-device te ## Step 1: Verify Server Availability -The workflow pre-agent steps already installed docs dependencies, built the docs site, and started the Astro preview server. +The workflow pre-agent steps already installed docs dependencies, built the docs site, and started the Astro preview server **bound to all interfaces on port 4321**. Quickly verify it is reachable before testing: ```bash -curl -sf http://localhost:4321/gh-aw/ > /dev/null && echo "Docs server is ready" +curl -sf http://host.docker.internal:4321/gh-aw/ > /dev/null && echo "Docs server is ready" ``` ## Step 2: Device Configuration @@ -204,7 +214,7 @@ Test these device types based on input `${{ inputs.devices }}`: Playwright is pre-installed as `@playwright/cli`. Use `playwright-cli ` in bash — no MCP tools or Docker container is involved: -- ✅ **Correct**: `playwright-cli browser_navigate --url "http://localhost:4321/gh-aw/"` +- ✅ **Correct**: `playwright-cli browser_navigate --url "http://host.docker.internal:4321/gh-aw/"` - ✅ **Correct**: Use `playwright-cli browser_run_code --code "async (page) => { ... }"` for custom Playwright code - ❌ **Incorrect**: Do NOT use `playwright-cli open` in this workflow (it is less reliable in CI than explicit `browser_*` commands) - ❌ **Incorrect**: Do NOT try to `require('playwright')` or create standalone Node.js scripts @@ -217,16 +227,16 @@ Use `waitUntil: 'domcontentloaded'` for navigation to keep checks fast and consi ```bash playwright-cli browser_run_code --code "async (page) => { await page.setViewportSize({ width: 390, height: 844 }); - await page.goto('http://localhost:4321/gh-aw/', { waitUntil: 'domcontentloaded', timeout: 30000 }); + await page.goto('http://host.docker.internal:4321/gh-aw/', { waitUntil: 'domcontentloaded', timeout: 30000 }); return { url: page.url(), title: await page.title() }; }" ``` -- ✅ **Use `localhost` directly** — playwright-cli runs on the runner, so `localhost` reaches the dev server -- ❌ **Do NOT use bridge IP detection** — that is only needed in the deprecated MCP mode +- ✅ **Use `host.docker.internal`** — the agent runs inside a container; `host.docker.internal` reaches the docs server that was started in the pre-agent step on the host +- ❌ **Do NOT use `localhost`** — the container's loopback is isolated from the runner's loopback; `localhost:4321` will not be reachable For each device viewport, use playwright-cli to: -- Set viewport size and navigate to `http://localhost:4321/gh-aw/` +- Set viewport size and navigate to `http://host.docker.internal:4321/gh-aw/` - Take screenshots and run accessibility audits - Test interactions (navigation, search, buttons) - Check for layout issues (overflow, truncation, broken layouts)