Skip to content

Commit

Permalink
Merge branch 'main' into async-search-status-permission
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Mar 27, 2024
2 parents 1e97db5 + 2f0a7b8 commit 51493f0
Show file tree
Hide file tree
Showing 735 changed files with 16,117 additions and 7,193 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipelines/intake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ steps:
timeout_in_minutes: 300
matrix:
setup:
BWC_VERSION: ["7.17.19", "8.12.3", "8.13.0", "8.14.0"]
BWC_VERSION: ["7.17.20", "8.13.1", "8.14.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down
28 changes: 22 additions & 6 deletions .buildkite/pipelines/periodic-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,22 @@ steps:
env:
BWC_VERSION: 7.17.19

- label: "{{matrix.image}} / 7.17.20 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v7.17.20
timeout_in_minutes: 300
matrix:
setup:
image:
- rocky-8
- ubuntu-2004
agents:
provider: gcp
image: family/elasticsearch-{{matrix.image}}
machineType: custom-16-32768
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 7.17.20

- label: "{{matrix.image}} / 8.0.0 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.0.0
timeout_in_minutes: 300
Expand Down Expand Up @@ -1873,8 +1889,8 @@ steps:
env:
BWC_VERSION: 8.12.2

- label: "{{matrix.image}} / 8.12.3 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.12.3
- label: "{{matrix.image}} / 8.13.0 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.13.0
timeout_in_minutes: 300
matrix:
setup:
Expand All @@ -1887,10 +1903,10 @@ steps:
machineType: custom-16-32768
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 8.12.3
BWC_VERSION: 8.13.0

- label: "{{matrix.image}} / 8.13.0 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.13.0
- label: "{{matrix.image}} / 8.13.1 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.13.1
timeout_in_minutes: 300
matrix:
setup:
Expand All @@ -1903,7 +1919,7 @@ steps:
machineType: custom-16-32768
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 8.13.0
BWC_VERSION: 8.13.1

- label: "{{matrix.image}} / 8.14.0 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.14.0
Expand Down
26 changes: 18 additions & 8 deletions .buildkite/pipelines/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,16 @@ steps:
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 7.17.19
- label: 7.17.20 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v7.17.20#bwcTest
timeout_in_minutes: 300
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
machineType: n1-standard-32
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 7.17.20
- label: 8.0.0 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.0.0#bwcTest
timeout_in_minutes: 300
Expand Down Expand Up @@ -1152,26 +1162,26 @@ steps:
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 8.12.2
- label: 8.12.3 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.12.3#bwcTest
- label: 8.13.0 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.13.0#bwcTest
timeout_in_minutes: 300
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
machineType: n1-standard-32
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 8.12.3
- label: 8.13.0 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.13.0#bwcTest
BWC_VERSION: 8.13.0
- label: 8.13.1 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.13.1#bwcTest
timeout_in_minutes: 300
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
machineType: n1-standard-32
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 8.13.0
BWC_VERSION: 8.13.1
- label: 8.14.0 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.14.0#bwcTest
timeout_in_minutes: 300
Expand Down Expand Up @@ -1246,7 +1256,7 @@ steps:
setup:
ES_RUNTIME_JAVA:
- openjdk17
BWC_VERSION: ["7.17.19", "8.12.3", "8.13.0", "8.14.0"]
BWC_VERSION: ["7.17.20", "8.13.1", "8.14.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down Expand Up @@ -1290,7 +1300,7 @@ steps:
- openjdk17
- openjdk21
- openjdk22
BWC_VERSION: ["7.17.19", "8.12.3", "8.13.0", "8.14.0"]
BWC_VERSION: ["7.17.20", "8.13.1", "8.14.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down
3 changes: 2 additions & 1 deletion .ci/bwcVersions
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ BWC_VERSION:
- "7.17.17"
- "7.17.18"
- "7.17.19"
- "7.17.20"
- "8.0.0"
- "8.0.1"
- "8.1.0"
Expand Down Expand Up @@ -114,6 +115,6 @@ BWC_VERSION:
- "8.12.0"
- "8.12.1"
- "8.12.2"
- "8.12.3"
- "8.13.0"
- "8.13.1"
- "8.14.0"
5 changes: 2 additions & 3 deletions .ci/snapshotBwcVersions
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
BWC_VERSION:
- "7.17.19"
- "8.12.3"
- "8.13.0"
- "7.17.20"
- "8.13.1"
- "8.14.0"
3 changes: 0 additions & 3 deletions branches.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
{
"branch": "8.13"
},
{
"branch": "8.12"
},
{
"branch": "7.17"
}
Expand Down
4 changes: 2 additions & 2 deletions build-tools-internal/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=85719317abd2112f021d4f41f09ec370534ba288432065f4b477b6a3b652910d
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionSha256Sum=194717442575a6f96e1c1befa2c30e9a4fc90f701d7aee33eb879b79e7ff05c0
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

package org.elasticsearch.gradle.internal.shadow;

import com.github.jengelman.gradle.plugins.shadow.ShadowStats;
import com.github.jengelman.gradle.plugins.shadow.relocation.RelocateClassContext;
import com.github.jengelman.gradle.plugins.shadow.relocation.Relocator;
import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer;
import com.github.jengelman.gradle.plugins.shadow.transformers.TransformerContext;

import org.apache.commons.io.IOUtils;
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipOutputStream;
import org.gradle.api.file.FileTreeElement;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

public class XmlClassRelocationTransformer implements Transformer {

boolean hasTransformedResource = false;

private Document doc;

private String resource;

@Override
public boolean canTransformResource(FileTreeElement element) {
String path = element.getRelativePath().getPathString();
if (resource != null && resource.equals(path)) {
return true;
}
return false;
}

@Override
public void transform(TransformerContext context) {
try {
BufferedInputStream bis = new BufferedInputStream(context.getIs());
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
doc = dBuilder.parse(bis);
doc.getDocumentElement().normalize();
Node root = doc.getDocumentElement();
walkThroughNodes(root, context);
if (hasTransformedResource == false) {
this.doc = null;
}
} catch (Exception e) {
throw new RuntimeException("Error parsing xml file in " + context.getIs(), e);
}
}

private static String getRelocatedClass(String className, TransformerContext context) {
List<Relocator> relocators = context.getRelocators();
ShadowStats stats = context.getStats();
if (className != null && className.length() > 0 && relocators != null) {
for (Relocator relocator : relocators) {
if (relocator.canRelocateClass(className)) {
RelocateClassContext relocateClassContext = new RelocateClassContext(className, stats);
return relocator.relocateClass(relocateClassContext);
}
}
}

return className;
}

private void walkThroughNodes(Node node, TransformerContext context) {
if (node.getNodeType() == Node.TEXT_NODE) {
String nodeValue = node.getNodeValue();
if (nodeValue.isBlank() == false) {
String relocatedClass = getRelocatedClass(nodeValue, context);
if (relocatedClass.equals(nodeValue) == false) {
node.setNodeValue(relocatedClass);
hasTransformedResource = true;
}
}
}
NodeList nodeList = node.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
Node currentNode = nodeList.item(i);
walkThroughNodes(currentNode, context);
}
}

@Override
public boolean hasTransformedResource() {
return hasTransformedResource;
}

@Override
public void modifyOutputStream(ZipOutputStream os, boolean preserveFileTimestamps) {
ZipEntry entry = new ZipEntry(resource);
entry.setTime(TransformerContext.getEntryTimestamp(preserveFileTimestamps, entry.getTime()));

try {
// Write the content back to the XML file
TransformerFactory transformerFactory = TransformerFactory.newInstance();
DOMSource source = new DOMSource(doc);

// Result stream will be a ByteArrayOutputStream
ByteArrayOutputStream baos = new ByteArrayOutputStream();
StreamResult result = new StreamResult(baos);
// Do the transformation and serialization
transformerFactory.newTransformer().transform(source, result);
os.putNextEntry(entry);
IOUtils.write(baos.toByteArray(), os);
os.closeEntry();
} catch (IOException e) {
throw new RuntimeException(e);
} catch (TransformerException e) {
throw new RuntimeException(e);
} finally {
hasTransformedResource = false;
doc = null;
}
}

@Override
public String getName() {
return getClass().getSimpleName();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package org.elasticsearch.gradle.internal.test.rest;

import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask;
import org.elasticsearch.gradle.internal.test.RestIntegTestTask;
import org.elasticsearch.gradle.util.GradleUtils;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
Expand Down Expand Up @@ -40,13 +40,7 @@ public void apply(Project project) {
}

// setup the javaRestTest task
// we use a StandloneRestIntegTestTask here so that the conventions of RestTestBasePlugin don't create a test cluster
TaskProvider<StandaloneRestIntegTestTask> testTask = registerTestTask(
project,
javaTestSourceSet,
SOURCE_SET_NAME,
StandaloneRestIntegTestTask.class
);
TaskProvider<RestIntegTestTask> testTask = registerTestTask(project, javaTestSourceSet, SOURCE_SET_NAME, RestIntegTestTask.class);

project.getTasks().named(JavaBasePlugin.CHECK_TASK_NAME).configure(check -> check.dependsOn(testTask));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package org.elasticsearch.gradle.internal.test.rest;

import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask;
import org.elasticsearch.gradle.internal.test.RestIntegTestTask;
import org.elasticsearch.gradle.util.GradleUtils;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
Expand Down Expand Up @@ -36,12 +36,7 @@ public void apply(Project project) {
SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class);
SourceSet yamlTestSourceSet = sourceSets.create(SOURCE_SET_NAME);

TaskProvider<StandaloneRestIntegTestTask> testTask = registerTestTask(
project,
yamlTestSourceSet,
SOURCE_SET_NAME,
StandaloneRestIntegTestTask.class
);
TaskProvider<RestIntegTestTask> testTask = registerTestTask(project, yamlTestSourceSet, SOURCE_SET_NAME, RestIntegTestTask.class);

project.getTasks().named(JavaBasePlugin.CHECK_TASK_NAME).configure(check -> check.dependsOn(testTask));

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.6
8.7
6 changes: 0 additions & 6 deletions docs/changelog/100740.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions docs/changelog/100813.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions docs/changelog/101209.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions docs/changelog/101487.yaml

This file was deleted.

Loading

0 comments on commit 51493f0

Please sign in to comment.