Skip to content

Commit b862c1c

Browse files
authored
Merge branch 'trunk' into gh-arm64
2 parents 4f7b9b9 + 2b2c9e0 commit b862c1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+540
-104
lines changed

.github/workflows/helm-chart-release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ on:
2929
permissions: write-all
3030

3131
env:
32+
GH_CLI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
GH_CLI_TOKEN_PR: ${{ secrets.SELENIUM_CI_TOKEN || secrets.GITHUB_TOKEN }}
34+
RUN_ID: ${{ github.run_id }}
35+
RERUN_FAILED_ONLY: ${{ github.event.inputs.rerunFailedOnly || true }}
36+
RUN_ATTEMPT: ${{ github.run_attempt }}
3237
FORCE_RELEASE: ${{ github.event.inputs.release == 'true' }}
3338

3439
jobs:
@@ -124,3 +129,32 @@ jobs:
124129
with:
125130
github_token: ${{ secrets.SELENIUM_CI_TOKEN || secrets.GITHUB_TOKEN }}
126131
branch: trunk
132+
133+
rerun-workflow-when-failure:
134+
name: Rerun workflow when failure
135+
needs:
136+
- helm-chart-test
137+
if: failure() && ( github.run_attempt < 3 )
138+
runs-on: ubuntu-24.04
139+
steps:
140+
- name: Checkout code
141+
uses: actions/checkout@main
142+
- name: Install GitHub CLI
143+
run: |
144+
sudo apt update
145+
sudo apt install gh
146+
- name: Authenticate GitHub CLI for PR
147+
if: github.event_name == 'pull_request'
148+
run: |
149+
echo "$GH_CLI_TOKEN_PR" | gh auth login --with-token
150+
- name: Authenticate GitHub CLI
151+
if: github.event_name != 'pull_request'
152+
run: |
153+
echo "$GH_CLI_TOKEN" | gh auth login --with-token
154+
- name: Rerun workflow when failure
155+
run: |
156+
echo "Rerun workflow ID $RUN_ID in attempt #$(($RUN_ATTEMPT + 1))"
157+
gh workflow run rerun-failed.yml \
158+
--repo $GITHUB_REPOSITORY \
159+
--raw-field runId=$RUN_ID \
160+
--raw-field rerunFailedOnly=$RERUN_FAILED_ONLY

.keda/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ You can involve to review and discuss the pull requests to help us early detect
4949

