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

Nightly javascript #13844

Merged
merged 20 commits into from
Apr 19, 2024
Merged

Nightly javascript #13844

merged 20 commits into from
Apr 19, 2024

Conversation

diemol
Copy link
Member

@diemol diemol commented Apr 19, 2024

User description

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

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

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Type

enhancement, configuration changes


Description

  • Added support for Node.js version configuration in Bazel and nightly GitHub Actions workflows.
  • Introduced new npm publishing configurations for JavaScript packages to facilitate nightly releases.
  • Enhanced Rake tasks for better management of Node version updates and publishing processes.
  • Updated versions in package.json, BUILD.bazel, and package-lock.json to reflect new nightly builds.

Changes walkthrough

Relevant files
Configuration changes
bazel.yml
Add Node.js Configuration to Bazel Workflow                           

.github/workflows/bazel.yml

  • Added a new input for Node version in the workflow.
  • Included steps to set up Node based on the provided Node version.
  • Added NODE_AUTH_TOKEN to the environment variables.
  • +11/-0   
    nightly.yml
    Configure JavaScript Nightly Builds in GitHub Actions       

    .github/workflows/nightly.yml

  • Added 'javascript' to the list of languages for nightly builds.
  • Configured a new job for JavaScript using the Bazel workflow.
  • Set up npm configuration for publishing to GitHub packages.
  • +19/-0   
    BUILD.bazel
    Update JavaScript WebDriver Bazel Build Version                   

    javascript/node/selenium-webdriver/BUILD.bazel

    • Updated the version to a new nightly version.
    +1/-1     
    package.json
    Update Package Version and Publish Configuration                 

    javascript/node/selenium-webdriver/package.json

  • Updated the package version to a new nightly version.
  • Added publishConfig settings for npm registry.
  • +4/-1     
    package-lock.json
    Update Package-lock Version for Nightly Build                       

    package-lock.json

  • Updated the version of selenium-webdriver to match the new nightly
    version.
  • +1/-1     
    Enhancement
    Rakefile
    Enhance Node Version Management and Publishing Tasks         

    Rakefile

  • Modified the node dry-run task to use the publish command with a
    dry-run flag.
  • Updated the node version task to handle nightly version bumps and
    conditional changelog updates.
  • +31/-4   

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

    Copy link

    PR Description updated to latest commit (11bd94b)

    Copy link

    PR Review

    ⏱️ Estimated effort to review [1-5]

    3, because the PR involves multiple changes across various configuration and workflow files, as well as updates to package versions and publishing settings. The changes are not overly complex but require a good understanding of the project's CI/CD pipeline and versioning strategy.

    🧪 Relevant tests

    No

    🔍 Possible issues

    Possible Bug: The job name for the JavaScript workflow is incorrectly labeled as "DotNet" which might be a copy-paste error. This should be corrected to reflect the JavaScript context.

    Version Handling: The logic for handling nightly version updates in the Rakefile seems complex and could be prone to errors, especially around the transition between nightly and release builds. It would be beneficial to add more specific tests to cover these scenarios.

    🔒 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.

    @diemol
    Copy link
    Member Author

    diemol commented Apr 19, 2024

    This is just a change in the release script, I will merge right away.

    @diemol diemol merged commit 9e7adc7 into trunk Apr 19, 2024
    10 checks passed
    @diemol diemol deleted the nightly_javascript branch April 19, 2024 16:34
    Copy link

    PR Code Suggestions

    CategorySuggestions                                                                                                                                                       
    Best practice
    Specify a more precise version of the setup-node action to avoid potential breaking changes.

    It is recommended to use a more specific version of the setup-node action to ensure
    compatibility and predictability in your CI workflows. Using a major version only (v4) can
    lead to unexpected changes if new minor versions introduce breaking changes.

    .github/workflows/bazel.yml [114]

    -uses: actions/setup-node@v4
    +uses: actions/setup-node@v4.3
     
    Security
    Use a dedicated Node.js authentication token for better security.

    To enhance security, consider using a dedicated Node.js authentication token instead of
    reusing the GITHUB_TOKEN. This practice limits the scope of access and improves security.

    .github/workflows/bazel.yml [80]

    -NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    +NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
     
    Bug
    Correct the job name in the JavaScript workflow to accurately represent its purpose.

    The job name for the JavaScript workflow is incorrectly labeled as 'DotNet'. This should
    be corrected to reflect the actual job, which is for JavaScript.

    .github/workflows/nightly.yml [97]

    -name: DotNet
    +name: Nightly JavaScript Release
     
    Maintainability
    Ensure the changelog is updated for all version changes, including nightly builds.

    The task node:changelog should be invoked for all version changes, including nightly
    builds, to maintain a comprehensive changelog. Currently, it is not invoked for nightly
    version updates.

    Rakefile [559]

    -Rake::Task['node:changelog'].invoke unless new_version.include?('-nightly') || bump_nightly
    +Rake::Task['node:changelog'].invoke
     
    Enhancement
    Align the npm registry in package.json with the GitHub package registry used in the workflow.

    The publishConfig registry should be set to the GitHub package registry to align with the
    setup in the workflow file where the npm registry URL is modified to GitHub's.

    javascript/node/selenium-webdriver/package.json [59]

    -"registry": "https://registry.npmjs.org/"
    +"registry": "https://npm.pkg.github.com"
     

    ✨ 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.

    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