Add configurable browser download URLs#46
Open
longlho wants to merge 1 commit into
Open
Conversation
## 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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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
browsers_download_urlsentries to use{path}URL templates while preserving the existing prefix behavior.browser_download_path_mapto remap browser archive paths before download URL generation and integrity lookup.browser_download_url_mapfor per-path download URL templates.define_browsers.Validation
bazel test //playwright/private:download_urls_testbazel build //playwright:extensions //playwright:repositories //playwright/private:download_urlsbuildifier -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