Skip to content

Commit cd05e9e

Browse files
authored
Merge branch 'elastic:main' into bugfix/highlighting-for-constant_keyword-field-type
2 parents c932add + a4ade1d commit cd05e9e

File tree

648 files changed

+10406
-4604
lines changed

Some content is hidden

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

648 files changed

+10406
-4604
lines changed

.ci/bwcVersions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ BWC_VERSION:
6060
- "7.17.9"
6161
- "7.17.10"
6262
- "7.17.11"
63+
- "7.17.12"
6364
- "8.0.0"
6465
- "8.0.1"
6566
- "8.1.0"
@@ -90,5 +91,6 @@ BWC_VERSION:
9091
- "8.8.0"
9192
- "8.8.1"
9293
- "8.8.2"
94+
- "8.8.3"
9395
- "8.9.0"
9496
- "8.10.0"

.ci/snapshotBwcVersions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
BWC_VERSION:
2-
- "7.17.11"
3-
- "8.8.2"
2+
- "7.17.12"
3+
- "8.8.3"
44
- "8.9.0"
55
- "8.10.0"

build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/LicenseHeadersTask.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,11 @@
5050
import java.nio.file.Files;
5151
import java.util.ArrayList;
5252
import java.util.Arrays;
53-
import java.util.HashMap;
5453
import java.util.List;
55-
import java.util.Map;
5654
import java.util.stream.Collectors;
5755
import javax.inject.Inject;
5856
import java.io.Serializable;
5957

60-
import javax.inject.Inject;
61-
6258
/**
6359
* Checks files for license headers..
6460
*/
@@ -193,9 +189,8 @@ public void runRat() {
193189
boolean unApprovedLicenses = stats.getNumUnApproved() > 0;
194190
if (unknownLicenses || unApprovedLicenses) {
195191
getLogger().error("The following files contain unapproved license headers:");
196-
unapprovedFiles(repFile).stream().forEachOrdered(unapprovedFile -> getLogger().error(unapprovedFile));
197-
throw new GradleException("Check failed. License header problems were found. Full details: " +
198-
repFile.getAbsolutePath());
192+
unapprovedFiles(repFile).forEach(getLogger()::error);
193+
throw new GradleException("Check failed. License header problems were found. Full details: " + repFile.getAbsolutePath());
199194
}
200195
}
201196

build-tools-internal/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ dependencies {
240240
// ensuring brought asm version brought in by spock is up-to-date
241241
testImplementation buildLibs.asm
242242
integTestImplementation buildLibs.asm
243-
integTestImplementation('org.ow2.asm:asm:9.4')
243+
integTestImplementation('org.ow2.asm:asm:9.5')
244244
api("org.yaml:snakeyaml") {
245245
version { strictly(versions.snakeyaml) }
246246
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.util.Optional;
3535
import java.util.Set;
3636
import java.util.stream.Collectors;
37+
import java.util.stream.Stream;
3738

3839
import javax.inject.Inject;
3940

@@ -287,7 +288,7 @@ static Map<String, String> parseOsRelease(final List<String> osReleaseLines) {
287288
*/
288289
private Optional<String> getDockerPath() {
289290
// Check if the Docker binary exists
290-
return List.of(DOCKER_BINARIES).stream().filter(path -> new File(path).exists()).findFirst();
291+
return Stream.of(DOCKER_BINARIES).filter(path -> new File(path).exists()).findFirst();
291292
}
292293

293294
/**
@@ -298,7 +299,7 @@ private Optional<String> getDockerPath() {
298299
*/
299300
private Optional<String> getDockerComposePath() {
300301
// Check if the Docker binary exists
301-
return List.of(DOCKER_COMPOSE_BINARIES).stream().filter(path -> new File(path).exists()).findFirst();
302+
return Stream.of(DOCKER_COMPOSE_BINARIES).filter(path -> new File(path).exists()).findFirst();
302303
}
303304

304305
private void throwDockerRequiredException(final String message) {

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

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -114,24 +114,19 @@ public void checkInvalidPatterns() throws IOException {
114114
} catch (UncheckedIOException e) {
115115
throw new IllegalArgumentException("Failed to read " + f + " as UTF_8", e);
116116
}
117-
List<Integer> invalidLines = IntStream.range(0, lines.size())
118-
.filter(i -> allPatterns.matcher(lines.get(i)).find())
119-
.boxed()
120-
.collect(Collectors.toList());
121117

122118
URI baseUri = getRootDir().orElse(projectLayout.getProjectDirectory().getAsFile()).get().toURI();
123119
String path = baseUri.relativize(f.toURI()).toString();
124-
failures.addAll(
125-
invalidLines.stream()
126-
.map(l -> new AbstractMap.SimpleEntry<>(l + 1, lines.get(l)))
127-
.flatMap(
128-
kv -> patterns.entrySet()
129-
.stream()
130-
.filter(p -> Pattern.compile(p.getValue()).matcher(kv.getValue()).find())
131-
.map(p -> "- " + p.getKey() + " on line " + kv.getKey() + " of " + path)
132-
)
133-
.collect(Collectors.toList())
134-
);
120+
IntStream.range(0, lines.size())
121+
.filter(i -> allPatterns.matcher(lines.get(i)).find())
122+
.mapToObj(l -> new AbstractMap.SimpleEntry<>(l + 1, lines.get(l)))
123+
.flatMap(
124+
kv -> patterns.entrySet()
125+
.stream()
126+
.filter(p -> Pattern.compile(p.getValue()).matcher(kv.getValue()).find())
127+
.map(p -> "- " + p.getKey() + " on line " + kv.getKey() + " of " + path)
128+
)
129+
.forEach(failures::add);
135130
}
136131
if (failures.isEmpty() == false) {
137132
throw new GradleException("Found invalid patterns:\n" + String.join("\n", failures));

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ private static ModuleReference esModuleFor(File filePath) {
159159
return ModuleFinder.of(filePath.toPath())
160160
.findAll()
161161
.stream()
162-
.sorted(Comparator.comparing(ModuleReference::descriptor))
163-
.findFirst()
162+
.min(Comparator.comparing(ModuleReference::descriptor))
164163
.orElseThrow(() -> new GradleException("module not found in " + filePath));
165164
}
166165
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import java.util.Set;
4949
import java.util.TreeSet;
5050
import java.util.function.Consumer;
51-
import java.util.stream.Collectors;
5251

5352
import javax.inject.Inject;
5453

@@ -234,7 +233,7 @@ private void filterSplitPackages(Map<String, Set<String>> splitPackages) {
234233
String lastPackageName = null;
235234
Set<String> currentClasses = null;
236235
boolean filterErrorsFound = false;
237-
for (String fqcn : getParameters().getIgnoreClasses().get().stream().sorted().collect(Collectors.toList())) {
236+
for (String fqcn : getParameters().getIgnoreClasses().get().stream().sorted().toList()) {
238237
int lastDot = fqcn.lastIndexOf('.');
239238
if (lastDot == -1) {
240239
LOGGER.error("Missing package in classname in split package ignores: " + fqcn);

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import java.util.List;
3939
import java.util.function.Predicate;
4040
import java.util.stream.Collectors;
41+
import java.util.stream.Stream;
4142

4243
import javax.inject.Inject;
4344

@@ -128,7 +129,7 @@ private void assertNoMissmatchingTest(List<? extends Class<?>> testClassesCandid
128129
var mismatchingBaseClasses = testClassesCandidate.stream()
129130
.filter(testClassDefaultPredicate)
130131
.filter(TestingConventionsCheckWorkAction::seemsLikeATest)
131-
.collect(Collectors.toList());
132+
.toList();
132133
if (mismatchingBaseClasses.isEmpty() == false) {
133134
throw new GradleException(
134135
"Following test classes do not extend any supported base class:\n\t"
@@ -141,7 +142,7 @@ private void assertMatchesSuffix(List<String> suffixes, List<Class> matchingBase
141142
// ensure base class matching do match suffix
142143
var matchingBaseClassNotMatchingSuffix = matchingBaseClass.stream()
143144
.filter(c -> suffixes.stream().allMatch(s -> c.getName().endsWith(s) == false))
144-
.collect(Collectors.toList());
145+
.toList();
145146
if (matchingBaseClassNotMatchingSuffix.isEmpty() == false) {
146147
throw new GradleException(
147148
"Following test classes do not match naming convention to use suffix "
@@ -202,8 +203,7 @@ private static boolean matchesTestMethodNamingConvention(Method method) {
202203
}
203204

204205
private static boolean isAnnotated(Method method, Class<?> annotation) {
205-
return List.of(method.getAnnotations())
206-
.stream()
206+
return Stream.of(method.getAnnotations())
207207
.anyMatch(presentAnnotation -> annotation.isAssignableFrom(presentAnnotation.getClass()));
208208
}
209209

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -389,12 +389,11 @@ private List<ElasticsearchDistribution> configureDistributions(Project project)
389389
List<ElasticsearchDistribution> currentDistros = new ArrayList<>();
390390

391391
for (Architecture architecture : Architecture.values()) {
392-
ALL_INTERNAL.stream()
393-
.forEach(
394-
type -> currentDistros.add(
395-
createDistro(distributions, architecture, type, null, true, VersionProperties.getElasticsearch())
396-
)
397-
);
392+
ALL_INTERNAL.forEach(
393+
type -> currentDistros.add(
394+
createDistro(distributions, architecture, type, null, true, VersionProperties.getElasticsearch())
395+
)
396+
);
398397
}
399398

400399
for (Architecture architecture : Architecture.values()) {

0 commit comments

Comments
 (0)