Skip to content

Conversation

@aguspe
Copy link
Contributor

@aguspe aguspe commented Dec 19, 2025

User description

🔗 Related Issues

This continues the work started here: #10943

💥 What does this PR do?

This PR fixes all Steep by updating RBS signature files

Screenshot 2025-12-19 at 02 34 43

Key changes:

  • Fixed RBS signature files to match actual Ruby implementation
  • Configured Steepfile to suppress unavoidable empty collection warnings

🔧 Implementation Notes

All fixes were made at the RBS level without modifying any Ruby source code.

💡 Additional Considerations

  • The Rake task is configured with severity_level: error to only fail on errors, not warnings
  • BiDi directory remains ignored pending implementation decisions
  • 64 files still ignored due to legitimate complex type issues that would require Ruby code changes

Future work could include:

  • Gradually reducing the remaining 64 ignored files
  • Adding type annotations in Ruby code to eliminate suppressed warnings
  • Creating RBS signatures for BiDi implementation when stabilized

🔄 Types of changes

  • Cleanup (formatting, renaming)
  • Bug fix (backwards compatible)

PR Type

Bug fix, Enhancement


Description

  • Updated Steep type checker to v1.10.0 and fixed RBS signature files

  • Reduced type checking errors from 66 to 64 by improving type annotations

  • Added missing RBS signatures for BiDi, DevTools, and other modules

  • Configured Steep Rake task to report only errors, suppressing warnings

  • Updated Ruby version to 3.2.8 and refreshed gem dependencies


Diagram Walkthrough

flowchart LR
  A["Steep v1.5.0"] -- "upgrade to" --> B["Steep v1.10.0"]
  C["RBS Signatures"] -- "improve types" --> D["64 errors remaining"]
  E["BiDi/DevTools"] -- "add signatures" --> F["Better type coverage"]
  G["Rake Task"] -- "configure" --> H["Error-only reporting"]
  B --> I["Type Checking Pass"]
  D --> I
  F --> I
  H --> I
Loading

File Walkthrough

Relevant files
Configuration changes
2 files
.ruby-version
Update Ruby version to 3.2.8                                                         
+1/-0     
Steepfile
Add Steep configuration template file                                       
+29/-0   
Dependencies
3 files
MODULE.bazel
Update gem checksums for dependencies                                       
+5/-5     
Gemfile
Upgrade Steep from 1.5.0 to 1.10.0                                             
+1/-1     
rbs_collection.lock.yaml
Update RBS collection with new gem signatures                       
+48/-0   
Enhancement
9 files
Rakefile
Add Steep Rake task with error-level severity                       
+5/-0     
zip.rbs
Add RBS signatures for rubyzip gem                                             
+16/-0   
browser.rbs
Define Window class with proper attributes                             
+14/-1   
has_fedcm_dialog.rbs
Add new FedCM dialog driver extension signatures                 
+19/-0   
error.rbs
Add NoSuchTargetError exception class                                       
+3/-0     
print_options.rbs
Add new PrintOptions class RBS signatures                               
+45/-0   
zipper.rbs
Add RUBYZIP_V3 constant definition                                             
+2/-0     
service.rbs
Add initialize method signature for Firefox Service           
+2/-0     
common.rbs
Add BINARY_ENCODINGS constant and encoding methods             
+6/-0     
Bug fix
20 files
Steepfile
Reorganize ignored files and reduce error count                   
+15/-10 
browsing_context.rbs
Fix method signatures with keyword arguments                         
+4/-4     
network.rbs
Add pattern_type parameter and fix return type                     
+2/-2     
intercepted_request.rbs
Use union types for nullable attributes                                   
+6/-6     
intercepted_response.rbs
Use union types for nullable reason attribute                       
+2/-2     
options.rbs
Specify concrete types for instance variables                       
+6/-6     
profile.rbs
Improve type specificity for prefs methods                             
+3/-3     
has_devtools.rbs
Add target_type parameter and specify return type               
+2/-2     
has_log_events.rbs
Add missing _Driver include for module                                     
+1/-0     
has_network_interception.rbs
Add missing _Driver include for module                                     
+1/-0     
file_reaper.rbs
Improve type annotations for class variables                         
+5/-5     
local_driver.rbs
Fix initialize_local_driver signature with block                 
+1/-1     
manager.rbs
Improve type signatures for private methods                           
+2/-2     
network.rbs
Add delegated methods and fix callback types                         
+15/-8   
websocket_connection.rbs
Fix initialize signature and add_callback return type       
+2/-2     
devtools.rbs
Add target_type parameter to initialization                           
+2/-2     
driver.rbs
Specify concrete type for EXTENSIONS constant                       
+1/-1     
bidi_bridge.rbs
Add Bridge parent class inheritance                                           
+1/-1     
bridge.rbs
Fix bidi method return type to BiDi class                               
+1/-1     
capabilities.rbs
Specify concrete types for timeouts methods                           
+2/-2     
Additional files
1 files
script.rbs [link]   

@selenium-ci selenium-ci added C-rb Ruby Bindings B-build Includes scripting, bazel and CI integrations B-devtools Includes everything BiDi or Chrome DevTools related labels Dec 19, 2025
@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Dec 19, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🟢
🎫 #10943
🟢 Add RBS type signature files for Ruby Selenium to improve IDE type hints and developer
experience, despite heavy meta-programming.
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Dec 19, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Fix return type mismatch

Correct the return type of self.tmp_files to (Hash[Integer, Array[String]] |
nil) to match the type of the @tmp_files instance variable.

rb/sig/lib/selenium/webdriver/common/file_reaper.rbs [12]

-def self.tmp_files: () -> Array[String]
+def self.tmp_files: () -> (Hash[Integer, Array[String]] | nil)
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies a type mismatch between the @tmp_files instance variable and the self.tmp_files method's return type, proposing a fix that improves type safety.

Low
  • Update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-build Includes scripting, bazel and CI integrations B-devtools Includes everything BiDi or Chrome DevTools related C-rb Ruby Bindings Review effort 3/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants