You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Motivation and Context
Update in bash scripts is used for probe checks in K8s deployment. Separate reusable script.
Pre-steps to add graceful shutdown for Node container when deploying by docker, docker-compose
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)
Sensitive Information Exposure: The PR introduces environment variables for router username and password, which are sensitive. Ensure these credentials are handled securely throughout the system, especially in logs and during error handling.
⚡ Key issues to review
Sensitive Information Exposure The PR introduces environment variables SE_ROUTER_USERNAME and SE_ROUTER_PASSWORD which are base64 encoded. Ensure these are securely handled and not logged or exposed in any debug outputs or logs.
Hardcoded Path The script uses a hardcoded path /opt/selenium for ROUTER_CONFIG_DIRECTORY. Consider making this configurable or clearly document its necessity and usage.
Error Handling The script exits or returns status codes like 401 or 404 without any error message or logging. This might make debugging issues in production environments difficult.
Ensure new script files in config maps are secured
To avoid potential security risks, ensure that the new script files added to the routerConfigMap are properly secured and only contain necessary executable permissions.
Why: Ensuring that script files are read-only is a critical security measure to prevent unauthorized modifications, which could lead to security vulnerabilities.
10
Validate and secure the default mode of new config maps
Validate the new routerConfigMap default mode settings to ensure they are consistent with security best practices, especially if they contain sensitive data or scripts.
Why: Validating and securing the default mode of config maps is essential to ensure that sensitive data or scripts are not exposed or misconfigured, aligning with security best practices.
10
Possible bug
Improve the check for a non-empty grid_url to prevent potential errors
Use a more robust method for checking if grid_url is non-empty to prevent executing curl on an empty URL.
Why: This suggestion addresses a potential bug by ensuring that the grid_url is not only non-empty but also valid, preventing erroneous curl executions. This significantly improves the script's reliability.
9
Possible issue
Add error handling for router config map references
Consider adding error handling or validation for the new routerConfigMap entries to ensure that the configuration does not break deployments if the values are not set properly.
Why: Adding error handling for the router config map references ensures that deployments do not fail silently due to misconfigurations, which is important for robustness and reliability.
9
Maintainability
Add documentation for new environment variables in the Helm chart
Ensure that the new environment variable SE_ROUTER_HOST and SE_ROUTER_PORT are properly documented in the Helm chart's values file and README to avoid confusion for new users or when updating the chart.
+# Please add documentation in the values.yaml and README.md
- name: SE_ROUTER_HOST
value: '{{ template "seleniumGrid.router.fullname" . }}.{{ .Release.Namespace }}'
- name: SE_ROUTER_PORT
value: {{ .Values.components.router.port | quote }}
Apply this suggestion
Suggestion importance[1-10]: 8
Why: Adding documentation for new environment variables is crucial for maintainability and helps users understand and correctly use the new settings. This suggestion addresses a significant aspect of usability.
8
Replace direct exit commands with a logging function to improve debuggability
Replace the direct exit command with a function that logs the exit reason and then exits. This will improve debugging and maintainability.
-exit 0+log_and_exit "Exiting due to missing GraphQL URL" 0
Apply this suggestion
Suggestion importance[1-10]: 7
Why: This suggestion improves maintainability by providing a clear log message before exiting, which aids in debugging. However, it is not crucial for the functionality of the script.
7
Use a variable for repeated date commands to improve code clarity
Consolidate the repeated use of date ${ts_format} into a variable to reduce redundancy and improve code clarity.
-echo "$(date ${ts_format}) DEBUG [${probe_name}] - Could not construct GraphQL endpoint, please provide SE_HUB_HOST (or SE_ROUTER_HOST) and SE_HUB_PORT (or SE_ROUTER_PORT). Bypass the probe checks for now."+current_time=$(date ${ts_format})+echo "${current_time} DEBUG [${probe_name}] - Could not construct GraphQL endpoint, please provide SE_HUB_HOST (or SE_ROUTER_HOST) and SE_HUB_PORT (or SE_ROUTER_PORT). Bypass the probe checks for now."
Apply this suggestion
Suggestion importance[1-10]: 6
Why: Consolidating repeated date commands into a variable reduces redundancy and improves code clarity. However, this is a minor improvement and does not affect the script's core functionality.
6
Error handling
Add error handling for curl commands to handle network errors
Add error handling for the curl command to ensure that the script can handle network errors gracefully.
Why: Adding error handling for the curl command is important for robustness, ensuring the script can handle network errors gracefully. This enhances the reliability of the script.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Motivation and Context
Update in bash scripts is used for probe checks in K8s deployment. Separate reusable script.
Pre-steps to add graceful shutdown for Node container when deploying by docker, docker-compose
Types of changes
Checklist
PR Type
Enhancement, Configuration changes
Description
SE_SERVER_PROTOCOL
environment variable with default value "http" in Dockerfiles.Changes walkthrough 📝
9 files
start-selenium-grid-hub.sh
Update environment variable names for router credentials
Hub/start-selenium-grid-hub.sh
start-selenium-grid-router.sh
Update environment variable names for router credentials
Router/start-selenium-grid-router.sh
start-selenium-standalone.sh
Update environment variable names for router credentials
Standalone/start-selenium-standalone.sh
distributorProbe.sh
Refactor distributor probe script to use external GraphQL URL script
charts/selenium-grid/configs/distributor/distributorProbe.sh
nodeGridUrl.sh
Add script for constructing and validating Grid URL
charts/selenium-grid/configs/node/nodeGridUrl.sh
nodePreStop.sh
Refactor node preStop script to use external Grid URL script
charts/selenium-grid/configs/node/nodePreStop.sh
nodeProbe.sh
Refactor node probe script to use external Grid URL script
charts/selenium-grid/configs/node/nodeProbe.sh
routerGraphQLUrl.sh
Add script for constructing and validating GraphQL URL
charts/selenium-grid/configs/router/routerGraphQLUrl.sh
routerProbe.sh
Refactor router probe script to use external GraphQL URL script
charts/selenium-grid/configs/router/routerProbe.sh
12 files
Dockerfile
Add SE_SERVER_PROTOCOL environment variable
Base/Dockerfile
SE_SERVER_PROTOCOL
environment variable with default value"http".
Dockerfile
Update default screen resolution environment variables
NodeBase/Dockerfile
Dockerfile
Add SE_SERVER_PROTOCOL and update screen resolution
Video/Dockerfile
SE_SERVER_PROTOCOL
environment variable with default value"http".
distributor-configmap.yaml
Remove SE_GRID_GRAPHQL_URL from distributor ConfigMap
charts/selenium-grid/templates/distributor-configmap.yaml
SE_GRID_GRAPHQL_URL
from ConfigMap.distributor-deployment.yaml
Add router configuration and scripts to distributor deployment
charts/selenium-grid/templates/distributor-deployment.yaml
hub-deployment.yaml
Add router configuration and scripts to hub deployment
charts/selenium-grid/templates/hub-deployment.yaml
node-configmap.yaml
Add NODE_CONFIG_DIRECTORY to node ConfigMap
charts/selenium-grid/templates/node-configmap.yaml
NODE_CONFIG_DIRECTORY
environment variable.router-configmap.yaml
Add ROUTER_CONFIG_DIRECTORY to router ConfigMap
charts/selenium-grid/templates/router-configmap.yaml
ROUTER_CONFIG_DIRECTORY
environment variable.secrets.yaml
Update environment variable names for router credentials in secrets
charts/selenium-grid/templates/secrets.yaml
session-queue-deployment.yaml
Add deployment configuration for session queue
charts/selenium-grid/templates/session-queue-deployment.yaml
session-queue-service.yaml
Add service configuration for session queue
charts/selenium-grid/templates/session-queue-service.yaml
values.yaml
Add new script entries for router and node configurations
charts/selenium-grid/values.yaml
1 files
README.md
Update documentation for default screen resolution
README.md