Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/playwright-dry-run-format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@trigger.dev/build": patch
---

Support Playwright 1.58+ dry-run output when installing browsers in the Playwright build extension.
4 changes: 3 additions & 1 deletion packages/build/src/extensions/playwright.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,9 @@ class PlaywrightExtension implements BuildExtension {

Array.from(browsersToInstall).forEach((browser) => {
instructions.push(
`RUN grep -A5 -m1 "browser: ${browser}" /tmp/browser-info.txt > /tmp/${browser}-info.txt`,
// Playwright ≤1.57: "browser: chromium version ..."
// Playwright ≥1.58: "Chrome for Testing ... (playwright chromium v...)"
`RUN grep -A5 -m1 -E "browser: ${browser}|playwright ${browser}" /tmp/browser-info.txt > /tmp/${browser}-info.txt`,

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.

🔍 grep pattern playwright chromium can substring-match the headless-shell line

The new extended-regex browser: ${browser}|playwright ${browser} at packages/build/src/extensions/playwright.ts:322 is unanchored, so for browser === "chromium" the alternative playwright chromium is a substring of playwright chromium-headless-shell. In non-headless mode both chromium and chromium-headless-shell are installed, so if Playwright 1.58+ lists the headless-shell entry before the chromium entry in --dry-run output, the -m1 (first match) for the chromium iteration would grab the wrong entry, producing the wrong install directory/download URL. This substring ambiguity is order-dependent and also existed in the old plain-grep pattern (browser: chromium matched browser: chromium-headless-shell), so it is not newly introduced, but the fix does not resolve it. Worth verifying the actual line ordering of Playwright 1.58+ dry-run output.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


`RUN INSTALL_DIR=$(grep "Install location:" /tmp/${browser}-info.txt | cut -d':' -f2- | xargs) && \
DIR_NAME=$(basename "$INSTALL_DIR") && \
Comment on lines 324 to 325

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.

🔍 Fix assumes Install location / Download url lines are unchanged in 1.58+

Only the first grep was changed; the downstream parsing at packages/build/src/extensions/playwright.ts:324-338 still relies on Install location: and Download url: lines appearing within the 5 lines following the matched header (-A5). This assumes Playwright 1.58+ retained those exact labels and their relative position under the new (playwright chromium v...) header line. If 1.58+ reformatted or relocated those lines, the build would fail at the explicit Failed to extract... guards. The PR description implies the grep is the only needed change, but this coupling is worth confirming against real 1.58+ output.

(Refers to lines 324-338)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Expand Down