Commit 53d263e
authored
fix(PlaywrightBinary): mirror builds/cft/{browserVersion}/ chromium paths (#1050)
## Summary
Playwright 1.58.1 moved chromium downloads to Chrome for Testing URLs
(`builds/cft/{browserVersion}/{platform}/{file}.zip`) for mac, win64,
and x64 linux. linux-arm64 still uses the old
`builds/chromium/{revision}/` path. The mirror only knew the old layout,
so newer chromium revisions stopped appearing under
`playwright/builds/chromium/` (see [the playwright registry
source](https://github.com/microsoft/playwright/blob/v1.59.1/packages/playwright-core/src/server/registry/index.ts)
and [PR #39037](microsoft/playwright#39037)
which introduced the change).
Closes #1033
## URL changes (chromium revision `1217`, browserVersion
`147.0.7727.15`)
### Upstream (`https://playwright.azureedge.net`)
What playwright requests from `PLAYWRIGHT_DOWNLOAD_HOST`:
| Platform | Before (playwright ≤ 1.58.0) | After (playwright ≥ 1.58.1)
|
| --- | --- | --- |
| `mac-x64` |
https://playwright.azureedge.net/builds/chromium/1217/chromium-mac.zip |
https://playwright.azureedge.net/builds/cft/147.0.7727.15/mac-x64/chrome-mac-x64.zip
|
| `mac-arm64` |
https://playwright.azureedge.net/builds/chromium/1217/chromium-mac-arm64.zip
|
https://playwright.azureedge.net/builds/cft/147.0.7727.15/mac-arm64/chrome-mac-arm64.zip
|
| `win64` |
https://playwright.azureedge.net/builds/chromium/1217/chromium-win64.zip
|
https://playwright.azureedge.net/builds/cft/147.0.7727.15/win64/chrome-win64.zip
|
| `ubuntu/debian x64` |
https://playwright.azureedge.net/builds/chromium/1217/chromium-linux.zip
|
https://playwright.azureedge.net/builds/cft/147.0.7727.15/linux64/chrome-linux64.zip
|
| `ubuntu/debian arm64` |
https://playwright.azureedge.net/builds/chromium/1217/chromium-linux-arm64.zip
|
https://playwright.azureedge.net/builds/chromium/1217/chromium-linux-arm64.zip
*(unchanged)* |
### Mirror (`https://cdn.npmmirror.com/binaries/playwright`)
What cnpmcore exposes — these are the URLs a playwright client hits
after setting
`PLAYWRIGHT_DOWNLOAD_HOST=https://cdn.npmmirror.com/binaries/playwright`:
| Platform | Before this PR | After this PR |
| --- | --- | --- |
| `mac-x64` | ❌ not mirrored at the path playwright requests | ✅
https://cdn.npmmirror.com/binaries/playwright/builds/cft/147.0.7727.15/mac-x64/chrome-mac-x64.zip
|
| `mac-arm64` | ❌ not mirrored at the path playwright requests | ✅
https://cdn.npmmirror.com/binaries/playwright/builds/cft/147.0.7727.15/mac-arm64/chrome-mac-arm64.zip
|
| `win64` | ❌ not mirrored at the path playwright requests | ✅
https://cdn.npmmirror.com/binaries/playwright/builds/cft/147.0.7727.15/win64/chrome-win64.zip
|
| `ubuntu/debian x64` | ❌ not mirrored at the path playwright requests |
✅
https://cdn.npmmirror.com/binaries/playwright/builds/cft/147.0.7727.15/linux64/chrome-linux64.zip
|
| `ubuntu/debian arm64` | ✅
https://cdn.npmmirror.com/binaries/playwright/builds/chromium/1217/chromium-linux-arm64.zip
| ✅
https://cdn.npmmirror.com/binaries/playwright/builds/chromium/1217/chromium-linux-arm64.zip
*(unchanged)* |
`chromium-headless-shell` files share the same
`builds/cft/{browserVersion}/{platform}/` directory, e.g.
https://cdn.npmmirror.com/binaries/playwright/builds/cft/147.0.7727.15/mac-arm64/chrome-headless-shell-mac-arm64.zip.
`chromium-tip-of-tree` follows the same pattern with its own
`browserVersion`.
## Mirror directory tree (before / after)
Before — for revision 1217, only the linux-arm64 file existed in the
tree, so the chromium directory effectively stalled at the last pre-CFT
revision (1200) for most users:
```
https://registry.npmmirror.com/binary.html?path=playwright/builds/chromium/1217/
chromium-linux-arm64.zip
chromium-headless-shell-linux-arm64.zip
```
After — chromium directory still gets the linux-arm64 entries, and a new
`builds/cft/` tree exposes the CFT downloads:
```
https://registry.npmmirror.com/binary.html?path=playwright/builds/chromium/1217/
chromium-linux-arm64.zip
chromium-headless-shell-linux-arm64.zip
https://registry.npmmirror.com/binary.html?path=playwright/builds/cft/147.0.7727.15/linux64/
chrome-linux64.zip
chrome-headless-shell-linux64.zip
https://registry.npmmirror.com/binary.html?path=playwright/builds/cft/147.0.7727.15/mac-x64/
chrome-mac-x64.zip
chrome-headless-shell-mac-x64.zip
https://registry.npmmirror.com/binary.html?path=playwright/builds/cft/147.0.7727.15/mac-arm64/
chrome-mac-arm64.zip
chrome-headless-shell-mac-arm64.zip
https://registry.npmmirror.com/binary.html?path=playwright/builds/cft/147.0.7727.15/win64/
chrome-win64.zip
chrome-headless-shell-win64.zip
```
## Changes
- `app/common/adapter/binary/PlaywrightBinary.ts`
- Introduced a `cft(suffix)` helper and switched `chromium` /
`chromium-headless-shell` / `chromium-tip-of-tree` /
`chromium-tip-of-tree-headless-shell` entries for mac, win64, and x64
linux platforms to CFT objects.
- Added the new `debian13-*` platform keys playwright now ships.
- Emit `builds/cft/` as a top-level directory and populate
`/builds/cft/{browserVersion}/{platform}/` with deduplicated entries so
chromium and chromium-headless-shell share the same version+platform
dir.
## Test plan
- [x] `npm run test:local
test/common/adapter/binary/PlaywrightBinary.test.ts` — 3 tests pass,
including a new test asserting
`/builds/cft/{browserVersion}/{platform}/` contains `chrome-*.zip` and
`chrome-headless-shell-*.zip` with correctly-formed CFT URLs.
- [x] `npm run lint`
- [x] `npm run typecheck`
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added support for Chrome for Testing (CFT) binary downloads with
optimized download structure.
* **Tests**
* Added comprehensive test coverage validating CFT mirror layout and
download URL patterns.
* Updated existing tests to reflect new directory organization.
<!-- review_stack_entry_start -->
[](https://app.coderabbit.ai/change-stack/cnpm/cnpmcore/pull/1050?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)
<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent f2e685f commit 53d263e
2 files changed
Lines changed: 213 additions & 84 deletions
File tree
- app/common/adapter/binary
- test/common/adapter/binary
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
27 | | - | |
| 30 | + | |
28 | 31 | | |
29 | | - | |
| 32 | + | |
30 | 33 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
56 | | - | |
| 61 | + | |
57 | 62 | | |
58 | | - | |
| 63 | + | |
59 | 64 | | |
| 65 | + | |
| 66 | + | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
74 | 81 | | |
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
78 | | - | |
79 | | - | |
80 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
81 | 88 | | |
82 | 89 | | |
83 | 90 | | |
84 | 91 | | |
85 | | - | |
| 92 | + | |
86 | 93 | | |
87 | | - | |
| 94 | + | |
88 | 95 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
103 | 112 | | |
104 | 113 | | |
105 | 114 | | |
106 | 115 | | |
107 | | - | |
108 | | - | |
109 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
110 | 119 | | |
111 | 120 | | |
112 | 121 | | |
113 | 122 | | |
114 | | - | |
| 123 | + | |
115 | 124 | | |
116 | | - | |
| 125 | + | |
117 | 126 | | |
| 127 | + | |
| 128 | + | |
118 | 129 | | |
119 | 130 | | |
120 | 131 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
132 | 143 | | |
133 | 144 | | |
134 | 145 | | |
| |||
338 | 349 | | |
339 | 350 | | |
340 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
341 | 361 | | |
342 | 362 | | |
343 | 363 | | |
| |||
349 | 369 | | |
350 | 370 | | |
351 | 371 | | |
| 372 | + | |
352 | 373 | | |
353 | 374 | | |
354 | 375 | | |
| |||
467 | 488 | | |
468 | 489 | | |
469 | 490 | | |
470 | | - | |
| 491 | + | |
471 | 492 | | |
472 | 493 | | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
485 | 541 | | |
486 | 542 | | |
487 | 543 | | |
| |||
0 commit comments