Skip to content

Commit 9a5528d

Browse files
authored
Merge branch 'trunk' into rv-ruby
2 parents f7e4fe2 + e23507e commit 9a5528d

File tree

1,075 files changed

+24656
-11418
lines changed

Some content is hidden

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

1,075 files changed

+24656
-11418
lines changed

.bazelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ javascript/grid-ui/node_modules
2727
javascript/private/node_modules
2828
javascript/selenium-webdriver/node_modules
2929
node_modules
30+
.local

.editorconfig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,14 @@ indent_size = 2
3939
[*.cs]
4040
indent_style = space
4141
indent_size = 4
42-
end_of_line = crlf
43-
charset = utf-8
4442

4543
[*.h]
4644
indent_style = space
4745
indent_size = 2
48-
end_of_line = crlf
49-
charset = utf-8
5046

5147
[*.cpp]
5248
indent_style = space
5349
indent_size = 2
54-
end_of_line = crlf
5550
charset = utf-8
5651

5752
[{*.bazel,WORKSPACE}]

.git-fixfiles

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ body:
5050
id: selenium-version
5151
attributes:
5252
label: What version of Selenium are you currently using?
53-
description: Important! The latest released version of Selenium is 4.40 and we can't fix old versions.
53+
description: Important! The latest released version of Selenium is 4.41 and we can't fix old versions.
5454
placeholder: e.g., 4.17.0
5555
validations:
5656
required: true

.github/workflows/bazel.yml

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,15 @@ on:
6767
type: boolean
6868
default: false
6969
fetch-depth:
70-
description: Number of commits to fetch (0 for full history)
70+
description: Number of commits to fetch (0 for full history, empty for auto-detect)
7171
required: false
72-
type: number
73-
default: 1
72+
type: string
73+
default: ''
74+
cache-name:
75+
description: Name for cache restore (restores {name}.gz with key {name}-)
76+
required: false
77+
type: string
78+
default: ''
7479

7580
jobs:
7681
bazel:
@@ -85,11 +90,33 @@ jobs:
8590
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
8691
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
8792
steps:
93+
- name: Calculate fetch depth
94+
id: depth
95+
shell: bash
96+
env:
97+
FETCH_DEPTH: ${{ inputs.fetch-depth }}
98+
PR_COMMITS: ${{ github.event.pull_request.commits }}
99+
run: |
100+
# Use explicit value if provided
101+
if [ -n "$FETCH_DEPTH" ]; then
102+
echo "val=$FETCH_DEPTH" >> "$GITHUB_OUTPUT"
103+
# For PRs, use commit count plus buffer for merge base
104+
elif [ -n "$PR_COMMITS" ]; then
105+
echo "val=$((PR_COMMITS + 2))" >> "$GITHUB_OUTPUT"
106+
# For push events, read commit count from event payload
107+
else
108+
COMMIT_COUNT=$(jq -e '.commits | length // 0' "$GITHUB_EVENT_PATH" 2>/dev/null) || COMMIT_COUNT=0
109+
echo "val=$((COMMIT_COUNT + 1))" >> "$GITHUB_OUTPUT"
110+
fi
88111
- name: Checkout source tree
89112
uses: actions/checkout@v4
90113
with:
91114
ref: ${{ inputs.ref || github.ref }}
92-
fetch-depth: ${{ inputs.fetch-depth }}
115+
fetch-depth: ${{ steps.depth.outputs.val }}
116+
fetch-tags: ${{ inputs.fetch-depth != '' }}
117+
- name: Fetch base ref for PR comparison
118+
if: github.event.pull_request.base.sha
119+
run: git fetch --depth=1 origin ${{ github.event.pull_request.base.sha }}
93120
- name: Pull latest changes from head ref for PRs
94121
if: contains(github.head_ref, 'renovate/')
95122
run: git pull origin "$HEAD_REF"
@@ -100,9 +127,13 @@ jobs:
100127
run: git pull origin "$GIT_REF"
101128
env:
102129
GIT_REF: ${{ github.ref }}
103-
- name: Free space
104-
if: inputs.os != 'windows'
105-
run: ./scripts/github-actions/free-disk-space.sh
130+
- name: Restore cache
131+
if: inputs.cache-name != ''
132+
uses: actions/cache/restore@v4
133+
with:
134+
path: ${{ inputs.cache-name }}
135+
key: ${{ inputs.cache-name }}-
136+
restore-keys: ${{ inputs.cache-name }}-
106137
- name: Remove driver directories Windows
107138
if: inputs.os == 'windows'
108139
run: |
@@ -225,7 +256,7 @@ jobs:
225256
limit-access-to-actor: false
226257
- name: Save git diff
227258
if: always() && inputs.artifact-name != '' && inputs.artifact-path == ''
228-
run: git diff --binary > changes.patch
259+
run: git add -A && git diff --binary --staged > changes.patch
229260
- name: Upload artifact
230261
if: always() && inputs.artifact-name != ''
231262
uses: actions/upload-artifact@v5
@@ -234,3 +265,13 @@ jobs:
234265
path: ${{ inputs.artifact-path || 'changes.patch' }}
235266
retention-days: 6
236267
if-no-files-found: ${{ inputs.artifact-path != '' && 'error' || 'warn' }}
268+
- name: Check disk space
269+
if: always()
270+
shell: bash
271+
run: |
272+
avail=$(df -k "$GITHUB_WORKSPACE" | awk 'NR==2 {printf "%.0f", $4/1024/1024}')
273+
echo "Remaining disk space: ${avail}GB"
274+
if [ "$avail" -lt 5 ]; then
275+
echo "::error::Low disk space: ${avail}GB remaining"
276+
exit 1
277+
fi
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI - Build Index
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_call:
8+
9+
jobs:
10+
build:
11+
name: Build Test Index
12+
uses: ./.github/workflows/bazel.yml
13+
with:
14+
name: Build Test Index
15+
os: ubuntu
16+
run: ./go bazel:build_test_index bazel-test-file-index
17+
artifact-name: bazel-test-file-index
18+
artifact-path: bazel-test-file-index
19+
20+
cache:
21+
name: Cache Index
22+
needs: build
23+
runs-on: ubuntu-latest
24+
permissions: {}
25+
steps:
26+
- name: Download index
27+
uses: actions/download-artifact@v4
28+
with:
29+
name: bazel-test-file-index
30+
- name: Cache index
31+
uses: actions/cache/save@v4
32+
with:
33+
path: bazel-test-file-index
34+
key: bazel-test-file-index-${{ github.run_id }}

