Skip to content

Nightly and Stable for JS and DotNet #1682

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

Merged
merged 7 commits into from
Apr 22, 2024
Merged

Nightly and Stable for JS and DotNet #1682

merged 7 commits into from
Apr 22, 2024

Conversation

diemol
Copy link
Member

@diemol diemol commented Apr 22, 2024

User description

Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, and help reviewers by making them as simple and short as possible.

Description

Motivation and Context

Types of changes

  • Change to the site (I have double-checked the Netlify deployment, and my changes look good)
  • Code example added (and I also added the example to all translated languages)
  • Improved translation
  • Added new translation (and I also added a notice to each document missing translation)

Checklist

  • I have read the contributing document.
  • I have used hugo to render the site/docs locally and I am sure it works.

Type

enhancement, configuration changes


Description

  • Introduced matrix configurations in GitHub Actions workflows to handle both stable and nightly builds for .NET and JavaScript examples.
  • Configured conditional setups in GitHub Actions workflows to differentiate between stable and nightly builds, including specific setups for .NET and Node.js.
  • Added a new package.nightly.json for JavaScript to manage nightly dependencies separately.
  • Updated .NET csproj file to conditionally include different versions of Selenium dependencies based on the build type.

Changes walkthrough

Relevant files
Configuration changes
dotnet-examples.yml
Update .NET GitHub Actions Workflow for Nightly and Stable Builds

.github/workflows/dotnet-examples.yml

  • Added matrix release options for stable and nightly builds.
  • Conditional setup for .Net based on release type (stable or nightly).
  • Environment variable SE_RELEASE added to specify the release type
    during test execution.
  • +11/-2   
    js-examples.yml
    Update JavaScript GitHub Actions Workflow for Nightly and Stable
    Builds

    .github/workflows/js-examples.yml

  • Added matrix release options for stable and nightly builds.
  • Conditional setup for Node.js based on release type.
  • Use specific package.json for nightly builds depending on the OS.
  • Added environment variable NODE_AUTH_TOKEN during npm install.
  • +22/-0   
    SeleniumDocs.csproj
    Configure .NET Project for Nightly and Stable Dependency Management

    examples/dotnet/SeleniumDocs/SeleniumDocs.csproj

  • Added conditional ItemGroups to manage dependencies for nightly and
    stable releases.
  • +8/-0     
    package.nightly.json
    Add Nightly package.json for JavaScript Examples                 

    examples/javascript/package.nightly.json

  • Created a new package.json specifically for nightly builds with
    updated dependencies.
  • +16/-0   

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

    Copy link
    Contributor

    PR Description updated to latest commit (2b8535f)

    Copy link
    Contributor

    PR Review

    ⏱️ Estimated effort to review [1-5]

    3, because the PR involves multiple files and configurations, including GitHub Actions and project dependencies for different environments and release types. Understanding the matrix strategy and conditional setups requires careful attention to detail.

    🧪 Relevant tests

    No

    🔍 Possible issues

    Possible Bug: The use of different action versions for retry in the dotnet and js workflows (nick-invision/[email protected] vs nick-fields/[email protected]) might be a typo or error. This inconsistency should be clarified or corrected.

    Configuration Error: The NODE_AUTH_TOKEN is only set in the environment for the 'Install Requirements' step in the JS workflow. If this token is necessary for private or nightly packages, it should be included in all relevant steps or jobs that require authentication.

    🔒 Security concerns

    No


    ✨ Review tool usage guide:

    Overview:
    The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.

    The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.

    • When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:
    /review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
    
    [pr_reviewer]
    some_config1=...
    some_config2=...
    

    See the review usage page for a comprehensive guide on using this tool.

    Copy link

    netlify bot commented Apr 22, 2024

    Deploy Preview for selenium-dev ready!

    Name Link
    🔨 Latest commit 2b8535f
    🔍 Latest deploy log https://app.netlify.com/sites/selenium-dev/deploys/66261e8fdc2b220008d89815
    😎 Deploy Preview https://deploy-preview-1682--selenium-dev.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify site configuration.

    Copy link
    Contributor

    PR Code Suggestions

    CategorySuggestions                                                                                                                                                       
    Best practice
    Lock down the version of selenium-webdriver to a specific nightly build in the package.json.

    To ensure compatibility and prevent potential issues with package versions, it's
    recommended to lock down the version of selenium-webdriver to a specific nightly build
    rather than using a version range. This can help avoid unexpected behavior due to changes
    in new nightly builds.

    examples/javascript/package.nightly.json [11]

    -"selenium-webdriver": "npm:@seleniumhq/[email protected]"
    +"selenium-webdriver": "4.20.0-nightly202404220008"
     
    Enhancement
    Add a retry mechanism to the .Net Nightly setup step to enhance robustness.

    To enhance the robustness of the CI pipeline, consider adding a retry mechanism for the
    .Net Nightly setup step. This can help mitigate potential transient issues with network
    connectivity or remote server errors during the setup process.

    .github/workflows/dotnet-examples.yml [52-56]

     - name: Set up .Net Nightly
       if: matrix.release == 'nightly'
       uses: actions/setup-dotnet@v4
       with:
         dotnet-version: 6.x
    +  retry:
    +    max-attempts: 3
    +    delay-seconds: 10
     

    ✨ Improve tool usage guide:

    Overview:
    The improve tool scans the PR code changes, and automatically generates suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.

    • When commenting, to edit configurations related to the improve tool (pr_code_suggestions section), use the following template:
    /improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...
    
    [pr_code_suggestions]
    some_config1=...
    some_config2=...
    

    See the improve usage page for a comprehensive guide on using this tool.

    Copy link

    netlify bot commented Apr 22, 2024

    Deploy Preview for selenium-dev ready!

    Name Link
    🔨 Latest commit 8ad8fcf
    🔍 Latest deploy log https://app.netlify.com/sites/selenium-dev/deploys/66261e96cebea20008597966
    😎 Deploy Preview https://deploy-preview-1682--selenium-dev.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify site configuration.

    Copy link
    Contributor

    qodo-merge-pro bot commented Apr 22, 2024

    CI Failure Feedback

    (Checks updated until commit 8ad8fcf)

    Action: test_examples (macos-latest, stable)

    Failed stage: Run tests [❌]

    Failure summary:

    The action failed due to multiple compilation errors in the .NET project. Specifically, there were
    errors related to attempts to instantiate the static class DriverFinder in various test files.
    Static classes in C# cannot be instantiated, and any attempt to do so will result in a compilation
    error, which is what happened here across multiple test classes (FirefoxTest.cs, ChromeTest.cs,
    EdgeTest.cs, ServiceTest.cs).

    Relevant error logs:
    1:  ##[group]Operating System
    2:  macOS
    ...
    
    161:  timeout_minutes: 20
    162:  max_attempts: 3
    163:  command: cd examples/dotnet/SeleniumDocs
    164:  dotnet test
    165:  
    166:  retry_wait_seconds: 10
    167:  polling_interval_seconds: 1
    168:  warning_on_retry: true
    169:  continue_on_error: false
    ...
    
    191:  Write your first app: https://aka.ms/dotnet-hello-world
    192:  Find out what's new: https://aka.ms/dotnet-whats-new
    193:  Explore documentation: https://aka.ms/dotnet-docs
    194:  Report issues and find source on GitHub: https://github.com/dotnet/core
    195:  Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
    196:  --------------------------------------------------------------------------------------
    197:  Determining projects to restore...
    198:  Restored /Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj (in 3.77 sec).
    199:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs(204,20): error CS0712: Cannot create an instance of the static class 'DriverFinder' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
    200:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs(180,20): error CS0712: Cannot create an instance of the static class 'DriverFinder' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
    201:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs(180,20): error CS0712: Cannot create an instance of the static class 'DriverFinder' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
    202:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Drivers/ServiceTest.cs(41,20): error CS0712: Cannot create an instance of the static class 'DriverFinder' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
    203:  ##[warning]Attempt 1 failed. Reason: Child_process exited with error code 1
    204:  Determining projects to restore...
    205:  All projects are up-to-date for restore.
    206:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Drivers/ServiceTest.cs(41,20): error CS0712: Cannot create an instance of the static class 'DriverFinder' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
    207:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs(180,20): error CS0712: Cannot create an instance of the static class 'DriverFinder' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
    208:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs(180,20): error CS0712: Cannot create an instance of the static class 'DriverFinder' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
    209:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs(204,20): error CS0712: Cannot create an instance of the static class 'DriverFinder' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
    210:  ##[warning]Attempt 2 failed. Reason: Child_process exited with error code 1
    211:  Determining projects to restore...
    212:  All projects are up-to-date for restore.
    213:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Drivers/ServiceTest.cs(41,20): error CS0712: Cannot create an instance of the static class 'DriverFinder' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
    214:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs(204,20): error CS0712: Cannot create an instance of the static class 'DriverFinder' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
    215:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs(180,20): error CS0712: Cannot create an instance of the static class 'DriverFinder' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
    216:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs(180,20): error CS0712: Cannot create an instance of the static class 'DriverFinder' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
    217:  ##[error]Final attempt failed. Child_process exited with error 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.

    @diemol diemol merged commit fa5b5a7 into trunk Apr 22, 2024
    15 of 18 checks passed
    @diemol diemol deleted the nightly_js branch April 22, 2024 08:40
    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.

    1 participant