-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(build): parse Playwright 1.58+ dry-run output in playwright extension #4300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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`, | ||
|
|
||
| `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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 (Refers to lines 324-338) Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 grep pattern
playwright chromiumcan substring-match the headless-shell lineThe new extended-regex
browser: ${browser}|playwright ${browser}atpackages/build/src/extensions/playwright.ts:322is unanchored, so forbrowser === "chromium"the alternativeplaywright chromiumis a substring ofplaywright chromium-headless-shell. In non-headless mode bothchromiumandchromium-headless-shellare installed, so if Playwright 1.58+ lists the headless-shell entry before the chromium entry in--dry-runoutput, 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: chromiummatchedbrowser: 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.Was this helpful? React with 👍 or 👎 to provide feedback.