.github/workflows/ci-dotnet.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ permissions:
88
contents: read
99

1010
jobs:
11+
lint:
12+
name: Lint
13+
uses: ./.github/workflows/bazel.yml
14+
with:
15+
name: Lint
16+
os: windows
17+
run: ./go dotnet:lint
18+
1119
build:
1220
name: Build
1321
uses: ./.github/workflows/bazel.yml
@@ -23,4 +31,13 @@ jobs:
2331
name: Browser Tests
2432
os: windows
2533
run: |
26-
bazel test //dotnet/test/common:ElementFindingTest-firefox //dotnet/test/common:ElementFindingTest-chrome
34+
bazel test //dotnet/test/common:ElementFindingTests-firefox //dotnet/test/common:ElementFindingTests-chrome
35+
36+
remote-tests:
37+
name: Remote Tests
38+
uses: ./.github/workflows/bazel.yml
39+
with:
40+
name: Remote Tests
41+
os: windows
42+
run: |
43+
bazel test //dotnet/test/remote:AllTests --flaky_test_attempts=3

.github/workflows/ci-grid-ui.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ jobs:
2222
steps:
2323
- name: Checkout source tree
2424
uses: actions/checkout@v4
25-
with:
26-
fetch-depth: 50
2725

2826
- name: Setup Node.js
2927
uses: actions/setup-node@v4

.github/workflows/ci-lint.yml

Lines changed: 47 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v4
2323
- name: Validate workflows
24-
uses: raven-actions/actionlint@v2.1.0
24+
uses: raven-actions/actionlint@v2
2525

2626
check-protected:
2727
name: Check Protected Files
@@ -50,46 +50,61 @@ jobs:
5050
uses: ./.github/workflows/bazel.yml
5151
with:
5252
name: Check Format
53-
run: ./scripts/github-actions/check-format.sh
53+
run: |
54+
# Run format - auto-fixes code style issues
55+
./go format
56+
# Fail if there were changes (triggers commit-fixes job)
57+
if ! git diff --quiet; then
58+
echo "Format made changes"
59+
exit 1
60+
fi
5461
artifact-name: format-changes
5562

