Skip to content

Remove platform assumptions from docs builds and Playwright - #78612

Closed
pelikhan wants to merge 2 commits into
mainfrom
copilot/docs-remove-platform-specific-assumptions
Closed

pelikhan wants to merge 2 commits into
mainfrom
copilot/docs-remove-platform-specific-assumptions

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Docs builds assume POSIX cleanup, forward-slash paths, and LF checkouts. Playwright also requires Chromium at a fixed Linux path.

  • Build checks: Use Node’s recursive cleanup; normalize relative paths and CRLF before validation.
  • Browser selection: Centralize settings in chromiumUse; prefer /usr/bin/chromium-browser when present, otherwise use bundled Chromium, preserving CI behavior.
  • Guidance: Update the cracktro skill with browser fallback and installation instructions.
  • Regression coverage: Cover path separators, line endings, cleanup, and both browser-selection branches.

@pelikhan pelikhan changed the title [WIP] Fix docs build checks and Playwright config for platform compatibility Remove platform assumptions from docs builds and Playwright Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Visual regression check: docs preview

Captured the built docs preview at /gh-aw/ inside the sandbox with Playwright CLI.

Page Viewport Capture status Comparison status
/gh-aw/ Mobile 375x812 captured unavailable
/gh-aw/ Tablet 768x1024 captured unavailable
/gh-aw/ Desktop 1440x900 captured unavailable

Comparison is unavailable, not unchanged: no baseline is provisioned for this workflow, so no visual differences were established either way.

Full-page screenshots (sandbox only): /tmp/gh-aw/agent/screenshot-mobile.png, screenshot-tablet.png, screenshot-desktop.png.

Accessibility snapshot (heuristic, not exhaustive compliance):

  • One H1 and a logical H1 > H2 > H3 heading order.
  • No unnamed links, buttons, or images found by pattern search; images carry descriptive alt text.
  • Console reported 0 errors and 4 warnings on load; the warnings were not inspected.
  • Not checked: color contrast, keyboard focus order, and interactive states.

Notes: Playwright CLI wrote session artifacts (.playwright-cli/ snapshot and console logs) under the working directory. Repo cleanliness could not be verified because a verification command was denied.

Generated by 👁️ Visual Regression Checker for #78612 · copilot · routed: haiku55 xhigh · ~2 AIC · ⌖ ~1 AIC · ⊞ 3.3K · ◷

@pelikhan
pelikhan marked this pull request as ready for review November 17, 2026 05:08
Copilot AI adaptive review requested due to automatic review settings November 17, 2026 05:08
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~10 AIC · ⌖ ~2 AIC · ⊞ 6.6K · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by Ponytail Reviewer for #78612 · codex · routed: gpt61 medium · ~3 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.5K · ◷

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the documentation build portability changes.

No open issues 🎉

What changed in this PR

This PR addresses #78591 by removing platform-specific assumptions from the docs build checks and Playwright configuration.

Changes:

  • Replace POSIX cleanup with Node-based removal and normalize path separators and CRLF line endings.
  • Share Chromium settings, preferring the existing system path when available and falling back to bundled Chromium.
  • Add portability regression coverage and update browser setup guidance.
File Description
docs/​scripts/​check-redirects.mjs Normalize CRLF before parsing redirects.
docs/​scripts/​check-reading-measure.mjs Normalize relative path separators before validation.
docs/​scripts/​build-portability.test.mjs Cover path formats, line endings, cleanup, and browser selection.
docs/​playwright.config.ts Centralize Chromium settings and add bundled-browser fallback.
docs/​package.json Replace rm -rf with portable Node cleanup.
.github/​skills/​cracktro/​SKILL.md Document browser fallback and installation instructions.

