[java] add test to prevent updating pinned chrome version before cdp#17425
[java] add test to prevent updating pinned chrome version before cdp#17425titusfortner wants to merge 1 commit intotrunkfrom
Conversation
Review Summary by QodoAdd test to validate Chrome versions against CDP support
WalkthroughsDescription• Add Python test to validate pinned Chrome versions match CDP support • Prevent accidental updates to Chrome versions unsupported by DevTools Protocol • Export build files to enable test access to version configurations • Integrate test into Bazel build system for automated validation File Changes1. scripts/pinned_browsers_test.py
|
Code Review by Qodo
1. Pinned Chrome not in CDP
|
There was a problem hiding this comment.
Pull request overview
Adds a Bazel Python test to ensure the repo’s pinned stable Chrome milestone isn’t advanced beyond the Java CDP versions Selenium ships, so updating pinned browsers can’t silently get ahead of CDP support.
Changes:
- Add
//scripts:pinned_browsers_testto compare pinned stable Chrome milestones incommon/repositories.bzlagainstCDP_VERSIONSinjava/.../devtools/versions.bzl. - Wire the new test into
scripts/BUILD.bazelas apy_test. - Export
repositories.bzlandversions.bzlas files so they can be used asdatainputs in Bazel.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/pinned_browsers_test.py | New Bazel test that enforces pinned stable Chrome milestone is present in Java CDP_VERSIONS. |
| scripts/BUILD.bazel | Adds the new py_test target for the pinned browser/CDP consistency check. |
| java/src/org/openqa/selenium/devtools/BUILD.bazel | Exports versions.bzl for Bazel data consumption. |
| common/BUILD.bazel | Exports repositories.bzl for Bazel data consumption. |
| f"Stable pinned Chrome versions {sorted(chrome_versions)} must be present in " | ||
| "CDP_VERSIONS; found {sorted(devtools_versions)}. " |
| 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( |
There was a problem hiding this comment.
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
💥 What does this PR do?
I don't think we should be testing later versions of Chrome than we support with CDP for a few reasons.
🔧 Implementation Notes
Add a python test to scripts so bazel should pick it up when the change is made
🤖 AI assistance