Skip to content

Commit 0fc7062

Browse files
authored
Merge branch 'trunk' into refactor
2 parents 4846328 + 55d0708 commit 0fc7062

File tree

21 files changed

+128
-114
lines changed

21 files changed

+128
-114
lines changed

common/mirror/selenium

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
[
22
{
3-
"tag_name": "selenium-4.31.0",
3+
"tag_name": "nightly",
44
"assets": [
55
{
6-
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.31.0/selenium-dotnet-4.31.0.zip"
6+
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-java-4.32.0-SNAPSHOT.zip"
77
},
88
{
9-
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.31.0/selenium-dotnet-strongnamed-4.31.0.zip"
9+
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.32.0-SNAPSHOT.jar"
1010
},
1111
{
12-
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.31.0/selenium-java-4.31.0.zip"
13-
},
14-
{
15-
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.31.0/selenium-server-4.31.0.jar"
16-
},
17-
{
18-
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.31.0/selenium-server-4.31.0.zip"
12+
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.32.0-SNAPSHOT.zip"
1913
}
2014
]
2115
},
2216
{
23-
"tag_name": "nightly",
17+
"tag_name": "selenium-4.31.0",
2418
"assets": [
2519
{
26-
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-java-4.31.0.zip"
20+
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.31.0/selenium-dotnet-4.31.0.zip"
2721
},
2822
{
29-
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.31.0.jar"
23+
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.31.0/selenium-dotnet-strongnamed-4.31.0.zip"
3024
},
3125
{
32-
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.31.0.zip"
26+
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.31.0/selenium-java-4.31.0.zip"
27+
},
28+
{
29+
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.31.0/selenium-server-4.31.0.jar"
30+
},
31+
{
32+
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.31.0/selenium-server-4.31.0.zip"
3333
}
3434
]
3535
},

dotnet/selenium-dotnet-version.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# BUILD FILE SYNTAX: STARLARK
22

3-
SE_VERSION = "4.31.0"
3+
SE_VERSION = "4.32.0-nightly202504060755"
44
ASSEMBLY_VERSION = "4.0.0.0"
55
SUPPORTED_NET_STANDARD_VERSIONS = ["netstandard2.0"]
66

java/src/org/openqa/selenium/docker/internal/Reference.java

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,24 @@ public class Reference {
3535
private final String name;
3636
private final String tag;
3737
private final String digest;
38+
private final String platform;
3839

3940
@VisibleForTesting
4041
Reference(String domain, String name, String tag, String digest) {
4142
this.domain = Require.nonNull("Domain", domain);
4243
this.name = Require.nonNull("Name", name);
4344
this.tag = tag;
4445
this.digest = digest;
46+
this.platform = getDefaultPlatform();
47+
}
48+
49+
@VisibleForTesting
50+
Reference(String domain, String name, String tag, String digest, String platform) {
51+
this.domain = Require.nonNull("Domain", domain);
52+
this.name = Require.nonNull("Name", name);
53+
this.tag = tag;
54+
this.digest = digest;
55+
this.platform = Require.nonNull("Platform", platform);
4556
}
4657

4758
// Logic taken from https://github.com/distribution/distribution/blob/main/reference/normalize.go
@@ -53,15 +64,15 @@ public static Reference parse(String input) {
5364
String remainder = splitDockerDomain.get("remainder");
5465

5566
String name;
56-
String digest = null;
67+
String digest =
68+
splitDockerDomain.get("digest").isEmpty() ? null : splitDockerDomain.get("digest");
69+
String platform = splitDockerDomain.get("platform");
5770
String tag = DEFAULT_TAG;
5871

59-
int digestSep = remainder.indexOf("@");
6072
int tagSep = remainder.indexOf(":");
61-
if (digestSep > -1 && tagSep > -1) {
62-
digest = remainder.substring(digestSep + 1);
63-
name = remainder.substring(0, digestSep);
73+
if (digest != null) {
6474
tag = null;
75+
name = remainder;
6576
} else if (tagSep > -1) {
6677
tag = remainder.substring(tagSep + 1);
6778
name = remainder.substring(0, tagSep);
@@ -74,12 +85,27 @@ public static Reference parse(String input) {
7485
String.format("Invalid reference format: repository name (%s) must be lowercase", name));
7586
}
7687

77-
return new Reference(domain, name, tag, digest);
88+
return new Reference(domain, name, tag, digest, platform);
7889
}
7990

8091
private static ImmutableMap<String, String> splitDockerDomain(String name) {
8192
String domain;
8293
String remainder;
94+
String platform = getDefaultPlatform();
95+
String digest = "";
96+
97+
// Check if the name contains a platform part
98+
int platformSep = name.lastIndexOf("@");
99+
if (platformSep > -1) {
100+
String[] parts = name.substring(platformSep + 1).split("/");
101+
if (parts.length == 2) {
102+
platform = name.substring(platformSep + 1);
103+
} else if (parts[0].contains(":")) {
104+
digest = name.substring(platformSep + 1);
105+
}
106+
name = name.substring(0, platformSep);
107+
}
108+
83109
int domSep = name.indexOf("/");
84110
String possibleDomain = domSep == -1 ? "" : name.substring(0, domSep);
85111
if (domSep == -1
@@ -99,7 +125,8 @@ private static ImmutableMap<String, String> splitDockerDomain(String name) {
99125
if (DEFAULT_DOMAIN.equals(domain) && !remainder.contains("/")) {
100126
remainder = String.format("%s/%s", DEFAULT_REPO, remainder);
101127
}
102-
return ImmutableMap.of("domain", domain, "remainder", remainder);
128+
return ImmutableMap.of(
129+
"domain", domain, "remainder", remainder, "platform", platform, "digest", digest);
103130
}
104131

105132
public String getDomain() {
@@ -118,6 +145,10 @@ public String getDigest() {
118145
return digest;
119146
}
120147

148+
public String getPlatform() {
149+
return platform;
150+
}
151+
121152
public String getFamiliarName() {
122153
StringBuilder familiar = new StringBuilder();
123154

@@ -142,6 +173,16 @@ public String getFamiliarName() {
142173
return familiar.toString();
143174
}
144175

176+
private static String getDefaultPlatform() {
177+
String arch = System.getProperty("os.arch").toLowerCase();
178+
if (arch.contains("amd64") || arch.contains("x86_64")) {
179+
arch = "amd64";
180+
} else if (arch.contains("arm64") || arch.contains("aarch64")) {
181+
arch = "arm64";
182+
}
183+
return "linux/" + arch;
184+
}
185+
145186
@Override
146187
public String toString() {
147188
return "Reference{"
@@ -157,6 +198,8 @@ public String toString() {
157198
+ ", digest='"
158199
+ digest
159200
+ '\''
201+
+ ", platform='"
202+
+ platform
160203
+ '}';
161204
}
162205

@@ -170,11 +213,12 @@ public boolean equals(Object o) {
170213
return this.domain.equals(that.domain)
171214
&& this.name.equals(that.name)
172215
&& Objects.equals(tag, that.tag)
173-
&& Objects.equals(digest, that.digest);
216+
&& Objects.equals(digest, that.digest)
217+
&& Objects.equals(platform, that.platform);
174218
}
175219

176220
@Override
177221
public int hashCode() {
178-
return Objects.hash(domain, name, tag, digest);
222+
return Objects.hash(domain, name, tag, digest, platform);
179223
}
180224
}

java/src/org/openqa/selenium/docker/v1_41/PullImage.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public void apply(Reference ref) {
5151
HttpRequest req =
5252
new HttpRequest(POST, String.format("/v%s/images/create", DOCKER_API_VERSION))
5353
.addHeader("Content-Type", JSON_UTF_8)
54-
.addQueryParameter("fromImage", image);
54+
.addQueryParameter("fromImage", image)
55+
.addQueryParameter("platform", ref.getPlatform());
5556

5657
if (ref.getDigest() != null) {
5758
req.addQueryParameter("tag", ref.getDigest());

java/test/org/openqa/selenium/docker/internal/ReferenceTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,22 @@ public static Stream<Arguments> data() {
8282
new Reference("localhost:5000", "gouda/brie/cheddar/img", null, sha256),
8383
String.format("localhost:5000/gouda/brie/cheddar/img@%s", sha256)
8484
},
85+
{
86+
"localhost:5000/gouda/brie/cheddar/img:4.30.0-20250101@linux/amd64",
87+
new Reference(
88+
"localhost:5000",
89+
"gouda/brie/cheddar/img",
90+
"4.30.0-20250101",
91+
null,
92+
"linux/amd64"),
93+
"localhost:5000/gouda/brie/cheddar/img:4.30.0-20250101"
94+
},
95+
{
96+
"localhost:5000/gouda/brie/cheddar/img@linux/amd64",
97+
new Reference(
98+
"localhost:5000", "gouda/brie/cheddar/img", "latest", null, "linux/amd64"),
99+
"localhost:5000/gouda/brie/cheddar/img:latest"
100+
},
85101
})
86102
.stream()
87103
.map(Arguments::of);

java/version.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
SE_VERSION = "4.31.0"
1+
SE_VERSION = "4.32.0-SNAPSHOT"
22
TOOLS_JAVA_VERSION = "17"

javascript/selenium-webdriver/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ load("//javascript/private:browsers.bzl", "BROWSERS")
1111

1212
npm_link_all_packages(name = "node_modules")
1313

14-
VERSION = "4.31.0"
14+
VERSION = "4.32.0-nightly202504060755"
1515

1616
BROWSER_VERSIONS = [
1717
"v134",

javascript/selenium-webdriver/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "selenium-webdriver",
3-
"version": "4.31.0",
3+
"version": "4.32.0-nightly202504060755",
44
"description": "The official WebDriver JavaScript bindings from the Selenium project",
55
"license": "Apache-2.0",
66
"keywords": [

py/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ compile_pip_requirements(
6262
],
6363
)
6464

65-
SE_VERSION = "4.31.0"
65+
SE_VERSION = "4.32.0.202504060755"
6666

6767
BROWSER_VERSIONS = [
6868
"v134",

py/docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
# built documents.
5757
#
5858
# The short X.Y version.
59-
version = '4.31'
59+
version = '4.32'
6060
# The full version, including alpha/beta/rc tags.
61-
release = '4.31.0'
61+
release = '4.32.0.202504060755'
6262

6363
# The language for content autogenerated by Sphinx. Refer to documentation
6464
# for a list of supported languages.

0 commit comments

Comments
 (0)