forked from triggerdotdev/trigger.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
fix(build): playwright extension parses the Playwright 1.58+ install --dry-run output
#7
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
Open
anurag6569201
wants to merge
1
commit into
qa/agent-triggerdotdev-trigger-dev/pr-13-4881/base
Choose a base branch
from
qa/agent-triggerdotdev-trigger-dev/pr-13-4881/head
base: qa/agent-triggerdotdev-trigger-dev/pr-13-4881/base
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@trigger.dev/build": patch | ||
| --- | ||
|
|
||
| The `playwright` build extension now works with Playwright 1.58 and later. 1.58 changed the `playwright install --dry-run` output, which made deploy image builds fail while downloading the browsers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { describe, expect, it } from "vitest"; | ||
| import { dryRunHeaderPattern } from "./playwright.js"; | ||
|
|
||
| // Real `playwright install --dry-run` headers, before and after the 1.58 format change. | ||
| const HEADERS = { | ||
| "1.57": { | ||
| chromium: "browser: chromium version 143.0.7499.4", | ||
| "chromium-headless-shell": "browser: chromium-headless-shell version 143.0.7499.4", | ||
| firefox: "browser: firefox version 144.0.2", | ||
| webkit: "browser: webkit version 26.0", | ||
| }, | ||
| "1.62": { | ||
| chromium: "Chrome for Testing 151.0.7922.34 (playwright chromium v1234)", | ||
| "chromium-headless-shell": | ||
| "Chrome Headless Shell 151.0.7922.34 (playwright chromium-headless-shell v1234)", | ||
| firefox: "Firefox 153.0 (playwright firefox v1538)", | ||
| webkit: "WebKit 26.5 (playwright webkit v2336)", | ||
| }, | ||
| } as const; | ||
|
|
||
| const browsers = Object.keys(HEADERS["1.57"]) as Array<keyof (typeof HEADERS)["1.57"]>; | ||
|
|
||
| describe("playwright extension dry-run header pattern", () => { | ||
| it.each(browsers)("selects the %s block in both output formats", (browser) => { | ||
| const pattern = new RegExp(dryRunHeaderPattern(browser)); | ||
|
|
||
| expect(pattern.test(HEADERS["1.57"][browser])).toBe(true); | ||
| expect(pattern.test(HEADERS["1.62"][browser])).toBe(true); | ||
| }); | ||
|
|
||
| it.each(browsers)("does not select another browser's block for %s", (browser) => { | ||
| const pattern = new RegExp(dryRunHeaderPattern(browser)); | ||
|
|
||
| for (const other of browsers.filter((b) => b !== browser)) { | ||
| expect(pattern.test(HEADERS["1.57"][other])).toBe(false); | ||
| expect(pattern.test(HEADERS["1.62"][other])).toBe(false); | ||
| } | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Shipwright · CRITICAL
The new regex pattern 'browser: ${browser} |(playwright ${browser} v' is built by interpolating the browser name directly into a regex string without escaping regex metacharacters
Impact: The new regex pattern 'browser: ${browser} |(playwright ${browser} v' is built by interpolating the browser name directly into a regex string without escaping regex metacharacters. If a browser name ever contains a regex special character (e.g., a dot, plus, or parenthesis), the generated RegExp will either fail to compile or match unintended text, breaking the deploy image build. The existing code already interpol…
Suggested fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright.