Skip to content

Commit 6554585

Browse files
authored
Merge branch 'main' into refactor-ccr-ds-tests
2 parents 4256fe4 + 7d466c9 commit 6554585

File tree

205 files changed

+3136
-2952
lines changed

Some content is hidden

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

205 files changed

+3136
-2952
lines changed

.buildkite/scripts/dra-workflow.trigger.sh

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,34 @@
22

33
set -euo pipefail
44

5-
echo "steps:"
6-
75
source .buildkite/scripts/branches.sh
86

7+
# We use that filtering to keep different schedule for different branches
8+
if [ -n "${INCLUDED_BRANCHES:-}" ]; then
9+
# If set, only trigger the pipeline for the specified branches
10+
IFS=',' read -r -a BRANCHES <<< "${INCLUDED_BRANCHES}"
11+
elif [ -n "${EXCLUDED_BRANCHES:-}" ]; then
12+
# If set, listed branches will be excluded from the list of branches in branches.json
13+
IFS=',' read -r -a EXCLUDED_BRANCHES <<< "${EXCLUDED_BRANCHES}"
14+
FILTERED_BRANCHES=()
15+
for BRANCH in "${BRANCHES[@]}"; do
16+
EXCLUDE=false
17+
for EXCLUDED_BRANCH in "${EXCLUDED_BRANCHES[@]}"; do
18+
if [ "$BRANCH" == "$EXCLUDED_BRANCH" ]; then
19+
EXCLUDE=true
20+
break
21+
fi
22+
done
23+
if [ "$EXCLUDE" = false ]; then
24+
FILTERED_BRANCHES+=("$BRANCH")
25+
fi
26+
done
27+
BRANCHES=("${FILTERED_BRANCHES[@]}")
28+
fi
29+
30+
31+
echo "steps:"
32+
933
for BRANCH in "${BRANCHES[@]}"; do
1034
INTAKE_PIPELINE_SLUG="elasticsearch-intake"
1135
BUILD_JSON=$(curl -sH "Authorization: Bearer ${BUILDKITE_API_TOKEN}" "https://api.buildkite.com/v2/organizations/elastic/pipelines/${INTAKE_PIPELINE_SLUG}/builds?branch=${BRANCH}&state=passed&per_page=1" | jq '.[0] | {commit: .commit, url: .web_url}')

BUILDING.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ In case of updating a dependency, ensure to remove the unused entry of the outda
8282

8383
You can also automate the generation of this entry by running your build using the `--write-verification-metadata` commandline option:
8484
```
85-
>./gradlew --write-verification-metadata sha256 precommit
85+
./gradlew --write-verification-metadata sha256 precommit
8686
```
8787

8888
The `--write-verification-metadata` Gradle option is generally able to resolve reachable configurations,
@@ -92,10 +92,10 @@ uses the changed dependencies. In most cases, `precommit` or `check` are good ca
9292
We prefer sha256 checksums as md5 and sha1 are not considered safe anymore these days. The generated entry
9393
will have the `origin` attribute been set to `Generated by Gradle`.
9494

95-
>A manual confirmation of the Gradle generated checksums is currently not mandatory.
96-
>If you want to add a level of verification you can manually confirm the checksum (e.g. by looking it up on the website of the library)
97-
>Please replace the content of the `origin` attribute by `official site` in that case.
98-
>
95+
> [!Tip]
96+
> A manual confirmation of the Gradle generated checksums is currently not mandatory.
97+
> If you want to add a level of verification you can manually confirm the checksum (e.g. by looking it up on the website of the library)
98+
> Please replace the content of the `origin` attribute by `official site` in that case.
9999
100100
#### Custom plugin and task implementations
101101

@@ -229,13 +229,9 @@ In addition to snapshot builds JitPack supports building Pull Requests. Simply u
229229
3. Run the Gradle build as needed. Keep in mind the initial resolution might take a bit longer as this needs to be built
230230
by JitPack in the background before we can resolve the adhoc built dependency.
231231

232-
---
233-
234-
**NOTE**
235-
236-
You should only use that approach locally or on a developer branch for production dependencies as we do
232+
> [!Note]
233+
> You should only use that approach locally or on a developer branch for production dependencies as we do
237234
not want to ship unreleased libraries into our releases.
238-
---
239235

240236
#### How to use a custom third party artifact?
241237

@@ -265,12 +261,9 @@ allprojects {
265261
```
266262
4. Run the Gradle build as needed with `--write-verification-metadata` to ensure the Gradle dependency verification does not fail on your custom dependency.
267263

268-
---
269-
**NOTE**
270-
271-
As Gradle prefers to use modules whose descriptor has been created from real meta-data rather than being generated,
264+
> [!Note]
265+
> As Gradle prefers to use modules whose descriptor has been created from real meta-data rather than being generated,
272266
flat directory repositories cannot be used to override artifacts with real meta-data from other repositories declared in the build.
273-
For example, if Gradle finds only `jmxri-1.2.1.jar` in a flat directory repository, but `jmxri-1.2.1.pom` in another repository
267+
> For example, if Gradle finds only `jmxri-1.2.1.jar` in a flat directory repository, but `jmxri-1.2.1.pom` in another repository
274268
that supports meta-data, it will use the second repository to provide the module.
275-
Therefore, it is recommended to declare a version that is not resolvable from public repositories we use (e.g. Maven Central)
276-
---
269+
> Therefore, it is recommended to declare a version that is not resolvable from public repositories we use (e.g. Maven Central)

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ It is important that the only code covered by the Elastic licence is contained
401401
within the top-level `x-pack` directory. The build will fail its pre-commit
402402
checks if contributed code does not have the appropriate license headers.
403403

404-
> **NOTE:** If you have imported the project into IntelliJ IDEA the project will
404+
> [!NOTE]
405+
> If you have imported the project into IntelliJ IDEA the project will
405406
> be automatically configured to add the correct license header to new source
406407
> files based on the source location.
407408

benchmarks/src/main/java/org/elasticsearch/benchmark/esql/QueryPlanningBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private LogicalPlan plan(String query) {
123123
}
124124

125125
@Benchmark
126-
public void run(Blackhole blackhole) {
126+
public void manyFields(Blackhole blackhole) {
127127
blackhole.consume(plan("FROM test | LIMIT 10"));
128128
}
129129
}

build-tools-internal/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=fba8464465835e74f7270bbf43d6d8a8d7709ab0a43ce1aa3323f73e9aa0c612
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
3+
distributionSha256Sum=efe9a3d147d948d7528a9887fa35abcf24ca1a43ad06439996490f77569b02d1
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
import org.gradle.api.tasks.SkipWhenEmpty;
2626
import org.gradle.api.tasks.TaskAction;
2727
import org.gradle.api.tasks.util.PatternFilterable;
28-
import org.gradle.api.tasks.util.PatternSet;
29-
import org.gradle.internal.Factory;
28+
import org.gradle.api.tasks.util.internal.PatternSetFactory;
3029

3130
import java.io.File;
3231
import java.io.IOException;
@@ -65,14 +64,14 @@ public class CopyRestApiTask extends DefaultTask {
6564
@Inject
6665
public CopyRestApiTask(
6766
ProjectLayout projectLayout,
68-
Factory<PatternSet> patternSetFactory,
67+
PatternSetFactory patternSetFactory,
6968
FileSystemOperations fileSystemOperations,
7069
ObjectFactory objectFactory
7170
) {
7271
this.include = objectFactory.listProperty(String.class);
7372
this.outputResourceDir = objectFactory.directoryProperty();
7473
this.additionalYamlTestsDir = objectFactory.directoryProperty();
75-
this.patternSet = patternSetFactory.create();
74+
this.patternSet = patternSetFactory.createPatternSet();
7675
this.projectLayout = projectLayout;
7776
this.fileSystemOperations = fileSystemOperations;
7877
}

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
import org.gradle.api.tasks.SkipWhenEmpty;
3030
import org.gradle.api.tasks.TaskAction;
3131
import org.gradle.api.tasks.util.PatternFilterable;
32-
import org.gradle.api.tasks.util.PatternSet;
33-
import org.gradle.internal.Factory;
32+
import org.gradle.api.tasks.util.internal.PatternSetFactory;
3433

3534
import java.io.File;
3635
import java.util.Map;
@@ -66,25 +65,25 @@ public abstract class CopyRestTestsTask extends DefaultTask {
6665
private final ProjectLayout projectLayout;
6766
private final FileSystemOperations fileSystemOperations;
6867

69-
@Inject
70-
public abstract FileOperations getFileOperations();
71-
7268
@Inject
7369
public CopyRestTestsTask(
7470
ProjectLayout projectLayout,
75-
Factory<PatternSet> patternSetFactory,
71+
PatternSetFactory patternSetFactory,
7672
FileSystemOperations fileSystemOperations,
7773
ObjectFactory objectFactory
7874
) {
7975
this.includeCore = objectFactory.listProperty(String.class);
8076
this.includeXpack = objectFactory.listProperty(String.class);
8177
this.outputResourceDir = objectFactory.directoryProperty();
82-
this.corePatternSet = patternSetFactory.create();
83-
this.xpackPatternSet = patternSetFactory.create();
78+
this.corePatternSet = patternSetFactory.createPatternSet();
79+
this.xpackPatternSet = patternSetFactory.createPatternSet();
8480
this.projectLayout = projectLayout;
8581
this.fileSystemOperations = fileSystemOperations;
8682
}
8783

84+
@Inject
85+
public abstract FileOperations getFileOperations();
86+
8887
@Input
8988
public ListProperty<String> getIncludeCore() {
9089
return includeCore;

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/RestCompatTestTransformTask.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
import org.gradle.api.tasks.TaskAction;
5959
import org.gradle.api.tasks.util.PatternFilterable;
6060
import org.gradle.api.tasks.util.PatternSet;
61-
import org.gradle.internal.Factory;
61+
import org.gradle.api.tasks.util.internal.PatternSetFactory;
6262

6363
import java.io.File;
6464
import java.io.IOException;
@@ -98,25 +98,23 @@ public abstract class RestCompatTestTransformTask extends DefaultTask {
9898
// PatternFilterable -> list of full test names and reasons. Needed for 1 pattern may include many tests and reasons
9999
private final Map<PatternFilterable, List<Pair<String, String>>> skippedTestByTestNameTransformations = new HashMap<>();
100100

101-
@Inject
102-
protected Factory<PatternSet> getPatternSetFactory() {
103-
throw new UnsupportedOperationException();
104-
}
105-
106101
@Inject
107102
public RestCompatTestTransformTask(FileSystemOperations fileSystemOperations, ObjectFactory objectFactory) {
108103
this.fileSystemOperations = fileSystemOperations;
109104
this.compatibleVersion = Version.fromString(VersionProperties.getVersions().get("elasticsearch")).getMajor() - 1;
110105
this.sourceDirectory = objectFactory.directoryProperty();
111106
this.outputDirectory = objectFactory.directoryProperty();
112-
this.testPatternSet = getPatternSetFactory().create();
107+
this.testPatternSet = getPatternSetFactory().createPatternSet();
113108
this.testPatternSet.include("/*" + "*/*.yml"); // concat these strings to keep build from thinking this is invalid javadoc
114109
// always inject compat headers
115110
headers.put("Content-Type", "application/vnd.elasticsearch+json;compatible-with=" + compatibleVersion);
116111
headers.put("Accept", "application/vnd.elasticsearch+json;compatible-with=" + compatibleVersion);
117112
getTransformations().add(new InjectHeaders(headers, Sets.newHashSet(RestCompatTestTransformTask::doesNotHaveCatOperation)));
118113
}
119114

115+
@Inject
116+
protected abstract PatternSetFactory getPatternSetFactory();
117+
120118
private static boolean doesNotHaveCatOperation(ObjectNode doNodeValue) {
121119
final Iterator<String> fieldNamesIterator = doNodeValue.fieldNames();
122120
while (fieldNamesIterator.hasNext()) {
@@ -144,7 +142,7 @@ public void skipTest(String fullTestName, String reason) {
144142
);
145143
}
146144

147-
PatternSet skippedPatternSet = getPatternSetFactory().create();
145+
PatternSet skippedPatternSet = getPatternSetFactory().createPatternSet();
148146
// create file patterns for all a1/a2/a3/b.yml possibilities.
149147
for (int i = testParts.length - 1; i > 1; i--) {
150148
final String lastPart = testParts[i];
@@ -158,7 +156,7 @@ public void skipTest(String fullTestName, String reason) {
158156
}
159157

160158
public void skipTestsByFilePattern(String filePattern, String reason) {
161-
PatternSet skippedPatternSet = getPatternSetFactory().create();
159+
PatternSet skippedPatternSet = getPatternSetFactory().createPatternSet();
162160
skippedPatternSet.include(filePattern);
163161
skippedTestByFilePatternTransformations.put(skippedPatternSet, reason);
164162
}

build-tools-internal/src/main/resources/checkstyle.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@
6868

6969
<!-- Unused imports are forbidden -->
7070
<module name="UnusedImports" />
71+
<module name="SuppressionCommentFilter">
72+
<property name="offCommentFormat" value="begin generated imports"/>
73+
<property name="onCommentFormat" value="end generated imports"/>
74+
<property name="checkFormat" value="UnusedImports"/>
75+
</module>
7176

7277
<!-- Non-inner classes must be in files that match their names. -->
7378
<module name="OuterTypeFilename" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.12.1
1+
8.14

0 commit comments

Comments
 (0)