selenium
selenium copied to clipboard
[grid] flatten combined routes to improve routing
User description
Motivation and Context
Before this PR there are 3 - 4 levels of nested CombinedRoute instances, this PR will flatten them.
A CombinedRoute must call match again inside handle to determinate the correct Route to call.
Each match call will create a copy of the HttpRequest to check this, this overhead is reduced by this PR.
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
- [x] I have read the contributing document.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
Type
enhancement
Description
- Refactored
CombinedRouteto flatten nested instances, improving the routing process by reducing the overhead of matching routes. - Updated tests to align with the new logic of flattened
CombinedRouteinstances.
Changes walkthrough
| Relevant files | |||
|---|---|---|---|
| Enhancement |
| ||
| Tests |
|
✨ PR-Agent usage: Comment
/helpon the PR to get a list of all available PR-Agent tools and their descriptions
PR Description updated to latest commit (https://github.com/SeleniumHQ/selenium/commit/bf2b1659b6e9c054fb6ba44484ecb738a76e40b1)
- [ ] Copy walkthrough table to "Files Changed" Tab
PR Review
| ⏱️ Estimated effort to review [1-5] |
3, because the changes involve refactoring critical routing logic which requires careful review to ensure that the new flattened structure of routes does not introduce any regressions or change the expected behavior of the routing system. |
| 🧪 Relevant tests |
Yes |
| 🔍 Possible issues |
Possible Bug: The refactoring changes how |
| 🔒 Security concerns |
No |
✨ Review tool usage guide:
Overview:
The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.
The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
- When commenting, to edit configurations related to the review tool (
pr_reviewersection), use the following template:
/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
- With a configuration file, use the following template:
[pr_reviewer]
some_config1=...
some_config2=...
See the review usage page for a comprehensive guide on using this tool.
PR Code Suggestions
| Category | Suggestions | |||
| Bug |
Replace immutable list creation with a modifiable list to prevent runtime exceptions.Replace java/src/org/openqa/selenium/remote/http/Route.java [296]
| |||
| Enhancement |
Use a specific collection type when collecting streams to ensure mutability.Consider using java/src/org/openqa/selenium/remote/http/Route.java [338]
| |||
| Performance |
Simplify stream handling by reducing unnecessary list creation.Avoid unnecessary creation of java/src/org/openqa/selenium/remote/http/Route.java [330-334]
| Optimize list creation and reversal with a more efficient approach.Use java/src/org/openqa/selenium/remote/http/Route.java [339-340]
Maintainability |
| Streamline the test case to focus on the essential functionality.Simplify the test case by removing redundant route definitions that do not contribute to java/test/org/openqa/selenium/remote/http/RouteTest.java [154-159]
|
✨ Improve tool usage guide:
Overview:
The improve tool scans the PR code changes, and automatically generates suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.
- When commenting, to edit configurations related to the improve tool (
pr_code_suggestionssection), use the following template:
/improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...
- With a configuration file, use the following template:
[pr_code_suggestions]
some_config1=...
some_config2=...
See the improve usage page for a comprehensive guide on using this tool.
CI Failure Feedback
(Checks updated until commit https://github.com/SeleniumHQ/selenium/commit/11a809308725c35c5d79df16d7a52cded06b9ade)
|
Action: Ruby / Local Tests (safari, macos) / Local Tests (safari, macos) |
|
Failed stage: Run Bazel [❌] |
|
Failed test name: Selenium::WebDriver::Window can minimize the window |
|
Failure summary: The action failed due to a failing test in the Selenium WebDriver integration suite for Safari. |
Relevant error logs:
|
✨ CI feedback usage guide:
The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
The tool analyzes the failed checks and provides several feedbacks:
- Failed stage
- Failed test name
- Failure summary
- Relevant error logs
In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:
/checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.
Configuration options
enable_auto_checks_feedback- if set to true, the tool will automatically provide feedback when a check is failed. Default is true.excluded_checks_list- a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.enable_help_text- if set to true, the tool will provide a help message with the feedback. Default is true.persistent_comment- if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.final_update_message- ifpersistent_commentis true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.
See more information about the checks tool in the docs.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 58.72%. Comparing base (
ec54309) to head (11a8093). Report is 54 commits behind head on trunk.
:exclamation: Current head 11a8093 differs from pull request most recent head f9c040d. Consider uploading reports for the commit f9c040d to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## trunk #13856 +/- ##
=======================================
Coverage 58.72% 58.72%
=======================================
Files 86 86
Lines 5298 5298
Branches 226 226
=======================================
Hits 3111 3111
Misses 1961 1961
Partials 226 226
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.