Skip to content
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

feat: update playwright DOWNLOAD_PATHS #751

Merged
merged 1 commit into from
Feb 7, 2025
Merged

feat: update playwright DOWNLOAD_PATHS #751

merged 1 commit into from
Feb 7, 2025

Conversation

fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Feb 7, 2025

closes #750

Summary by CodeRabbit

  • New Features
    • Expanded support with additional platform configurations for Ubuntu 24.04 and macOS 15 (including ARM variants).
    • Introduced a new Windows configuration for improved compatibility.
    • Updated browser configurations to deliver the latest versions across Chromium, Firefox, Webkit, FFmpeg, and Android.
  • Tests
    • Refined validation checks and error reporting to ensure consistent and reliable browser setups.

Copy link
Contributor

coderabbitai bot commented Feb 7, 2025

Walkthrough

This PR expands the supported platforms by updating the DOWNLOAD_PATHS constant and associated configurations. It adds new platform entries (ubuntu24.04-x64, ubuntu24.04-arm64, mac15, mac15-arm64) for several browsers, introduces a new browser type ("winldd"), and consolidates headless shell logic within the fetch method. Test cases have been adjusted to reflect these changes, and the JSON fixture for browser configuration has been updated with new revision numbers and version strings.

Changes

File(s) Change Summary
app/.../PlaywrightBinary.ts Updated DOWNLOAD_PATHS: added new platform entries (ubuntu24.04-x64, ubuntu24.04-arm64, mac15, mac15-arm64) for browsers (chromium, firefox, webkit, etc.); introduced new browser type "winldd"; removed chromium-headless-shell config and integrated its logic into the fetch method with added checks.
test/.../PlaywrightBinary.test.ts Modified assertions in fetch() tests: changed expected item count from 7 to 8; reordered expected items to include "winldd/"; added assertions to verify "chromium-tip-of-tree-headless-shell" and enhanced error messages with JSON outputs.
test/fixtures/.../playwright-core-browsers.json Updated browser entries: revised revision and browserVersion for chromium, chromium-tip-of-tree, firefox, firefox-beta, and webkit; added new entries for ffmpeg and android; changed winldd installByDefault flag; introduced revisionOverrides for webkit.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant F as fetch()
    participant C as DOWNLOAD_PATHS
    U->>F: Request browser binary configuration
    F->>C: Lookup configuration for requested browser type
    alt Headless-shell variant requested
        F->>C: Check for "chromium-tip-of-tree-headless-shell"
        alt Found
            F->>U: Return headless-shell configuration
        else
            F->>C: Copy properties from "chromium-tip-of-tree"
            F->>U: Return updated configuration
        end
    else
        F->>U: Return standard configuration (including new "winldd" if applicable)
    end
Loading

Assessment against linked issues

Objective Addressed Explanation
Ensure Firefox downloads for Mac platforms exist (#750)

Possibly related PRs

Suggested labels

enhancement

Poem

I'm a little rabbit on a coding spree,
Hop, hop, through browsers with glee.
New platforms and paths now shine so bright,
Winldd and headless logic take flight.
Bugs hop away like carrots in the night!
🐰💻


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c70fdcc and 9fb5876.

📒 Files selected for processing (3)
  • app/common/adapter/binary/PlaywrightBinary.ts (10 hunks)
  • test/common/adapter/binary/PlaywrightBinary.test.ts (3 hunks)
  • test/fixtures/unpkg.com/playwright-core-browsers.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: test-postgresql-fs-nfs (22, ubuntu-latest)
  • GitHub Check: test-postgresql-fs-nfs (20, ubuntu-latest)
  • GitHub Check: test-postgresql-fs-nfs (18, ubuntu-latest)
  • GitHub Check: test-postgresql-fs-nfs (18.20.0, ubuntu-latest)
  • GitHub Check: test-mysql57-fs-nfs (22, ubuntu-latest)
  • GitHub Check: test-mysql57-fs-nfs (20, ubuntu-latest)
  • GitHub Check: test-mysql57-fs-nfs (18, ubuntu-latest)
  • GitHub Check: test-mysql57-fs-nfs (18.20.0, ubuntu-latest)
  • GitHub Check: Analyze (typescript)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (13)
test/common/adapter/binary/PlaywrightBinary.test.ts (4)

54-62: LGTM! Test assertions updated to match new browser configurations.

The test correctly validates:

  • The increased number of browser types (8 items) in /builds/ directory.
  • The correct ordering of browser types, including the new 'winldd' entry.

67-67: LGTM! Browser type list updated.

The list of browser names has been updated to include 'winldd'.


73-73: LGTM! Enhanced error message with JSON stringification.

Added JSON stringification to the error message for better debugging.


104-109: LGTM! Added validation for chromium-tip-of-tree-headless-shell.

New assertions correctly validate the consolidated headless shell logic for chromium-tip-of-tree.

Also applies to: 115-117

app/common/adapter/binary/PlaywrightBinary.ts (4)

19-20: LGTM! Added support for new platforms.

New platform entries added consistently across all browsers:

  • ubuntu24.04 (x64 and arm64)
  • mac15 (x64 and arm64)

Also applies to: 23-24, 39-40, 77-78, 81-82, 97-98, 135-136, 139-140, 155-156, 164-165, 168-169, 184-185, 193-194, 197-198, 213-214, 222-223, 226-227, 242-243, 280-281, 284-285, 300-301


246-274: LGTM! Added new browser type 'winldd'.

The new browser type is correctly configured:

  • Only available for Windows (win64 platform)
  • All other platforms are undefined

382-391: LGTM! Enhanced headless shell logic.

Added support for chromium-tip-of-tree-headless-shell, following the same pattern as chromium-headless-shell.


401-404: LGTM! Updated browserDirname logic.

Correctly handles the directory structure for chromium-tip-of-tree-headless-shell.

test/fixtures/unpkg.com/playwright-core-browsers.json (5)

6-8: LGTM! Updated Chromium version.

Updated to latest stable version:

  • revision: 1155
  • version: 133.0.6943.16

12-14: LGTM! Updated Chromium tip-of-tree version.

Updated to latest development version:

  • revision: 1293
  • version: 133.0.6943.0

18-20: LGTM! Updated Firefox versions.

Updated both stable and beta versions:

  • Firefox stable: 134.0 (revision 1471)
  • Firefox beta: 133.0b9 (revision 1467)

Also applies to: 24-26


30-44: LGTM! Updated WebKit configuration.

Updated version and platform-specific overrides:

  • Base version: 18.2 (revision 2123)
  • Added new revisionOverrides for various platforms

47-64: LGTM! Updated auxiliary browser configurations.

Updated configurations for additional browsers:

  • ffmpeg: Added revision 1011 with Mac-specific overrides
  • winldd: Set installByDefault to false (Windows-only)
  • android: Added with revision 1001
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Feb 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.42%. Comparing base (a580b05) to head (9fb5876).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master     #751    +/-   ##
========================================
  Coverage   96.42%   96.42%            
========================================
  Files         191      191            
  Lines       19132    19232   +100     
  Branches     2504     2503     -1     
========================================
+ Hits        18448    18545    +97     
- Misses        684      687     +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fengmk2 fengmk2 merged commit 1850c8b into master Feb 7, 2025
18 of 19 checks passed
@fengmk2 fengmk2 deleted the DOWNLOAD_PATHS branch February 7, 2025 16:08
fengmk2 pushed a commit that referenced this pull request Feb 7, 2025
[skip ci]

## [3.73.0](v3.72.1...v3.73.0) (2025-02-07)

### Features

* update playwright DOWNLOAD_PATHS ([#751](#751)) ([1850c8b](1850c8b))
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.

playwright firefox mac not exists
1 participant