5050
[kedacore/keda](https://github.com/kedacore/keda)
5151

52+
- https://github.com/kedacore/keda/pull/6477
53+
5254
- ~~https://github.com/kedacore/keda/pull/6437 (merged, v2.16.1)~~
5355

5456
- ~~https://github.com/kedacore/keda/pull/6368 (merged, v2.16.1)~~
@@ -57,6 +59,8 @@ You can involve to review and discuss the pull requests to help us early detect
5759

5860
[kedacore/keda-docs](https://github.com/kedacore/keda-docs)
5961

62+
- https://github.com/kedacore/keda-docs/pull/1522
63+
6064
- https://github.com/kedacore/keda-docs/pull/1515
6165

6266
- ~~https://github.com/kedacore/keda-docs/pull/1468 (merged, v2.16.0)~~

.keda/scalers/selenium-grid-scaler.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ triggers:
2222
url: 'http://selenium-hub:4444/graphql' # Required. Can be ommitted if specified via TriggerAuthentication/ClusterTriggerAuthentication.
2323
browserName: '' # Optional. Required to be matched with the request in queue and Node stereotypes (Similarly for `browserVersion` and `platformName`).
2424
browserVersion: '' # Optional.
25-
platformName: 'linux' # Optional.
25+
platformName: '' # Optional.
2626
unsafeSsl : 'false' # Optional.
2727
activationThreshold: 0 # Optional.
2828
```
@@ -35,7 +35,7 @@ triggers:
3535
- `browserVersion` - Version of browser that usually gets passed in the browser capability. Refer to the [Selenium Grid's](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) and [WebdriverIO's](https://webdriver.io/docs/options/#capabilities) documentation for more info. (Optional)
3636
- `unsafeSsl` - Skip certificate validation when connecting over HTTPS. (Values: `true`, `false`, Default: `false`, Optional)
3737
- `activationThreshold` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional)
38-
- `platformName` - Name of the browser platform. Refer to the [Selenium Grid's](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) and [WebdriverIO's](https://webdriver.io/docs/options/#capabilities) documentation for more info. (Default: `Linux`, Optional)
38+
- `platformName` - Name of the browser platform. Refer to the [Selenium Grid's](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) and [WebdriverIO's](https://webdriver.io/docs/options/#capabilities) documentation for more info. (Optional)
3939
- `nodeMaxSessions` - Number of maximum sessions that can run in parallel on a Node. Update this parameter align with node config `--max-sessions` (`SE_NODE_MAX_SESSIONS`) to have the correct scaling behavior. (Default: `1`, Optional).
4040

4141
**Trigger Authentication**
@@ -66,6 +66,8 @@ spec:
6666
env:
6767
- name: SE_NODE_BROWSER_VERSION
6868
value: ''
69+
- name: SE_NODE_PLATFORM_NAME
70+
value: 'Linux'
6971
7072
---
7173

.keda/scalers/selenium_grid_scaler.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -251,35 +251,34 @@ func countMatchingSessions(sessions Sessions, browserName string, browserVersion
251251
// This function checks if the request capabilities match the scaler metadata
252252
func checkRequestCapabilitiesMatch(request Capability, browserName string, browserVersion string, _ string, platformName string) bool {
253253
// Check if browserName matches
254-
browserNameMatch := request.BrowserName == "" && browserName == "" ||
254+
browserNameMatch := (request.BrowserName == "" && browserName == "") ||
255255
strings.EqualFold(browserName, request.BrowserName)
256256

257257
// Check if browserVersion matches
258258
browserVersionMatch := (request.BrowserVersion == "" && browserVersion == "") ||
259-
(request.BrowserVersion == "stable" && browserVersion == "") ||
260-
(strings.HasPrefix(browserVersion, request.BrowserVersion) && request.BrowserVersion != "" && browserVersion != "")
259+
(request.BrowserVersion != "" && strings.HasPrefix(browserVersion, request.BrowserVersion))
261260

262261
// Check if platformName matches
263-
platformNameMatch := request.PlatformName == "" && platformName == "" ||
264-
strings.EqualFold(platformName, request.PlatformName)
262+
platformNameMatch := (request.PlatformName == "" || strings.EqualFold("any", request.PlatformName) || strings.EqualFold(platformName, request.PlatformName)) &&
263+
(platformName == "" || platformName == "any" || strings.EqualFold(platformName, request.PlatformName))
265264

266265
return browserNameMatch && browserVersionMatch && platformNameMatch
267266
}
268267

269268
// This function checks if Node stereotypes or ongoing sessions match the scaler metadata
270269
func checkStereotypeCapabilitiesMatch(capability Capability, browserName string, browserVersion string, sessionBrowserName string, platformName string) bool {
271270
// Check if browserName matches
272-
browserNameMatch := capability.BrowserName == "" && browserName == "" ||
271+
browserNameMatch := (capability.BrowserName == "" && browserName == "") ||
273272
strings.EqualFold(browserName, capability.BrowserName) ||
274273
strings.EqualFold(sessionBrowserName, capability.BrowserName)
275274

276275
// Check if browserVersion matches
277-
browserVersionMatch := capability.BrowserVersion == "" && browserVersion == "" ||
278-
(strings.HasPrefix(browserVersion, capability.BrowserVersion) && capability.BrowserVersion != "" && browserVersion != "")
276+
browserVersionMatch := (capability.BrowserVersion == "" && browserVersion == "") ||
277+
(capability.BrowserVersion != "" && strings.HasPrefix(browserVersion, capability.BrowserVersion))
279278

280279
// Check if platformName matches
281-
platformNameMatch := capability.PlatformName == "" && platformName == "" ||
282-
strings.EqualFold(platformName, capability.PlatformName)
280+
platformNameMatch := (capability.PlatformName == "" || strings.EqualFold("any", capability.PlatformName) || strings.EqualFold(platformName, capability.PlatformName)) &&
281+
(platformName == "" || platformName == "any" || strings.EqualFold(platformName, capability.PlatformName))
283282

284283
return browserNameMatch && browserVersionMatch && platformNameMatch
285284
}

.keda/scalers/selenium_grid_scaler_test.go

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,74 @@ func Test_getCountFromSeleniumResponse(t *testing.T) {
10421042
wantOnGoingSessions: 2,
10431043
wantErr: false,
10441044
},
1045+
{
1046+
name: "1 queue request without platformName and scaler metadata without platfromName should return 1 new node and 1 ongoing session",
1047+
args: args{
1048+
b: []byte(`{
1049+
"data": {
1050+
"grid": {
1051+
"sessionCount": 2,
1052+
"maxSession": 2,
1053+
"totalSlots": 2
1054+
},
1055+
"nodesInfo": {
1056+
"nodes": [
1057+
{
1058+
"id": "node-1",
1059+
"status": "UP",
1060+
"sessionCount": 1,
1061+
"maxSession": 1,
1062+
"slotCount": 1,
1063+
"stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"platformName\": \"any\"}}]",
1064+
"sessions": [
1065+
{
1066+
"id": "session-1",
1067+
"capabilities": "{\"browserName\": \"chrome\", \"platformName\": \"any\"}",
1068+
"slot": {
1069+
"id": "9ce1edba-72fb-465e-b311-ee473d8d7b64",
1070+
"stereotype": "{\"browserName\": \"chrome\", \"platformName\": \"any\"}"
1071+
}
1072+
}
1073+
]
1074+
},
1075+
{
1076+
"id": "node-2",
1077+
"status": "UP",
1078+
"sessionCount": 1,
1079+
"maxSession": 1,
1080+
"slotCount": 1,
1081+
"stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"platformName\": \"linux\"}}]",
1082+
"sessions": [
1083+
{
1084+
"id": "session-2",
1085+
"capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}",
1086+
"slot": {
1087+
"id": "9ce1edba-72fb-465e-b311-ee473d8d7b64",
1088+
"stereotype": "{\"browserName\": \"chrome\", \"platformName\": \"linux\"}"
1089+
}
1090+
}
1091+
]
1092+
}
1093+
]
1094+
},
1095+
"sessionsInfo": {
1096+
"sessionQueueRequests": [
1097+
"{\"browserName\": \"chrome\", \"platformName\": \"linux\"}",
1098+
"{\"browserName\": \"chrome\"}",
1099+
"{\"browserName\": \"chrome\", \"platformName\": \"any\"}"
1100+
]
1101+
}
1102+
}
1103+
}`),
1104+
browserName: "chrome",
1105+
sessionBrowserName: "chrome",
1106+
browserVersion: "",
1107+
platformName: "",
1108+
},
1109+
wantNewRequestNodes: 2,
1110+
wantOnGoingSessions: 1,
1111+
wantErr: false,
1112+
},
10451113
{
10461114
name: "1 active session with matching browsername and version should return count as 2",
10471115
args: args{

Distributor/start-selenium-grid-distributor.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ if [ "${SE_ENABLE_TRACING}" = "true" ] && [ -n "${SE_OTEL_EXPORTER_ENDPOINT}" ];
170170
SE_OTEL_JVM_ARGS="$SE_OTEL_JVM_ARGS -Dotel.java.global-autoconfigure.enabled=${SE_OTEL_JAVA_GLOBAL_AUTOCONFIGURE_ENABLED}"
171171
fi
172172
if [ -n "$SE_OTEL_JVM_ARGS" ]; then
173-
echo "List arguments for OpenTelemetry: ${SE_OTEL_JVM_ARGS}"
174173
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
175174
fi
176175
else
@@ -187,6 +186,10 @@ if [ -n "${SE_JAVA_OPTS_DEFAULT}" ]; then
187186
SE_JAVA_OPTS="${SE_JAVA_OPTS_DEFAULT} $SE_JAVA_OPTS"
188187
fi
189188

189+
if [ -n "${JAVA_OPTS:-$SE_JAVA_OPTS}" ]; then
190+
echo "Using JAVA_OPTS: ${JAVA_OPTS:-$SE_JAVA_OPTS}"
191+
fi
192+
190193
function handle_heap_dump() {
191194
/opt/bin/handle_heap_dump.sh $SELENIUM_SERVER_PID /opt/selenium/logs
192195
}

EventBus/start-selenium-grid-eventbus.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ if [ "${SE_ENABLE_TRACING}" = "true" ] && [ -n "${SE_OTEL_EXPORTER_ENDPOINT}" ];
100100
SE_OTEL_JVM_ARGS="$SE_OTEL_JVM_ARGS -Dotel.java.global-autoconfigure.enabled=${SE_OTEL_JAVA_GLOBAL_AUTOCONFIGURE_ENABLED}"
101101
fi
102102
if [ -n "$SE_OTEL_JVM_ARGS" ]; then
103-
echo "List arguments for OpenTelemetry: ${SE_OTEL_JVM_ARGS}"
104103
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
105104
fi
106105
else
@@ -117,6 +116,10 @@ if [ -n "${SE_JAVA_OPTS_DEFAULT}" ]; then
117116
SE_JAVA_OPTS="${SE_JAVA_OPTS_DEFAULT} $SE_JAVA_OPTS"
118117
fi
119118

119+
if [ -n "${JAVA_OPTS:-$SE_JAVA_OPTS}" ]; then
120+
echo "Using JAVA_OPTS: ${JAVA_OPTS:-$SE_JAVA_OPTS}"
121+
fi
122+
120123
function handle_heap_dump() {
121124
/opt/bin/handle_heap_dump.sh $SELENIUM_SERVER_PID /opt/selenium/logs
122125
}

Hub/start-selenium-grid-hub.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ if [ "${SE_ENABLE_TRACING}" = "true" ] && [ -n "${SE_OTEL_EXPORTER_ENDPOINT}" ];
150150
SE_OTEL_JVM_ARGS="$SE_OTEL_JVM_ARGS -Dotel.java.global-autoconfigure.enabled=${SE_OTEL_JAVA_GLOBAL_AUTOCONFIGURE_ENABLED}"
151151
fi
152152
if [ -n "$SE_OTEL_JVM_ARGS" ]; then
153-
echo "List arguments for OpenTelemetry: ${SE_OTEL_JVM_ARGS}"
154153
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
155154
fi
156155
else
@@ -167,6 +166,10 @@ if [ -n "${SE_JAVA_OPTS_DEFAULT}" ]; then
167166
SE_JAVA_OPTS="${SE_JAVA_OPTS_DEFAULT} $SE_JAVA_OPTS"
168167
fi
169168

169+
if [ -n "${JAVA_OPTS:-$SE_JAVA_OPTS}" ]; then
170+
echo "Using JAVA_OPTS: ${JAVA_OPTS:-$SE_JAVA_OPTS}"
171+
fi
172+
170173
function handle_heap_dump() {
171174
/opt/bin/handle_heap_dump.sh $SELENIUM_SERVER_PID /opt/selenium/logs
172175
}

NodeBase/start-selenium-node.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ if [ "${SE_ENABLE_TRACING}" = "true" ] && [ -n "${SE_OTEL_EXPORTER_ENDPOINT}" ];
149149
SE_OTEL_JVM_ARGS="$SE_OTEL_JVM_ARGS -Dotel.java.global-autoconfigure.enabled=${SE_OTEL_JAVA_GLOBAL_AUTOCONFIGURE_ENABLED}"
150150
fi
151151
if [ -n "$SE_OTEL_JVM_ARGS" ]; then
152-
echo "List arguments for OpenTelemetry: ${SE_OTEL_JVM_ARGS}"
153152
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
154153
fi
155154
else
@@ -182,6 +181,10 @@ if [ -n "${SE_JAVA_OPTS_DEFAULT}" ]; then
182181
SE_JAVA_OPTS="${SE_JAVA_OPTS_DEFAULT} $SE_JAVA_OPTS"
183182
fi
184183

184+
if [ -n "${JAVA_OPTS:-$SE_JAVA_OPTS}" ]; then
185+
echo "Using JAVA_OPTS: ${JAVA_OPTS:-$SE_JAVA_OPTS}"
186+
fi
187+
185188
function handle_heap_dump() {
186189
/opt/bin/handle_heap_dump.sh $SELENIUM_SERVER_PID /opt/selenium/logs
187190
}

NodeDocker/start-selenium-grid-docker.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ if [ "${SE_ENABLE_TRACING}" = "true" ] && [ -n "${SE_OTEL_EXPORTER_ENDPOINT}" ];
117117
SE_OTEL_JVM_ARGS="$SE_OTEL_JVM_ARGS -Dotel.java.global-autoconfigure.enabled=${SE_OTEL_JAVA_GLOBAL_AUTOCONFIGURE_ENABLED}"
118118
fi
119119
if [ -n "$SE_OTEL_JVM_ARGS" ]; then
120-
echo "List arguments for OpenTelemetry: ${SE_OTEL_JVM_ARGS}"
121120
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
122121
fi
123122
else
@@ -134,6 +133,10 @@ if [ -n "${SE_JAVA_OPTS_DEFAULT}" ]; then
134133
SE_JAVA_OPTS="${SE_JAVA_OPTS_DEFAULT} $SE_JAVA_OPTS"
135134
fi
136135

136+
if [ -n "${JAVA_OPTS:-$SE_JAVA_OPTS}" ]; then
137+
echo "Using JAVA_OPTS: ${JAVA_OPTS:-$SE_JAVA_OPTS}"
138+
fi
139+
137140
function handle_heap_dump() {
138141
/opt/bin/handle_heap_dump.sh $SELENIUM_SERVER_PID /opt/selenium/logs
139142
}

0 commit comments

Comments
 (0)