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 #72

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 classes and tests to support Chrome DevTools Protocol (CDP) version 126.
  • Updated Maven dependencies to latest versions.
  • Updated Selenium Manager references to the new release.
  • Added new authors to the authors file.
  • Updated version numbers for all bindings and generated rough change logs.

Changes walkthrough 📝

Relevant files
Enhancement
12 files
v126Target.java
Update DevTools Target class 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 class 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 class 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 class 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 class 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 class 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 CdpInfo class 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 DevTools Domains class to version 126 in C#             

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

  • Updated namespace references from V123 to V126.
  • Renamed class from V123Domains to V126Domains.
  • +11/-11 
    V126Network.cs
    Update DevTools Network class to version 126 in C#             

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

  • Updated namespace references from V123 to V126.
  • Renamed class from V123Network to V126Network.
  • +12/-12 
    V126JavaScript.cs
    Update DevTools JavaScript class to version 126 in C#       

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

  • Updated namespace references from V123 to V126.
  • Renamed class from V123JavaScript to V126JavaScript.
  • +8/-8     
    V126Target.cs
    Update DevTools Target class to version 126 in C#               

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

  • Updated namespace references from V123 to V126.
  • Renamed class from V123Target to V126Target.
  • +7/-7     
    V126Log.cs
    Update DevTools Log class to version 126 in C#                     

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

  • Updated namespace references from V123 to V126.
  • Renamed class from V123Log to V126Log.
  • +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 metadata to reflect 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 metadata to reflect 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 metadata to reflect 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 19:58
    @titusfortner titusfortner merged commit 3043b0f 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:
    The PR introduces a large number of updates across multiple files and languages, which might lead to integration issues or conflicts. It is crucial to ensure that all dependencies and internal APIs are compatible with these changes.
    Performance Concerns:
    The updates to libraries and dependencies need to be tested for performance impacts, especially in environments with high loads.
    Deprecated Features:
    The PR removes and updates several deprecated features. It's important to ensure that these changes do not affect existing functionalities that might rely on older versions.

    Copy link

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Security
    Verify and update the SHA256 checksums to ensure they match the new binaries

    Ensure that the SHA256 checksums are updated correctly to match the new binaries. This is
    crucial for security and integrity verification of the downloaded files.

    common/repositories.bzl [54]

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

    Why: Verifying and updating SHA256 checksums is crucial for security and integrity. This suggestion addresses a significant security concern.

    10
    Possible bug
    Ensure complete initialization of objects before use

    Ensure that the AuthChallengeResponse object is fully initialized before use in the
    ContinueWithAuth method to prevent runtime errors.

    dotnet/src/webdriver/DevTools/v126/V126Network.cs [219]

     AuthChallengeResponse = new V126.Fetch.AuthChallengeResponse()
    +{
    +    Response = V126.Fetch.AuthChallengeResponseResponseValues.ProvideCredentials,
    +    Username = userName,
    +    Password = password
    +}
     
    Suggestion importance[1-10]: 9

    Why: This suggestion addresses a potential runtime error by ensuring that the AuthChallengeResponse object is fully initialized before use, which is crucial for preventing bugs.

    9
    Maintainability
    Use a variable for version numbers in URLs to simplify updates and reduce errors

    Consider using a variable for the version number in URLs to ensure consistency and ease
    future updates. This approach reduces the risk of errors when updating version numbers
    across multiple URLs.

    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: Using a variable for version numbers improves maintainability and reduces the risk of errors when updating multiple URLs. This is a good practice for consistency and ease of future updates.

    8
    Improve property names for clarity and context understanding

    It's recommended to use more descriptive property names than url and scriptId to avoid
    ambiguity, especially in large schemas where these might be used in different contexts.

    common/devtools/chromium/v126/js_protocol.pdl [107-108]

    -Runtime.ScriptId scriptId
    -deprecated string url
    +Runtime.ScriptId scriptSourceId
    +deprecated string resourceUrl
     
    Suggestion importance[1-10]: 6

    Why: More descriptive property names can improve clarity and maintainability, but the existing names are not incorrect and the improvement is minor.

    6
    Simplify the constructor by initializing fields directly in their declaration

    Consider initializing the fetch and network fields directly in their declaration to
    simplify the constructor of V126Network.

    dotnet/src/webdriver/DevTools/v126/V126Network.cs [41-44]

    -public V126Network(NetworkAdapter network, FetchAdapter fetch)
    +private FetchAdapter fetch;
    +private NetworkAdapter network;
    +
    +public V126Network(NetworkAdapter network, FetchAdapter fetch) : this()
     {
         this.network = network;
         this.fetch = fetch;
     }
     
    Suggestion importance[1-10]: 5

    Why: While this suggestion can improve readability and maintainability, it does not address a critical issue or bug. The current constructor is already straightforward.

    5
    Group related properties or use comments for better readability

    To enhance code readability and maintainability, consider grouping related properties
    under a nested object or using comments to separate sections within the Debugger domain.

    common/devtools/chromium/v126/js_protocol.pdl [67-73]

    +# Breakpoint related properties
     type BreakpointId extends string
     type CallFrameId extends string
    +# Location related properties
     type Location extends object
     
    Suggestion importance[1-10]: 5

    Why: Grouping related properties or using comments can improve readability, but it is a minor enhancement and does not affect functionality.

    5
    Best practice
    Add null checks to constructor parameters to prevent errors

    Consider using null checks for the parameters in the constructor to prevent potential null
    reference exceptions.

    dotnet/src/webdriver/DevTools/v126/V126Network.cs [41-44]

     public V126Network(NetworkAdapter network, FetchAdapter fetch)
     {
    -    this.network = network;
    -    this.fetch = fetch;
    +    this.network = network ?? throw new ArgumentNullException(nameof(network));
    +    this.fetch = fetch ?? throw new ArgumentNullException(nameof(fetch));
     }
     
    Suggestion importance[1-10]: 8

    Why: Adding null checks is a best practice that can prevent potential null reference exceptions, enhancing the robustness of the code.

    8
    Possible issue
    Add validation or default value to optional parameters to prevent errors

    For the setBreakpoint command, consider adding a validation or a default value for the
    condition parameter to handle cases where it might be undefined or null, which could lead
    to runtime errors.

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

    -optional string condition
    +optional string condition = ""
     
    Suggestion importance[1-10]: 8

    Why: Adding a default value for the condition parameter can prevent potential runtime errors, making this a valuable improvement for robustness.

    8
    Enhancement
    Add a default value to the optional field to ensure predictability

    Consider adding a default value for the columnNumber in the Location type definition. This
    can help ensure that the field has a predictable value when not explicitly provided,
    improving the robustness of the code.

    common/devtools/chromium/v126/js_protocol.pdl [80]

    -optional integer columnNumber
    +optional integer columnNumber = 0
     
    Suggestion importance[1-10]: 7

    Why: Adding a default value to the columnNumber field can improve robustness by ensuring it always has a predictable value, but it is not critical for functionality.

    7
    Use expression-bodied members to simplify code

    Use expression-bodied members for simple methods or property getters to enhance
    readability.

    dotnet/src/webdriver/DevTools/v126/V126Network.cs [41-44]

    -public V126Network(NetworkAdapter network, FetchAdapter fetch)
    -{
    -    this.network = network;
    -    this.fetch = fetch;
    -}
    +public V126Network(NetworkAdapter network, FetchAdapter fetch) => (this.network, this.fetch) = (network, fetch);
     
    Suggestion importance[1-10]: 6

    Why: This suggestion improves code readability and conciseness, but it is not critical for functionality. It is a minor enhancement.

    6
    Reliability
    Add fallback URLs or a retry mechanism for downloading critical dependencies

    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 reliability of the build process. This is a useful enhancement but not critical.

    7
    Documentation
    Update the documentation to reflect new dependency versions and checksums

    Update the documentation related to dependency management to reflect the new versions and
    their respective checksums. This is important for maintainability and clarity for future
    reference.

    common/repositories.bzl [52-54]

    +# Updated Firefox version to 128.0b4
     name = "linux_beta_firefox",
     url = "https://ftp.mozilla.org/pub/firefox/releases/128.0b4/linux-x86_64/en-US/firefox-128.0b4.tar.bz2",
     sha256 = "1cbcc0b831db1b28cc27122de8925ccc776c11a351e211b8c9361c7392de222b"
     
    Suggestion importance[1-10]: 6

    Why: Updating documentation for new versions and checksums is good for maintainability and clarity. However, it is a minor improvement compared to code changes.

    6

    @titusfortner titusfortner deleted the release-preparation-4.22.0 branch June 18, 2024 20:08
    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