Skip to content

Add configurable browser download URLs#46

Open
longlho wants to merge 1 commit into
mrmeku:mainfrom
perplexityai:main
Open

Add configurable browser download URLs#46
longlho wants to merge 1 commit into
mrmeku:mainfrom
perplexityai:main

Conversation

@longlho

@longlho longlho commented Jun 30, 2026

Copy link
Copy Markdown

Why

Some Playwright browser archives may need to be fetched from a different path or mirror than the path reported in Playwright metadata. Today, users have to work around that outside rules_playwright, usually with downloader rewrites.

This adds first-class configuration for that case.

What changed

  • Allow browsers_download_urls entries to use {path} URL templates while preserving the existing prefix behavior.
  • Add browser_download_path_map to remap browser archive paths before download URL generation and integrity lookup.
  • Add browser_download_url_map for per-path download URL templates.
  • Share the behavior between the Bzlmod extension and define_browsers.
  • Add Starlark unit tests for URL templates, path mapping, and per-path URL overrides.
  • Document the new configuration in the README.

Validation

  • bazel test //playwright/private:download_urls_test
  • bazel build //playwright:extensions //playwright:repositories //playwright/private:download_urls
  • buildifier -mode=check playwright/BUILD.bazel playwright/extensions.bzl playwright/private/BUILD.bazel playwright/private/download_urls.bzl playwright/private/download_urls_test.bzl playwright/repositories.bzl

## Why

Playwright browser metadata can point at archive paths that need to be
fetched from a different path or mirror. Downstream users shouldn’t need
Bazel downloader regex rewrites for that.

This lets AGI map Chromium 1223 to Chrome for Testing paths directly in
`rules_playwright`.

## What changed

- Let `browsers_download_urls` accept `{path}` URL templates while
keeping the existing prefix behavior.
- Add `browser_download_path_map` for remapping Playwright archive
paths.
- Add `browser_download_url_map` for per-path URL templates.
- Share the logic across the Bzlmod extension and `define_browsers`.
- Add focused Starlark unit tests for URL templates, path mapping, and
per-path URL overrides.
- Document the new config in README.

## Validation

- `env DEVBOX=false /home/dev/agi/bin/bazel test
//playwright/private:download_urls_test`
- `env DEVBOX=false /home/dev/agi/bin/bazel build
//playwright:extensions //playwright:repositories
//playwright/private:download_urls`
- `/home/dev/agi/bin/buildifier -mode=check playwright/BUILD.bazel
playwright/extensions.bzl playwright/private/BUILD.bazel
playwright/private/download_urls.bzl
playwright/private/download_urls_test.bzl playwright/repositories.bzl`

Note: `//playwright/...` still hits an existing `rules_rust`/Bazel 9
`linkstamps` analysis failure before reaching these targets.
@longlho longlho changed the title Add configurable browser download URLs (#1) Add configurable browser download URLs Jun 30, 2026
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.

1 participant