56-
commit-fixes:
57-
name: Commit fixes
63+
fork-format-error:
64+
name: Fork format instructions
5865
needs: format
59-
if: failure() && github.event_name == 'pull_request'
66+
if: failure() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork
6067
runs-on: ubuntu-latest
61-
permissions:
62-
contents: write
63-
actions: read
6468
steps:
65-
- name: Check Permissions
66-
if: github.event.pull_request.head.repo.fork == true
69+
- name: Format instructions
6770
run: |
68-
echo "::error::Code needs formatting. Run ./scripts/format.sh locally and push changes."
71+
echo "::error::Code needs formatting. Run './go format' locally and push changes."
6972
exit 1
70-
- name: Checkout PR
73+
74+
check-bot-commit:
75+
name: Check bot commit
76+
needs: format
77+
if: always() && needs.format.result == 'failure' && github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork
78+
runs-on: ubuntu-latest
79+
outputs:
80+
should-commit: ${{ steps.check.outputs.should-commit }}
81+
steps:
82+
- name: Checkout
7183
uses: actions/checkout@v4
7284
with:
73-
ref: ${{ github.event.pull_request.head.ref }}
74-
- name: Download format changes
75-
uses: actions/download-artifact@v4
76-
with:
77-
name: format-changes
78-
- name: Apply and commit fixes
79-
id: apply
85+
ref: ${{ github.event.pull_request.head.sha }}
86+
- name: Check last commit author
87+
id: check
8088
run: |
81-
if [ -s changes.patch ]; then
82-
git apply --index changes.patch
83-
rm changes.patch
84-
git config --local user.name "Selenium CI Bot"
85-
git config --local user.email "selenium-ci@users.noreply.github.com"
86-
git commit -m "Auto-format code"
87-
echo "has_changes=true" >> "$GITHUB_OUTPUT"
89+
LAST_AUTHOR_EMAIL=$(git log -1 --format='%ae')
90+
if [ "$LAST_AUTHOR_EMAIL" = "selenium-ci@users.noreply.github.com" ]; then
91+
echo "::notice::Last commit was from Selenium CI Bot - skipping commit-fixes"
92+
echo "should-commit=false" >> "$GITHUB_OUTPUT"
8893
else
89-
echo "::notice::No formatting changes needed."
94+
echo "should-commit=true" >> "$GITHUB_OUTPUT"
9095
fi
91-
- name: Push fixes
92-
if: steps.apply.outputs.has_changes == 'true'
93-
run: |
94-
git push
95-
echo "::notice::Auto-formatted and pushed. New CI run will start."
96+
97+
commit-fixes:
98+
name: Commit fixes
99+
needs: check-bot-commit
100+
if: needs.check-bot-commit.outputs.should-commit == 'true'
101+
permissions:
102+
contents: write
103+
actions: read
104+
uses: ./.github/workflows/commit-changes.yml
105+
with:
106+
artifact-name: format-changes
107+
commit-message: "Auto-format code"
108+
ref: ${{ github.event.pull_request.head.ref }}
109+
secrets:
110+
SELENIUM_CI_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }}

.github/workflows/ci-python.yml

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,12 @@ jobs:
1616
run: |
1717
bazel build //py:selenium-wheel //py:selenium-sdist
1818
19-
docs:
20-
name: Documentation
21-
runs-on: ubuntu-latest
22-
steps:
23-
- name: Checkout source tree
24-
uses: actions/checkout@v4
25-
- name: Set up Python 3.10
26-
uses: actions/setup-python@v6
27-
with:
28-
python-version: '3.10'
29-
- name: Install dependencies
30-
run: |
31-
python -m pip install --upgrade pip
32-
pip install tox
33-
- name: Generate docs
34-
run: |
35-
tox -c py/tox.ini
36-
env:
37-
TOXENV: docs
38-
39-
typing:
40-
name: Type Checker
19+
lint:
20+
name: Lint
4121
uses: ./.github/workflows/bazel.yml
4222
with:
43-
name: Type Checker
44-
run: bazel run //py:mypy
23+
name: Lint
24+
run: ./go py:lint
4525

4626
unit-tests:
4727
name: Unit Tests

0 commit comments

Comments
 (0)