Review effort: Balanced (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-17T05:14:00Z
review_event: COMMENT
top_themes: [regression coverage not wired into docs test/build flow]
files_reviewed: [docs/playwright.config.ts, docs/scripts/build-portability.test.mjs, docs/scripts/check-reading-measure.mjs, docs/scripts/check-redirects.mjs, docs/package.json, .github/skills/cracktro/SKILL.md]
comment_count: 1
History

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.5K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete: one actionable coverage gap found.

Highlights

The added portability regression suite is not connected to the docs test/build flow, so its coverage will not run automatically.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.5K
Comment /review to run again

@@ -0,0 +1,103 @@
import assert from "node:assert/strict";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new portability tests are not wired into any npm script or documented CI invocation, so this regression coverage will never run in the normal docs test/build flow.

💡 Run the regression suite

Add a package script (for example, test:scripts: node --test scripts/*.test.mjs) and invoke it from the docs CI/test command, so path, newline, cleanup, and browser-selection regressions are actually exercised.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-081f5bb6-e9a9-479c-a338-a3a11677b375","parents":[],"payload":{"id":"ldg-d98cf0ff-aea3-4677-be19-d6ea562eaffb","operation":"append","value":{"finding_count":1,"head_sha":"276bc150233458bb05f477771e892cf60bd9a0ff","outcome":"findings"}},"sha":"sha256:341f62c3ed8ed19ce43303a37ed3cf9664c16829dae07eb1953577aaf21902b0","timestamp":"2026-11-17T05:17:05.268Z","type":"ledger_append","version":1}
History

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /tdd, /codebase-design, and /grill-with-docs. Requesting changes because the new regression suite is never executed, so the fixes it guards have no CI protection.

📋 Key Themes & Highlights

Key Themes

  • Unwired tests: docs/scripts/build-portability.test.mjs is not run by any Makefile target or workflow. docs.yml only runs npm run build.
  • Playwright coverage: CI never runs playwright test and never installs Chromium. The Chromium-selection branches are only covered locally, and they patch fs.existsSync through ESM internals.
  • Config design: The build cleanup is an inline node -e one-liner. The quote rewrite in playwright.config.ts adds diff noise that is unrelated to the fix.

Positive Highlights

  • ✅ rmSync replaces rm -rf, and the dist cleanup is idempotent.
  • ✅ CRLF normalization in check-redirects.mjs and the path normalization in check-reading-measure.mjs are small, targeted fixes.
  • ✅ The non-Playwright tests pass locally (5/5 under node --test).

Test Execution Limits

  • npm ci failed locally on a registry TLS error, so @playwright/test is not installed. The Playwright branch tests were not run.
  • I did not compare the new tests against the base commit, so I have not confirmed they fail on the original bugs.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~10 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again

@@ -0,0 +1,103 @@
import assert from "node:assert/strict";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/tdd] These regression tests never run. No Makefile target or workflow runs docs/scripts/build-portability.test.mjs, and docs.yml only runs npm run build, so the fixes have no guard.

💡 Suggested wiring
test-docs-portability:
	cd docs && node --test scripts/build-portability.test.mjs

Add this to the test-docs-* targets and call it from the docs CI job after npm ci --legacy-peer-deps. The Playwright branch tests need @playwright/test installed, so they only run where dependencies are installed.

@copilot please address this.

});

for (const systemChromium of [true, false]) {
test(`Playwright uses ${systemChromium ? "system" : "bundled"} Chromium when the system path ${systemChromium ? "exists" : "is absent"}`, () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/tdd] These tests replace fs.existsSync through syncBuiltinESMExports and then import the real config. That needs @playwright/test and relies on Node ESM internals. The Windows path case uses the same kind of patch. Move the Chromium choice into a pure helper and test it directly.

💡 Suggested seam
export function chromiumUse(exists: (path: string) => boolean = existsSync) {
  return {
    ...devices["Desktop Chrome"],
    launchOptions: exists("/usr/bin/chromium-browser") ? { executablePath: "/usr/bin/chromium-browser" } : {},
  };
}

The spec can then pass a stub exists and assert both branches without patching the module system.

@copilot please address this.

Comment thread docs/package.json
"start": "astro dev",
"prebuild": "npm run check:cracktro && node scripts/check-reading-measure.mjs && node scripts/check-redirects.mjs && npm run generate-agent-factory && npm run generate-model-tables && npm run build:slides",
"build": "rm -rf dist && astro build",
"build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && astro build",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/codebase-design] The cleanup is now an inline node -e one-liner inside JSON, which is hard to read. The new cleanup test also splits scripts.build on the string " && " to find it. Move this step into a small script so it can run and be tested directly.

💡 Suggested script
import { rmSync } from "node:fs";

rmSync("dist", { recursive: true, force: true });

Then use "build": "node scripts/clean-dist.mjs && astro build". The require inside -e only works because -e evaluates as CJS, which is easy to break.

@copilot please address this.

Comment thread docs/playwright.config.ts
import { defineConfig, devices } from '@playwright/test';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig, devices } from "@playwright/test";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/codebase-design] The quote rewrite touches nearly every line of this file (the imports, testDir, reporter, baseURL, trace, and command) with no behavior change. Keep the original single quotes so the diff only shows the Chromium selection change.

@copilot please address this.

## Tests

Run from `docs/` after `npm ci`: `npx playwright test tests/talk.spec.ts`. The config builds and previews (`npm run build && npm run preview`, `localhost:4321`, `/gh-aw/cracktro/`, Chromium `/usr/bin/chromium-browser`), covering built JSON-LD; under `npm run dev`, check `curl -s localhost:4321/gh-aw/cracktro/ | grep hasPart`. If `node_modules` is missing, report the tests as not run.
After `npm ci` in `docs/`, run `npx playwright test tests/talk.spec.ts`. Config builds/previews at `localhost:4321/gh-aw/cracktro/` to test JSON-LD, using `/usr/bin/chromium-browser` if present or bundled Chromium (`npx playwright install chromium`). For dev JSON-LD: `curl -s localhost:4321/gh-aw/cracktro/ | grep hasPart`. Without `node_modules`, report tests not run.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/grill-with-docs] This paragraph gives local test instructions, but nothing in CI runs this spec, and no workflow installs Chromium. State that the spec is a local check, and that npx playwright install chromium is needed when /usr/bin/chromium-browser is absent, so authors do not assume CI covers it.

@copilot please address this.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (docs/scripts/build-portability.test.mjs:1): address unresolved feedback - Review comment
  3. Review (docs/scripts/build-portability.test.mjs:1): address unresolved feedback - Review comment
  4. Review (docs/scripts/build-portability.test.mjs:79): address unresolved feedback - Review comment
  5. Review (docs/package.json:13): address unresolved feedback - Review comment
  6. Review (docs/playwright.config.ts:1): address unresolved feedback - Review comment
  7. Review (.github/skills/cracktro/SKILL.md:100): address unresolved feedback - Review comment
  8. Fix failing check conclusion (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "276bc150233458bb05f477771e892cf60bd9a0ff",
  "kind": "requested",
  "schema_version": "1",
  "state": "9abf2bdbe6d8be3341219880eec16501fece3b2582e501f33b88e2052ad23f1d",
  "work": [
    "09f982fb8cab83ad2df13c1c574ad4364e0a64b0cf068310a834ee40b59ed543",
    "10fec94a3ed7d2bdef624eff0821eef618ebeb26ee75711c14c201389191fd86",
    "42ec4a4ab9d02eff26062197da4895ac62e9c02bf6d9e233edd1ff34a703acd8",
    "51e2287c3d1ee41b7e13769862add61dcd292a623cf943abc5968c984e246bcf",
    "5f079490da1d251ffacfd8b4bcc65c923450abdd0244c38c54e192cc12d175b2",
    "8130ae250cf11bee994a7e0817af5efa0c8d40127ef28add3c76f4702e4d827a",
    "a5eb1fe9743c6814bebc34f5a21016639a03eb38a3a5fab2a659cc4357b0eac7"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

@pelikhan pelikhan closed this Nov 17, 2026
Copilot AI requested a review from gh-aw-bot November 17, 2026 06:00
@github-actions
github-actions Bot deleted the copilot/docs-remove-platform-specific-assumptions branch November 25, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: remove platform-specific assumptions from the docs build checks and Playwright config

4 participants