Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")

package(default_visibility = ["//visibility:public"])

exports_files(["repositories.bzl"])

bool_flag(
name = "pin_browsers",
build_setting_default = True,
Expand Down
2 changes: 2 additions & 0 deletions java/src/org/openqa/selenium/devtools/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
load("//common:defs.bzl", "copy_file")
load("//java:defs.bzl", "artifact", "java_binary", "java_library")

exports_files(["versions.bzl"])

GENERATOR_SOURCES = [
"CdpClientGenerator.java",
]
Expand Down
11 changes: 10 additions & 1 deletion scripts/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@py_dev_requirements//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_binary")
load("@rules_python//python:defs.bzl", "py_binary", "py_test")
load("//java:defs.bzl", "artifact", "java_binary")

py_binary(
Expand All @@ -11,6 +11,15 @@ py_binary(
],
)

py_test(
name = "pinned_browsers_test",
srcs = ["pinned_browsers_test.py"],
data = [
"//common:repositories.bzl",
"//java/src/org/openqa/selenium/devtools:versions.bzl",
],
)

py_binary(
name = "selenium_manager",
srcs = ["selenium_manager.py"],
Expand Down
23 changes: 23 additions & 0 deletions scripts/pinned_browsers_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python

import re
from pathlib import Path

root = Path(__file__).resolve().parents[1]
repositories = (root / "common/repositories.bzl").read_text()
versions = (root / "java/src/org/openqa/selenium/devtools/versions.bzl").read_text()

chrome_versions = set(
re.findall(
r'name = "(?:linux|mac)_chrome",\s+url = "[^"]+/(\d+)\.[^"]+/(?:linux64|mac-arm64)/chrome-[^"]+\.zip"',
repositories,
)
)
devtools_versions = set(re.findall(r'"v(\d+)"', versions))
unmatched_chrome_versions = chrome_versions - devtools_versions

if unmatched_chrome_versions:
raise AssertionError(
Comment on lines +10 to +20
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Pinned chrome not in cdp 🐞 Bug ≡ Correctness

scripts/pinned_browsers_test.py will raise because common/repositories.bzl pins stable Chrome
milestone 148 while java devtools CDP_VERSIONS only includes 145–147, making
unmatched_chrome_versions non-empty. This makes the PR’s newly-added test fail in the current tree.
Agent Prompt
### Issue description
The newly added `//scripts:pinned_browsers_test` fails because the pinned stable Chrome major version extracted from `common/repositories.bzl` is not present in `CDP_VERSIONS`.

### Issue Context
Right now, stable Chrome is pinned to milestone 148 in `common/repositories.bzl`, while `CDP_VERSIONS` only includes v145–v147.

### Fix Focus Areas
- Update pinned stable Chrome milestone OR add corresponding CDP version so the test passes.
- file/path references:
  - common/repositories.bzl[200-276]
  - java/src/org/openqa/selenium/devtools/versions.bzl[1-7]
  - scripts/pinned_browsers_test.py[10-23]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

f"Stable pinned Chrome versions {sorted(chrome_versions)} must be present in "
"CDP_VERSIONS; found {sorted(devtools_versions)}. "
Comment on lines +21 to +22
)
Loading