[rb] separate concerns between Service, DriverFinder, and Options#17564
Conversation
Review Summary by QodoRefactor driver path resolution to separate concerns between Service, DriverFinder, and Options
WalkthroughsDescription• Separate concerns between Service, DriverFinder, and Options classes • DriverFinder now accepts nil options and parses driver from Service • LocalDriver handles all Options mutations instead of DriverFinder • Service no longer uses reflection to instantiate Options • Browser version is cleared when binary is resolved by Selenium Manager Diagramflowchart LR
LD["LocalDriver"] -->|calls with options| DF["DriverFinder"]
DF -->|accepts nil options| S["Service"]
DF -->|queries| SM["SeleniumManager"]
LD -->|mutates| OPT["Options"]
LD -->|sets executable_path| S
S -->|launch calls| DF
File Changes1. rb/lib/selenium/webdriver/common/driver_finder.rb
|
Code Review by Qodo
1. process_options clears browser_version
|
bbc6f00 to
b63f205
Compare
|
Persistent review updated to latest commit b63f205 |
|
Persistent review updated to latest commit 12435d6 |
|
Persistent review updated to latest commit 2627733 |
I made a small change yesterday to allow Grid to run beta versions of browsers when browsers aren't pinned by bazel.
The change broke the build and I realized I made it in the wrong place because the concerns aren't well separated in these classes.
💥 What does this PR do?
Unneeded browser versions will always be stripped before getting sent to the driver
🔧 Implementation Notes
LocalDriveralways callsDriverFinderto parse values fromOptionsandServiceno shortcutsOptionmutations only happen inLocalDrivernotDriverFinderServiceno longer reaches intoOptionswithconst_get,DriverFinderwill parse driver name from the service class🤖 AI assistance