You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here are some key observations to aid the review process:
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review
Type Inconsistency The send_cmd method's method parameter type has been changed from untyped to String. Verify if this change is intentional and consistent with the method's implementation.
Incomplete Type Definitions The ConsoleLogEntry and JavaScriptLogEntry are defined as Struct without specifying their attributes. Consider adding more detailed type information for these structures.
Untyped Attribute The bidi attribute is defined as untyped. Consider specifying a more precise type for better type checking and documentation.
Align the type of the bidi instance variable with its usage in the create_session method
The create_session method returns a BiDi object, but the @bidi instance variable is typed as untyped. Consider updating the type of @bidi to BiDi for consistency and improved type safety.
Why: Updating the type of the @bidi instance variable to BiDi enhances type safety and consistency with the create_session method, making this a valuable improvement for maintaining type integrity.
6
Modify the return type of remove_message_handler to represent both success and failure outcomes
The remove_message_handler method is defined to return false, which might not accurately represent all possible outcomes. Consider changing it to return a boolean to indicate success or failure of the operation.
Why: The suggestion to change the return type of remove_message_handler to a boolean is reasonable, as it would allow the method to indicate both success and failure, improving the method's expressiveness and usability.
5
Adjust the return type and parameters of the remove_callback method for consistency
The remove_callback method is defined to return an Array[Integer], which seems inconsistent with add_callback. Consider changing it to return a boolean indicating success or failure, or a single Integer representing the removed callback ID.
Why: Changing the return type of remove_callback to a boolean or a single Integer could enhance consistency and clarity, but the suggestion lacks specific context on how the method is used, limiting its immediate applicability.
4
Specify a more precise return type for the add_callback method
Consider specifying the return type for the add_callback method. It's currently defined to return an Integer, but it might be more specific, such as a callback ID or a status code.
Why: The suggestion to specify a more precise return type for the add_callback method could improve code clarity and type safety, but without additional context on what CallbackId represents, the impact is limited.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Description
Continuing the goal of adding full type support stated on the feature #10943 this PR adds rbs files for newly created BiDi classes and update types
This PR reduces the errors from 87 to 73:
Motivation and Context
The goal is that the Ruby Binding has good type support coverage and that we can perform type validations on our CI/CD
Types of changes
Checklist
PR Type
enhancement, documentation
Description
LogHandlerclass to manage logging within the BiDi module.Structclass with a utility method for string conversion.BiDiBridgeclass for managing BiDi sessions.Bridgeclass with a newbidimethod.LocatorConverterclass for handling locator conversions.Changes walkthrough 📝
bidi.rbs
Add callback management and update command method signaturerb/sig/lib/selenium/webdriver/bidi.rbs
add_callbackandremove_callbackmethods.send_cmdmethod to accept aStringtype for themethodparameter.
log_handler.rbs
Introduce LogHandler class for BiDi loggingrb/sig/lib/selenium/webdriver/bidi/log_handler.rbs
LogHandlerclass withinBiDi.struct.rbs
Add Struct class with camel to snake conversionrb/sig/lib/selenium/webdriver/bidi/struct.rbs
Structclass with a method to convert camel case to snake case.bidi_bridge.rbs
Add BiDiBridge class for session managementrb/sig/lib/selenium/webdriver/remote/bidi_bridge.rbs
BiDiBridgeclass extendingBridge.bridge.rbs
Add bidi method to Bridge classrb/sig/lib/selenium/webdriver/remote/bridge.rbs
bidimethod returningWebDriverError.locator_converter.rbs
Add LocatorConverter class for locator conversionrb/sig/lib/selenium/webdriver/remote/bridge/locator_converter.rbs
LocatorConverterclass withinBridge.