Skip to content

Docker: Add Node config env var SE_NODE_DELETE_SESSION_ON_UI #2871

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 1 commit into from
Jun 30, 2025

Conversation

VietND96
Copy link
Member

@VietND96 VietND96 commented Jun 30, 2025

User description

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

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

Description

Container environment variable represent for config SeleniumHQ/selenium#15808

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.

PR Type

Enhancement


Description

  • Add SE_NODE_DELETE_SESSION_ON_UI environment variable

  • Enable session deletion capability in Grid UI

  • Update documentation with new configuration option

  • Set default value to true for enhanced user experience


Changes diagram

flowchart LR
  A["Environment Variable"] --> B["Shell Scripts"]
  B --> C["Selenium Node"]
  C --> D["Grid UI Session Delete"]
  E["Documentation"] --> F["ENV_VARIABLES.md"]
  G["Configuration Files"] --> H["YAML Configs"]
Loading

Changes walkthrough 📝

Relevant files
Enhancement
start-selenium-node.sh
Add session deletion UI option to node startup                     

NodeBase/start-selenium-node.sh

  • Add conditional check for SE_NODE_DELETE_SESSION_ON_UI environment
    variable
  • Append --delete-session-on-ui true option when variable is set to
    "true"
  • +4/-0     
    start-selenium-standalone.sh
    Add session deletion UI option to standalone startup         

    Standalone/start-selenium-standalone.sh

  • Add conditional check for SE_NODE_DELETE_SESSION_ON_UI environment
    variable
  • Append --delete-session-on-ui true option when variable is set to
    "true"
  • +4/-0     
    Documentation
    ENV_VARIABLES.md
    Update environment variables documentation                             

    ENV_VARIABLES.md

  • Add new SE_NODE_DELETE_SESSION_ON_UI environment variable
    documentation
  • Update SE_OTEL_SERVICE_NAME default value from "selenium-event-bus" to
    "selenium-router"
  • Add description for SE_NODE_ENABLE_MANAGED_DOWNLOADS variable
  • +3/-2     
    description.yaml
    Add environment variable descriptions for documentation generation

    scripts/generate_list_env_vars/description.yaml

  • Add description for new SE_NODE_DELETE_SESSION_ON_UI variable
  • Update description for SE_NODE_ENABLE_MANAGED_DOWNLOADS variable
  • +5/-1     
    Configuration changes
    Dockerfile
    Set default value for session deletion UI option                 

    NodeBase/Dockerfile

  • Add SE_NODE_DELETE_SESSION_ON_UI="true" environment variable with
    default value
  • +1/-0     
    value.yaml
    Set default values for environment variables                         

    scripts/generate_list_env_vars/value.yaml

  • Add default value "true" for SE_NODE_DELETE_SESSION_ON_UI variable
  • Update SE_OTEL_SERVICE_NAME default from "selenium-event-bus" to
    "selenium-router"
  • +3/-1     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Unrelated Changes

    The PR includes changes to SE_OTEL_SERVICE_NAME default value and SE_NODE_ENABLE_MANAGED_DOWNLOADS description that appear unrelated to the main feature of adding SE_NODE_DELETE_SESSION_ON_UI. These changes should be in separate commits or PRs for better traceability.

    | SE_OTEL_SERVICE_NAME | selenium-router |  | -Dotel.resource.attributes=service.name= |
    | SE_OTEL_JVM_ARGS |  |  |  |
    | SE_OTEL_TRACES_EXPORTER | otlp |  | -Dotel.traces.exporter |
    | SE_OTEL_JAVA_GLOBAL_AUTOCONFIGURE_ENABLED | true |  |  |
    | SE_JAVA_HTTPCLIENT_VERSION | HTTP_1_1 |  | -Dwebdriver.httpclient.version |
    | SE_JAVA_OPTS_DEFAULT |  |  |  |
    | SE_JAVA_HEAP_DUMP | false |  |  |
    | SE_BIND_HOST | false |  |  |
    | SE_SCREEN_DEPTH | 24 |  |  |
    | SE_SCREEN_DPI | 96 |  |  |
    | SE_START_XVFB | true |  |  |
    | SE_START_VNC | true |  |  |
    | SE_START_NO_VNC | true |  |  |
    | SE_VNC_ULIMIT |  |  |  |
    | SE_NO_VNC_PORT | 7900 |  |  |
    | SE_VNC_PORT | 5900 |  |  |
    | SE_VNC_NO_PASSWORD |  |  |  |
    | SE_VNC_VIEW_ONLY |  |  |  |
    | SE_VNC_PASSWORD |  |  |  |
    | SE_EVENT_BUS_PUBLISH_PORT | 4442 |  |  |
    | SE_EVENT_BUS_SUBSCRIBE_PORT | 4443 |  |  |
    | SE_NODE_SESSION_TIMEOUT | 300 |  | --session-timeout |
    | SE_NODE_ENABLE_MANAGED_DOWNLOADS | true | This causes the Node to auto manage files downloaded for a given session on the Node | --enable-managed-downloads |
    Unrelated Changes

    Similar to the documentation file, this includes an unrelated change to SE_OTEL_SERVICE_NAME default value that should be separated from the main feature addition.

    - name: SE_OTEL_SERVICE_NAME
      default: selenium-router

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Remove redundant boolean flag value

    The --delete-session-on-ui flag is a boolean option that doesn't require a
    value. Passing "true" as a separate argument may cause parsing issues or
    unexpected behavior.

    NodeBase/start-selenium-node.sh [76-78]

     if [ "$SE_NODE_DELETE_SESSION_ON_UI" = "true" ]; then
    -  append_se_opts "--delete-session-on-ui" "true"
    +  append_se_opts "--delete-session-on-ui"
     fi
    • Apply / Chat
    Suggestion importance[1-10]: 8

    __

    Why: The suggestion correctly identifies that --delete-session-on-ui is a boolean flag and passing an extra "true" argument could cause command-line parsing issues, thus fixing a potential bug.

    Medium
    • More

    @VietND96 VietND96 merged commit 3f9bb4b into trunk Jun 30, 2025
    50 of 55 checks passed
    @VietND96 VietND96 deleted the node-session-delete-on-ui branch June 30, 2025 05:29
    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