Skip to content

Update Custom Node Initialization in Grid Advanced Features #1729

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 6 commits into from
May 17, 2024

Conversation

josh-yam
Copy link
Contributor

@josh-yam josh-yam commented May 17, 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

Description

With this change, the Node constructor now requires a the sessionTimeout argument. Updating code sample to pass it along to the DecoratedLoggingNode constructor.

Motivation and Context

Current example will error out with the following error:

constructor Node in class org.openqa.selenium.grid.node.Node cannot be applied to given types;
62.49 [ERROR]   required: org.openqa.selenium.remote.tracing.Tracer,org.openqa.selenium.grid.data.NodeId,java.net.URI,org.openqa.selenium.grid.security.Secret,java.time.Duration
62.49 [ERROR]   found: org.openqa.selenium.remote.tracing.Tracer,org.openqa.selenium.grid.data.NodeId,java.net.URI,org.openqa.selenium.grid.security.Secret
62.49 [ERROR]   reason: actual and formal argument lists differ in length

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.

PR Type

bug_fix, enhancement


Description

  • Updated the DecoratedLoggingNode constructor across multiple language versions (English, Japanese, Portuguese-BR, Chinese) to include a new sessionTimeout parameter.
  • Modified the create method in each language version to fetch sessionTimeout from NodeOptions and pass it correctly to the DecoratedLoggingNode constructor.
  • This change ensures compatibility with the updated Node constructor requirements, preventing initialization errors.

Changes walkthrough 📝

Relevant files
Enhancement
customize_node.en.md
Update Node Initialization to Include Session Timeout       

website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md

  • Updated the constructor of DecoratedLoggingNode to include
    sessionTimeout parameter.
  • Adjusted the create method to fetch sessionTimeout from NodeOptions
    and pass it to the constructor.
  • +6/-3     
    customize_node.ja.md
    Update Node Initialization to Include Session Timeout       

    website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md

  • Updated the constructor of DecoratedLoggingNode to include
    sessionTimeout parameter.
  • Adjusted the create method to fetch sessionTimeout from NodeOptions
    and pass it to the constructor.
  • +8/-5     
    customize_node.pt-br.md
    Update Node Initialization to Include Session Timeout       

    website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md

  • Updated the constructor of DecoratedLoggingNode to include
    sessionTimeout parameter.
  • Adjusted the create method to fetch sessionTimeout from NodeOptions
    and pass it to the constructor.
  • +8/-5     
    customize_node.zh-cn.md
    Update Node Initialization to Include Session Timeout       

    website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md

  • Updated the constructor of DecoratedLoggingNode to include
    sessionTimeout parameter.
  • Adjusted the create method to fetch sessionTimeout from NodeOptions
    and pass it to the constructor.
  • +8/-5     

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

    Copy link

    netlify bot commented May 17, 2024

    Deploy Preview for selenium-dev ready!

    Name Link
    🔨 Latest commit d8fd522
    🔍 Latest deploy log https://app.netlify.com/sites/selenium-dev/deploys/6647937d1da23b00085d308e
    😎 Deploy Preview https://deploy-preview-1729--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.

    @CLAassistant
    Copy link

    CLAassistant commented May 17, 2024

    CLA assistant check
    All committers have signed the CLA.

    @qodo-merge-pro qodo-merge-pro bot added enhancement New feature or request bug_fix labels May 17, 2024
    Copy link
    Contributor

    PR Description updated to latest commit (36524f7)

    Copy link
    Contributor

    PR Review 🔍

    ⏱️ Estimated effort to review [1-5]

    2, because the changes are straightforward and consistent across multiple documentation files. The PR modifies the constructor of a class to include an additional parameter and updates the method calls accordingly.

    🧪 Relevant tests

    No

    ⚡ Possible issues

    Typo in Parameter: In the English version of the file, the constructor parameter registrationSecretm should be registrationSecret. This typo could lead to compilation errors or unexpected behavior.

    🔒 Security concerns

    No

    Copy link
    Contributor

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Possible bug
    Correct a typo in the parameter name to ensure code consistency and correctness

    Correct the typo in the parameter name registrationSecretm to registrationSecret in the
    constructor of DecoratedLoggingNode.

    website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md [98-100]

    -protected DecoratedLoggingNode(Tracer tracer, NodeId nodeId, URI uri, Secret registrationSecretm, Duration sessionTimeout) {
    +protected DecoratedLoggingNode(Tracer tracer, NodeId nodeId, URI uri, Secret registrationSecret, Duration sessionTimeout) {
       super(tracer, nodeId, uri, registrationSecret, sessionTimeout);
     }
     
    Suggestion importance[1-10]: 10

    Why: The suggestion correctly identifies and fixes a typo in the parameter name from registrationSecretm to registrationSecret, which is crucial for the code to function correctly.

    10

    Copy link
    Member

    @diemol diemol left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Good catch, thank you, @josh-pinwheelapi!

    @diemol diemol merged commit 808af3e into SeleniumHQ:trunk May 17, 2024
    6 checks passed
    selenium-ci added a commit that referenced this pull request May 17, 2024
    * Update Code Sample
    
    * Fix identation
    
    * Fix constructor
    
    * Fix typo
    
    * Fix identation
    
    ---------
    
    Co-authored-by: Diego Molina <[email protected]>
    
    [deploy site] 808af3e
    @josh-yam josh-yam deleted the fix_custom_node_initialization branch May 17, 2024 17:39
    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.

    3 participants