Skip to content

Commit 71d15e1

Browse files
Merge branch 'main' into subquery-in-from
2 parents c489ab1 + 3fcd348 commit 71d15e1

File tree

140 files changed

+3889
-1729
lines changed

Some content is hidden

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

140 files changed

+3889
-1729
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchBuildCompletePlugin.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@
3838
import java.io.FileNotFoundException;
3939
import java.io.IOException;
4040
import java.io.OutputStream;
41+
import java.io.UncheckedIOException;
42+
import java.nio.file.FileVisitResult;
4143
import java.nio.file.Files;
4244
import java.nio.file.Path;
45+
import java.nio.file.SimpleFileVisitor;
46+
import java.nio.file.attribute.BasicFileAttributes;
4347
import java.util.ArrayList;
4448
import java.util.Arrays;
4549
import java.util.List;
@@ -66,7 +70,7 @@ public void apply(Project target) {
6670
? System.getenv("BUILD_NUMBER")
6771
: System.getenv("BUILDKITE_BUILD_NUMBER");
6872
String performanceTest = System.getenv("BUILD_PERFORMANCE_TEST");
69-
if (buildNumber != null && performanceTest == null && GradleUtils.isIncludedBuild(target) == false && OS.current() != OS.WINDOWS) {
73+
if (buildNumber != null && performanceTest == null && GradleUtils.isIncludedBuild(target) == false) {
7074
File targetFile = calculateTargetFile(target, buildNumber);
7175
File projectDir = target.getProjectDir();
7276
File gradleWorkersDir = new File(target.getGradle().getGradleUserHomeDir(), "workers/");
@@ -102,6 +106,23 @@ private File calculateTargetFile(Project target, String buildNumber) {
102106
}
103107

104108
private List<File> resolveProjectLogs(File projectDir) {
109+
// HACK: Some tests leave behind symlinks, and gradle throws an exception if it encounters symlinks.
110+
// Here we remove them before collecting logs to upload. We could instead build our own path matcher
111+
// but that seemed more complex than just deleting the irrelevant files.
112+
try {
113+
Files.walkFileTree(projectDir.toPath(), new SimpleFileVisitor<>() {
114+
@Override
115+
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
116+
if (Files.isSymbolicLink(file)) {
117+
Files.delete(file);
118+
}
119+
return FileVisitResult.CONTINUE;
120+
}
121+
});
122+
} catch (IOException e) {
123+
throw new UncheckedIOException(e);
124+
}
125+
105126
var projectDirFiles = getFileOperations().fileTree(projectDir);
106127
projectDirFiles.include("**/*.hprof");
107128
projectDirFiles.include("**/build/reports/configuration-cache/**");
@@ -276,7 +297,12 @@ private static void createBuildArchiveTar(List<File> files, File projectDir, Fil
276297

277298
@NotNull
278299
private static String calculateArchivePath(Path path, Path projectPath) {
279-
return path.startsWith(projectPath) ? projectPath.relativize(path).toString() : path.getFileName().toString();
300+
String archivePath = path.startsWith(projectPath) ? projectPath.relativize(path).toString() : path.getFileName().toString();
301+
if (OS.current() == OS.WINDOWS) {
302+
// tar always uses forward slashes
303+
archivePath = archivePath.replace("\\", "/");
304+
}
305+
return archivePath;
280306
}
281307
}
282308
}

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/TransportVersionDefinition.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ public static TransportVersionDefinition fromString(Path file, String contents,
2222

2323
String idsLine = null;
2424
if (contents.isEmpty() == false) {
25-
String[] lines = contents.split(System.lineSeparator());
25+
// Regardless of whether windows newlines exist (they could be added by git), we split on line feed.
26+
// All we care about skipping lines with the comment character, so the remaining \r won't matter
27+
String[] lines = contents.split("\n");
2628
for (String line : lines) {
27-
line = line.replaceAll("\\s+", "");
29+
line = line.strip();
2830
if (line.startsWith("#") == false) {
2931
idsLine = line;
3032
break;

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/TransportVersionUpperBound.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ public static TransportVersionUpperBound fromString(Path file, String contents)
2424
String branch = filename.substring(slashIndex == -1 ? 0 : (slashIndex + 1), filename.length() - 4);
2525

2626
String idsLine = null;
27-
String[] lines = contents.split(System.lineSeparator());
27+
// Regardless of whether windows newlines exist (they could be added by git), we split on line feed.
28+
// All we care about skipping lines with the comment character, so the remaining \r won't matter
29+
String[] lines = contents.split("\n");
2830
for (String line : lines) {
29-
line = line.replaceAll("\\s+", "");
31+
line = line.strip();
3032
if (line.startsWith("#") == false) {
3133
idsLine = line;
3234
break;

docs/changelog/134361.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 134361
2+
summary: Add `ThreadWatchdog` to `ClusterApplierService`
3+
area: Cluster Coordination
4+
type: enhancement
5+
issues: []

docs/changelog/135644.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 135644
2+
summary: Add small optimizations to `PUT _component_template` API
3+
area: Indices APIs
4+
type: enhancement
5+
issues: []

docs/changelog/135873.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 135873
2+
summary: Convert `BytesTransportResponse` when proxying response from/to local node
3+
area: "Network"
4+
type: bug
5+
issues: []

docs/changelog/135987.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 135987
2+
summary: Avoid rewrite `round_to` with expensive queries
3+
area: ES|QL
4+
type: bug
5+
issues: []

docs/reference/query-languages/esql/_snippets/functions/parameters/top.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/types/top.md

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/images/functions/top.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)