-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
[rust] honor --browser-version in Selenium Manager Electron driver resolution #17567
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
base: trunk
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,17 +119,30 @@ impl SeleniumManager for ElectronManager { | |
| Ok(driver_version) | ||
| } | ||
| _ => { | ||
| self.assert_online_or_err(OFFLINE_REQUEST_ERR_MSG)?; | ||
|
|
||
| let latest_url = format!( | ||
| "{}{}", | ||
| self.get_driver_mirror_url_or_default(DRIVER_URL), | ||
| LATEST_RELEASE | ||
| ); | ||
| let driver_version = | ||
| read_redirect_from_link(self.get_http_client(), latest_url, self.get_logger())?; | ||
| // Electron releases are tagged by Electron version, and the | ||
| // chromedriver asset shipped in each release matches that tag. | ||
| // When the user pins a concrete browser version (e.g. | ||
| // `--browser-version 36.2.1`), that version is the driver | ||
| // version we want; resolving via `/releases/latest` would | ||
| // discard the user's request and return the latest tag instead. | ||
| let browser_version = self.get_browser_version().to_string(); | ||
| let driver_version = if !browser_version.is_empty() | ||
| && !self.is_browser_version_stable() | ||
| && !self.is_browser_version_unstable() | ||
| { | ||
| browser_version | ||
| } else { | ||
|
Comment on lines
119
to
+134
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. Cache overrides pinned patch request_driver_version still checks metadata by major_browser_version before applying the pinned --browser-version logic, so a cached entry for major "36" can override a user request for "36.2.1" and return a different patch driver version. This can silently violate the user’s explicit version pin. Agent Prompt
|
||
| self.assert_online_or_err(OFFLINE_REQUEST_ERR_MSG)?; | ||
| let latest_url = format!( | ||
| "{}{}", | ||
| self.get_driver_mirror_url_or_default(DRIVER_URL), | ||
| LATEST_RELEASE | ||
| ); | ||
| read_redirect_from_link(self.get_http_client(), latest_url, self.get_logger())? | ||
| }; | ||
|
Comment on lines
+128
to
+142
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Unnormalized pinned version The pinned --browser-version is used verbatim as driver_version, but get_driver_url always prefixes the driver version with "v", so inputs like "v36.2.1" will produce "vv36.2.1" and break downloads. This is a regression from the redirect-based path that normalizes versions via parse_version(). Agent Prompt
|
||
| let driver_ttl = self.get_ttl(); | ||
| if driver_ttl > 0 { | ||
| if driver_ttl > 0 && !major_browser_version.is_empty() && !driver_version.is_empty() | ||
| { | ||
| metadata.drivers.push(create_driver_metadata( | ||
| major_browser_version, | ||
| self.driver_name, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Electron treats major as tag
📘 Rule violation≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools