SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.42k stars 8.15k forks source link

[dotnet][rb][java][js][py] Automated Browser Version Update #14338

Closed selenium-ci closed 2 months ago

selenium-ci commented 2 months ago

User description

This is an automated pull request to update pinned browsers and drivers

Merge after verify the new browser versions properly passing the tests and no bugs need to be filed


PR Type

Enhancement


Description


Changes walkthrough ๐Ÿ“

Relevant files
Enhancement
repositories.bzl
Update pinned browser versions and drivers                             

common/repositories.bzl
  • Updated the URL and SHA256 for mac_edge package.
  • Removed the linux_edge package.
  • Updated the URL and SHA256 for linux_edgedriver package.
  • Updated the URL and SHA256 for mac_edgedriver package.
  • +7/-29   

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

    codiumai-pr-agent-pro[bot] commented 2 months ago

    PR Reviewer Guide ๐Ÿ”

    โฑ๏ธ Estimated effort to review: 2 ๐Ÿ”ต๐Ÿ”ตโšชโšชโšช
    ๐Ÿงช No relevant tests
    ๐Ÿ”’ No security concerns identified
    โšก No key issues to review
    codiumai-pr-agent-pro[bot] commented 2 months ago

    PR Code Suggestions โœจ

    CategorySuggestion                                                                                                                                    Score
    Maintainability
    Use variables for version numbers to simplify updates and maintain consistency ___ **Consider using a variable for the version number in URLs and file paths to simplify
    future updates and ensure consistency across multiple entries.** [common/repositories.bzl [126-163]](https://github.com/SeleniumHQ/selenium/pull/14338/files#diff-25d82cd18102fed27d3202000e1f1b3a56a85ad2848236d91989cd30a3952401R126-R163) ```diff -url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/dd910ebc-f59d-4ea2-b18b-81a8a163e54f/MicrosoftEdge-127.0.2651.86.pkg" -"MicrosoftEdge-127.0.2651.86.pkg/Payload/Microsoft Edge.app": "Edge.app" -url = "https://msedgedriver.azureedge.net/129.0.2751.0/edgedriver_linux64.zip" -url = "https://msedgedriver.azureedge.net/129.0.2751.0/edgedriver_mac64.zip" +edge_version = "127.0.2651.86" +edge_driver_version = "129.0.2751.0" +url = f"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/dd910ebc-f59d-4ea2-b18b-81a8a163e54f/MicrosoftEdge-{edge_version}.pkg" +f"MicrosoftEdge-{edge_version}.pkg/Payload/Microsoft Edge.app": "Edge.app" +url = f"https://msedgedriver.azureedge.net/{edge_driver_version}/edgedriver_linux64.zip" +url = f"https://msedgedriver.azureedge.net/{edge_driver_version}/edgedriver_mac64.zip" ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 9 Why: This suggestion improves maintainability by centralizing version numbers, making future updates easier and reducing the risk of inconsistencies.
    9
    Refactor repeated build_file_content into a shared variable for better maintainability ___ **To improve the readability and maintainability of the code, consider refactoring the
    repeated build_file_content blocks into a shared variable or function.** [common/repositories.bzl [131-165]](https://github.com/SeleniumHQ/selenium/pull/14338/files#diff-25d82cd18102fed27d3202000e1f1b3a56a85ad2848236d91989cd30a3952401R131-R165) ```diff -build_file_content = """ +common_build_content = """ load("@aspect_rules_js//js:defs.bzl", "js_library") """ +build_file_content = common_build_content ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 6 Why: This refactoring improves code maintainability by reducing redundancy, but the improvement is relatively minor compared to other suggestions.
    6
    Security
    Verify sha256 hashes against a secure source to ensure integrity ___ **Ensure that the sha256 hashes are verified against a secure source to prevent
    potential security risks from tampered binaries.** [common/repositories.bzl [127-164]](https://github.com/SeleniumHQ/selenium/pull/14338/files#diff-25d82cd18102fed27d3202000e1f1b3a56a85ad2848236d91989cd30a3952401R127-R164) ```diff +# Ensure to verify these sha256 values against a secure source or documentation sha256 = "67893bc929315ae6798d93ccce5386c81e8f5b544b14ba31c8ddcaea401f2ced" sha256 = "acf5dfdc5be5ba1897b112d37caa8002063244a9fc42969b797dc28e49e0f158" sha256 = "57935d53ad4754d8eca6b86218c44cd367702c0e779087007d138eb3cae7c98e" ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 8 Why: Ensuring the integrity of downloaded files is crucial for security. Adding a comment to verify `sha256` hashes is a good practice, though it doesn't enforce the verification.
    8
    Reliability
    Implement a retry mechanism for dependency downloads to handle network issues ___ **Consider adding a fallback mechanism or retry strategy for downloading dependencies
    to handle possible network failures or server unavailability.** [common/repositories.bzl [126-163]](https://github.com/SeleniumHQ/selenium/pull/14338/files#diff-25d82cd18102fed27d3202000e1f1b3a56a85ad2848236d91989cd30a3952401R126-R163) ```diff -url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/dd910ebc-f59d-4ea2-b18b-81a8a163e54f/MicrosoftEdge-127.0.2651.86.pkg" -url = "https://msedgedriver.azureedge.net/129.0.2751.0/edgedriver_linux64.zip" -url = "https://msedgedriver.azureedge.net/129.0.2751.0/edgedriver_mac64.zip" +# Example of adding a simple retry mechanism +def download_with_retry(url, max_attempts=3): + attempt = 0 + while attempt < max_attempts: + try: + # Download logic here + break + except NetworkError: + attempt += 1 + if attempt == max_attempts: + raise +download_with_retry("https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/dd910ebc-f59d-4ea2-b18b-81a8a163e54f/MicrosoftEdge-127.0.2651.86.pkg") +download_with_retry("https://msedgedriver.azureedge.net/129.0.2751.0/edgedriver_linux64.zip") +download_with_retry("https://msedgedriver.azureedge.net/129.0.2751.0/edgedriver_mac64.zip") ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 7 Why: Adding a retry mechanism can improve reliability by handling transient network issues, but the suggestion is somewhat generic and would need to be tailored to the specific context.
    7
    codiumai-pr-agent-pro[bot] commented 2 months ago

    CI Failure Feedback ๐Ÿง

    (Checks updated until commit https://github.com/SeleniumHQ/selenium/commit/416609feb09b27858a3b05220f73aea49520bcec)

    **Action:** Ruby / Local Tests (firefox, macos) / Local Tests (firefox, macos)
    **Failed stage:** [Run Bazel](https://github.com/SeleniumHQ/selenium/actions/runs/10223774056/job/28290743345) [โŒ]
    **Failure summary:** The action failed due to the following reasons:
  • Analysis of target //rb/spec/integration/selenium/webdriver:target_locator-firefox failed because
    the module extension pin_browsers_extension from //common:repositories.bzl does not generate the
    repository linux_edge, yet it is imported as linux_edge in the usage at
    /Users/runner/work/selenium/selenium/MODULE.bazel:348:39.
  • No test targets were found, yet testing was requested.
  • Relevant error logs: ```yaml 1: ##[group]Operating System 2: macOS ... 584: Analyzing: 28 targets (134 packages loaded, 19 targets configured) 585: [1 / 1] checking cached actions 586: Analyzing: 28 targets (171 packages loaded, 19 targets configured) 587: [1 / 1] checking cached actions 588: Analyzing: 28 targets (193 packages loaded, 1470 targets configured) 589: [1 / 1] checking cached actions 590: Analyzing: 28 targets (194 packages loaded, 1512 targets configured) 591: [1 / 1] checking cached actions 592: ERROR: Analysis of target '//rb/spec/integration/selenium/webdriver:target_locator-firefox' failed; build aborted: module extension "pin_browsers_extension" from "//common:repositories.bzl" does not generate repository "linux_edge", yet it is imported as "linux_edge" in the usage at /Users/runner/work/selenium/selenium/MODULE.bazel:348:39 593: INFO: Elapsed time: 19.342s, Critical Path: 0.12s 594: INFO: 1 process: 1 internal. 595: ERROR: Build did NOT complete successfully 596: FAILED: 597: ERROR: No test targets were found, yet testing was requested 598:  599: ##[error]Process completed with exit code 1. ```

    โœจ 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` - if `persistent_comment` is 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](https://pr-agent-docs.codium.ai/tools/ci_feedback/).