-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
chore(deps): bump selenium 4.14.0+ #25933
base: master
Are you sure you want to change the base?
Conversation
Thanks @gnought for the change. As your point out with Selenium 4.10+ the |
superset/config.py
Outdated
@@ -1360,7 +1360,7 @@ def EMAIL_HEADER_MUTATOR( # pylint: disable=invalid-name,unused-argument | |||
WEBDRIVER_AUTH_FUNC = None | |||
|
|||
# Any config options to be passed as-is to the webdriver | |||
WEBDRIVER_CONFIGURATION: dict[Any, Any] = {"service_log_path": "/dev/null"} | |||
WEBDRIVER_CONFIGURATION: dict[Any, Any] = {} |
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.
@gnought would you mind providing context for this change? Note irrespective of what the default values are this would still be deemed a breaking change given that the customizable Superset configurations are deemed a public interface.
CC @michael-s-molina for context regarding our recent discussion on breaking changes.
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.
In 4.9.0, service_log_path
is one of parameters in WebDriver
constructor.
https://github.com/SeleniumHQ/selenium/blob/bc7e0c7341fdde78cdd80ce572002a7866fd1769/py/selenium/webdriver/firefox/webdriver.py#L90-L110
However it is no longer in 4.10.0+.
https://github.com/SeleniumHQ/selenium/blob/c14d9678990942b93cb421c5567d0da7fb29c7bd/py/selenium/webdriver/firefox/webdriver.py#L50-L53
The following commit will support 4.10.0. It also opens for users to refine Webdrver Options
and Service
.
For sure, this will be a breaking change if users defining WEBDRIVER_CONFIGURATION
themselves using 4.9.0 WebDriver defintion.
e6b336a
to
27dd74d
Compare
superset/utils/webdriver.py
Outdated
@@ -250,32 +250,54 @@ def get_screenshot(self, url: str, element_name: str, user: User) -> bytes | Non | |||
|
|||
class WebDriverSelenium(WebDriverProxy): | |||
def create(self) -> WebDriver: | |||
# Add additional configured webdriver options |
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.
@gnought thanks for refactoring, however I sense this change isn't suffice. The TL;DR is either:
- We hold of this change until 4.0 when the breaking window opens, or
- We need to mutate existing user defined
WEBDRIVER_CONFIGURATION
to conform to the new options/service structure.
For example in the current form if an implementation has defined the following,
WEBDRIVER_CONFIGURATION = {"service_log_path": "/dev/null"}
then said configuration would be lost if this PR was merged because the service_log_path
key isn't handled. It would be good to look at the Selenium changelog and check the codebase to see whether they have a mechanism for migrating from the old to new WebDriver
class.
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.
@john-bodley, modified code a bit for backward compatibility. Hope it makes us feel safe.
27dd74d
to
59d21fa
Compare
FYI: if the change is made it should be updated to 4.14.x (or newer) to fix a CVE finding (refer linked #26992) |
Unfortunately, I think this missed the proposal window for breaking changes, and will have to go into 5.0. I'l add it to that project board now. I'm also not sure where we stand with the potential migration to Playwright (thus tagging @kgabryje here) and if that will become the standard by 5.0. If we want to proceed with this upgrade, which seems sensible, this PR will just need a rebase and bump to 4.14.x or greater by the time that breaking window re-opens. |
This has also been updated to auto-close #26992 when it does become mergeable. |
Hi @rusackas |
FYI I fixed the merge conflicts, can we remove the hold on this one? In any case if the interface changed we should add a line in |
@mistercrunch We can't remove the |
@gnought we want to push this through for Superset 5.0 (we're approaching the breaking window during which this can be merged). Would you be able to rebase this PR and fix failing CI checks? |
dc32077
to
7cc517d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #25933 +/- ##
===========================================
+ Coverage 60.48% 83.73% +23.24%
===========================================
Files 1931 537 -1394
Lines 76236 39077 -37159
Branches 8568 0 -8568
===========================================
- Hits 46114 32721 -13393
+ Misses 28017 6356 -21661
+ Partials 2105 0 -2105
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
SUMMARY
This is a proper fix for the PR #24538.
However we have to think about how the
WEBDRIVER_CONFIGURATION
should be. The selenium 4.10+ only allowsoptions
andservices
to be passed to theWebDriver
constructor.https://github.com/SeleniumHQ/selenium/blob/c14d9678990942b93cb421c5567d0da7fb29c7bd/py/selenium/webdriver/firefox/webdriver.py#L41-L46
superset/superset/utils/webdriver.py
Lines 276 to 279 in a698587
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION