Skip to content
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

[build] Prepare for release of Selenium 4.22.0 #69

Merged
merged 6 commits into from
Jun 18, 2024

Conversation

titusfortner
Copy link
Owner

@titusfortner titusfortner commented Jun 18, 2024

User description

Warning: Manually update the changelogs before merging

This PR:

  • Updates Rust version for Selenium Manager release
  • Updates Pinned browser version to coincide with new CDP release
  • Adds support for new CDP version and removes old CDP version
  • Selenium Manager references the new Selenium Manager release
  • Updates Maven Dependencies
  • Adds new authors to authors file
  • Updates all versions for all bindings
  • Generates rough change logs for each bindings (please tidy them up before merging this)

PR Type

Enhancement, Dependencies, Documentation


Description

  • Updated DevTools package references and class names from v123 to v126 across multiple files in Java and .NET.
  • Updated Maven dependencies to newer versions.
  • Updated browser versions and Selenium Manager references.
  • Added new authors to the AUTHORS file.
  • Updated version numbers for all bindings to 4.22.0.
  • Generated rough change logs for each binding.

Changes walkthrough 📝

Relevant files
Enhancement
12 files
v126Target.java
Update DevTools Target to Version 126                                       

java/src/org/openqa/selenium/devtools/v126/v126Target.java

  • Updated package references from v123 to v126
  • Renamed class from v123Target to v126Target
  • Updated import statements to use v126 package
  • +12/-12 
    v126Network.java
    Update DevTools Network to Version 126                                     

    java/src/org/openqa/selenium/devtools/v126/v126Network.java

  • Updated package references from v123 to v126
  • Renamed class from v123Network to v126Network
  • Updated import statements to use v126 package
  • +10/-10 
    v126Events.java
    Update DevTools Events to Version 126                                       

    java/src/org/openqa/selenium/devtools/v126/v126Events.java

  • Updated package references from v123 to v126
  • Renamed class from v123Events to v126Events
  • Updated import statements to use v126 package
  • +9/-9     
    v126Domains.java
    Update DevTools Domains to Version 126                                     

    java/src/org/openqa/selenium/devtools/v126/v126Domains.java

  • Updated package references from v123 to v126
  • Renamed class from v123Domains to v126Domains
  • Updated import statements to use v126 package
  • +13/-13 
    v126Javascript.java
    Update DevTools Javascript to Version 126                               

    java/src/org/openqa/selenium/devtools/v126/v126Javascript.java

  • Updated package references from v123 to v126
  • Renamed class from v123Javascript to v126Javascript
  • Updated import statements to use v126 package
  • +7/-7     
    v126Log.java
    Update DevTools Log to Version 126                                             

    java/src/org/openqa/selenium/devtools/v126/v126Log.java

  • Updated package references from v123 to v126
  • Renamed class from v123Log to v126Log
  • Updated import statements to use v126 package
  • +5/-5     
    v126CdpInfo.java
    Update DevTools CDP Info to Version 126                                   

    java/src/org/openqa/selenium/devtools/v126/v126CdpInfo.java

  • Updated package references from v123 to v126
  • Renamed class from v123CdpInfo to v126CdpInfo
  • Updated import statements to use v126 package
  • +4/-4     
    V126Domains.cs
    Update .NET DevTools Domains to Version 126                           

    dotnet/src/webdriver/DevTools/v126/V126Domains.cs

  • Updated namespace from V123 to V126
  • Renamed class from V123Domains to V126Domains
  • Updated DevTools version to 126
  • +11/-11 
    V126Network.cs
    Update .NET DevTools Network to Version 126                           

    dotnet/src/webdriver/DevTools/v126/V126Network.cs

  • Updated namespace from V123 to V126
  • Renamed class from V123Network to V126Network
  • Updated DevTools version to 126
  • +12/-12 
    V126JavaScript.cs
    Update .NET DevTools JavaScript to Version 126                     

    dotnet/src/webdriver/DevTools/v126/V126JavaScript.cs

  • Updated namespace from V123 to V126
  • Renamed class from V123JavaScript to V126JavaScript
  • Updated DevTools version to 126
  • +8/-8     
    V126Target.cs
    Update .NET DevTools Target to Version 126                             

    dotnet/src/webdriver/DevTools/v126/V126Target.cs

  • Updated namespace from V123 to V126
  • Renamed class from V123Target to V126Target
  • Updated DevTools version to 126
  • +7/-7     
    V126Log.cs
    Update .NET DevTools Log to Version 126                                   

    dotnet/src/webdriver/DevTools/v126/V126Log.cs

  • Updated namespace from V123 to V126
  • Renamed class from V123Log to V126Log
  • Updated DevTools version to 126
  • +7/-7     
    Tests
    3 files
    DevToolsTargetTest.cs
    Update DevTools Target Tests to Version 126                           

    dotnet/test/common/DevTools/DevToolsTargetTest.cs

  • Updated CurrentCdpVersion to V126
  • Updated test configurations to use CDP version 126
  • +3/-3     
    DevToolsConsoleTest.cs
    Update DevTools Console Tests to Version 126                         

    dotnet/test/common/DevTools/DevToolsConsoleTest.cs

  • Updated CurrentCdpVersion to V126
  • Updated test configurations to use CDP version 126
  • +2/-2     
    DevToolsNetworkTest.cs
    Update DevTools Network Tests to Version 126                         

    dotnet/test/common/DevTools/DevToolsNetworkTest.cs

  • Updated CurrentCdpVersion to V126
  • Updated test configurations to use CDP version 126
  • +2/-2     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @titusfortner titusfortner marked this pull request as ready for review June 18, 2024 17:56
    @titusfortner titusfortner merged commit 2f24d57 into temp_trunk Jun 18, 2024
    @codiumai-pr-agent-free codiumai-pr-agent-free bot added enhancement dependencies Pull requests that update a dependency file documentation labels Jun 18, 2024
    Copy link

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review [1-5] 4
    🧪 Relevant tests No
    🔒 Security concerns No
    ⚡ Key issues to review Possible Bug:
    Ensure that the changes in package versions and dependencies do not introduce any compatibility issues with existing code.
    Performance Concern:
    Verify that the updates to major components such as Netty, OpenTelemetry, and other libraries do not degrade performance.
    Dependency Management:
    Check if the updated versions of dependencies in MODULE.bazel and other build files are correctly reflected across all project modules to maintain consistency.

    Copy link

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Add null checks to the constructor parameters

    Add null checks for the parameters in the v126Network constructor to prevent potential
    null pointer exceptions.

    java/src/org/openqa/selenium/devtools/v126/v126Network.java [44-45]

     public v126Network(DevTools devTools) {
    +  if (devTools == null) {
    +    throw new IllegalArgumentException("devTools cannot be null");
    +  }
       super(devTools);
     }
     
    Suggestion importance[1-10]: 9

    Why: Adding null checks in the constructor is a good practice to prevent potential null pointer exceptions, which can improve the robustness of the code.

    9
    Standardize the naming convention for archive names to enhance code clarity

    Use a consistent naming convention for all archive names to improve readability and
    maintainability of the code.

    common/repositories.bzl [52]

    -name = "linux_beta_firefox"
    +name = "firefox_linux_beta"
     
    Suggestion importance[1-10]: 6

    Why: Using a consistent naming convention improves readability and maintainability. This is a good practice but is a minor improvement.

    6
    Initialize class fields directly to ensure they are never unassigned

    Consider initializing the fetch and network fields directly in their declaration to ensure
    they are never unintentionally left unassigned.

    dotnet/src/webdriver/DevTools/v126/V126Network.cs [33-34]

    -private FetchAdapter fetch;
    -private NetworkAdapter network;
    +private FetchAdapter fetch = new FetchAdapter();
    +private NetworkAdapter network = new NetworkAdapter();
     
    Suggestion importance[1-10]: 4

    Why: While initializing fields directly can prevent them from being unintentionally left unassigned, in this context, the fields are assigned in the constructor, making this suggestion more of a style preference than a necessity. It does not address a major bug or issue.

    4
    Security
    Verify and update the sha256 values to match the new binaries for security

    Ensure that the sha256 values are updated correctly to match the new binaries to prevent
    potential security risks from tampered files.

    common/repositories.bzl [54]

    -sha256 = "1cbcc0b831db1b28cc27122de8925ccc776c11a351e211b8c9361c7392de222b"
    +sha256 = "<new_correct_sha256_value>"
     
    Suggestion importance[1-10]: 9

    Why: Ensuring that the sha256 values are correct is crucial for security to prevent tampered files from being used. This suggestion addresses a significant security concern.

    9
    Enhance security and stability by sanitizing and handling exceptions in conditional breakpoints

    The setBreakpoint command includes an optional condition string for conditional
    breakpoints. Ensure that the condition handling is robust against injection or runtime
    errors, possibly by sanitizing the input or handling exceptions gracefully.

    common/devtools/chromium/v126/js_protocol.pdl [391-397]

     command setBreakpoint
       parameters
         Location location
         optional string condition
    +      # Add input sanitization and error handling here
     
    Suggestion importance[1-10]: 9

    Why: This suggestion addresses a significant security concern by recommending input sanitization and error handling, which is crucial for preventing injection attacks and ensuring stability.

    9
    Maintainability
    Use a variable for version numbers in URLs to simplify updates and prevent inconsistencies

    Consider using a variable for the version number in URLs to ensure consistency and ease
    future updates. This approach minimizes the risk of errors during updates and improves
    maintainability.

    common/repositories.bzl [53]

    -url = "https://ftp.mozilla.org/pub/firefox/releases/128.0b4/linux-x86_64/en-US/firefox-128.0b4.tar.bz2"
    +firefox_version = "128.0b4"
    +url = f"https://ftp.mozilla.org/pub/firefox/releases/{firefox_version}/linux-x86_64/en-US/firefox-{firefox_version}.tar.bz2"
     
    Suggestion importance[1-10]: 8

    Why: This suggestion improves maintainability by reducing the risk of errors during updates and ensuring consistency. It is a good practice for managing version numbers in URLs.

    8
    Remove or replace deprecated code to ensure compatibility with future versions

    Consider removing the deprecated Console domain or updating its usage to the recommended
    alternatives (Runtime or Log). Deprecated code can lead to maintenance issues and lack of
    support in future versions.

    common/devtools/chromium/v126/js_protocol.pdl [9-11]

    -deprecated domain Console
    -  depends on Runtime
    +# Consider using Runtime or Log domains as recommended.
     
    Suggestion importance[1-10]: 8

    Why: Addressing deprecated code is crucial for maintainability and future compatibility. This suggestion correctly identifies a potential issue and provides a reasonable solution.

    8
    Enhancement
    Implement error handling for the enable and disable commands to improve robustness

    The enable and disable commands for the Debugger domain do not specify behavior in case of
    failure. It's recommended to handle potential errors or exceptions that might occur during
    the enabling or disabling process.

    common/devtools/chromium/v126/js_protocol.pdl [178-182]

     command enable
    +  parameters
    +    # Parameters here
    +  returns
    +    # Handle success or failure cases
    +    enum status
    +      Ok
    +      Error
     command disable
    +  parameters
    +    # Parameters here
    +  returns
    +    # Handle success or failure cases
    +    enum status
    +      Ok
    +      Error
     
    Suggestion importance[1-10]: 8

    Why: Implementing error handling for these commands would improve the robustness of the code. The suggestion is practical and enhances the reliability of the debugger commands.

    8
    Reliability
    Add fallback URLs or retry mechanisms for downloading dependencies to enhance build reliability

    Consider adding a fallback URL or a retry mechanism for critical dependencies to improve
    the robustness of the build process in case the primary URL is unavailable.

    common/repositories.bzl [75]

    -url = "https://ftp.mozilla.org/pub/firefox/releases/128.0b4/mac/en-US/Firefox%20128.0b4.dmg"
    +urls = [
    +    "https://ftp.mozilla.org/pub/firefox/releases/128.0b4/mac/en-US/Firefox%20128.0b4.dmg",
    +    "https://mirror.example.com/firefox/releases/128.0b4/mac/en-US/Firefox%20128.0b4.dmg"
    +]
     
    Suggestion importance[1-10]: 7

    Why: Adding fallback URLs or retry mechanisms can improve the robustness of the build process. This is a useful enhancement for reliability, though not critical.

    7
    Possible issue
    Handle or avoid using experimental features in critical implementations

    The experimental label for ScriptPosition and LocationRange types suggests they are not
    stable. If these types are crucial for the current implementation, consider waiting until
    they are stable or ensure there is a fallback mechanism.

    common/devtools/chromium/v126/js_protocol.pdl [83-86]

    -experimental type ScriptPosition extends object
    -  properties
    -    integer lineNumber
    -    integer columnNumber
    +# Ensure to handle potential changes in experimental features.
     
    Suggestion importance[1-10]: 7

    Why: The suggestion correctly identifies the potential instability of experimental features and advises caution. However, it does not provide a concrete solution, which slightly reduces its impact.

    7

    @titusfortner titusfortner deleted the release-preparation-4.22.0 branch June 18, 2024 18:23
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants