Skip to content
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

Feat/#94 resolve download url dynamically for chrome driver #95

Conversation

KevinVanSonsbeek
Copy link
Contributor

@KevinVanSonsbeek KevinVanSonsbeek commented Feb 16, 2024

Fixes #94

A rewrite of the logic for the chrome downloader, so the new chrome versions are now based on an api response. And we should no longer be able to run into the situation where the fetching breaks, if they suddenly change the download url.

$driver->version()->toBuildString(),
$this->getBinaryName($driver)
)
$this->downloadUrlResolver->byDriver($driver, $this->getBinaryName($driver)),
Copy link
Owner

Choose a reason for hiding this comment

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

getBinaryName() is only used here. I'd move it to the implementation of the DownloadUrlResolver, so it doesn't need to be passed here. Then the interface for DownloadUrlResolver::byDriver($driver) also makes more sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've moved the logic to the DownloadUrlResolver, and split it up. So the distinction between binary and platform is clearer.

Comment on lines 155 to 164
if ($operatingSystem->equals(OperatingSystem::WINDOWS())) {
return 'win32/' . self::BINARY_WINDOWS_JSON;
return 'win32';
}

if ($operatingSystem->equals(OperatingSystem::MACOS())) {
return 'mac-x64/' . self::BINARY_MAC_JSON;
return 'mac-x64';
}

if ($operatingSystem->equals(OperatingSystem::LINUX())) {
return 'linux64/' . self::BINARY_LINUX_JSON;
return 'linux64';
Copy link
Owner

Choose a reason for hiding this comment

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

Are you sure this is correct? This was working before, did it not change in some major version again?

Copy link
Contributor Author

@KevinVanSonsbeek KevinVanSonsbeek Feb 20, 2024

Choose a reason for hiding this comment

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

This is a bit of an odd one tbh. As it's not really a binary you need to resolve anymore for the new api that i've used. But instead you need to specify the platform. From which you can then fetch the URL.

Edit: But this is actually logic that should be in the downloader, so i'll seperate it for clarity.

@KevinVanSonsbeek KevinVanSonsbeek deleted the feat/#94_resolve_download_url_dynamically_for_chrome_driver branch February 20, 2024 18:10
@KevinVanSonsbeek KevinVanSonsbeek restored the feat/#94_resolve_download_url_dynamically_for_chrome_driver branch February 20, 2024 18:17
@dbrekelmans dbrekelmans merged commit 36bacb9 into dbrekelmans:main Feb 20, 2024
46 checks passed
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.

Feature: Resolve chrome download url from api call
3 participants