Skip to content

Commit

Permalink
Merge branch 'main' into introduce-not-master-for-desired-balance
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Nov 25, 2024
2 parents b5cd708 + e701697 commit 0fc0e42
Show file tree
Hide file tree
Showing 1,159 changed files with 28,613 additions and 14,085 deletions.
4 changes: 2 additions & 2 deletions .backportrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"upstream" : "elastic/elasticsearch",
"targetBranchChoices" : [ "main", "8.x", "8.16", "8.15", "8.14", "8.13", "8.12", "8.11", "8.10", "8.9", "8.8", "8.7", "8.6", "8.5", "8.4", "8.3", "8.2", "8.1", "8.0", "7.17", "6.8" ],
"targetBranchChoices" : [ "main", "8.x", "8.17", "8.16", "8.15", "8.14", "8.13", "8.12", "8.11", "8.10", "8.9", "8.8", "8.7", "8.6", "8.5", "8.4", "8.3", "8.2", "8.1", "8.0", "7.17", "6.8" ],
"targetPRLabels" : [ "backport" ],
"branchLabelMapping" : {
"^v9.0.0$" : "main",
"^v8.17.0$" : "8.x",
"^v8.18.0$" : "8.x",
"^v(\\d+).(\\d+).\\d+(?:-(?:alpha|beta|rc)\\d+)?$" : "$1.$2"
}
}
2 changes: 1 addition & 1 deletion .buildkite/pipelines/intake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ steps:
timeout_in_minutes: 300
matrix:
setup:
BWC_VERSION: ["8.16.1", "8.17.0", "9.0.0"]
BWC_VERSION: ["8.16.2", "8.17.0", "8.18.0", "9.0.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down
1 change: 1 addition & 0 deletions .buildkite/pipelines/periodic-packaging.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ steps:
setup:
image:
- debian-11
- debian-12
- opensuse-leap-15
- oraclelinux-7
- oraclelinux-8
Expand Down
23 changes: 20 additions & 3 deletions .buildkite/pipelines/periodic-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ steps:
setup:
image:
- debian-11
- debian-12
- opensuse-leap-15
- oraclelinux-7
- oraclelinux-8
Expand Down Expand Up @@ -288,8 +289,8 @@ steps:
env:
BWC_VERSION: 8.15.4

- label: "{{matrix.image}} / 8.16.1 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.16.1
- label: "{{matrix.image}} / 8.16.2 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.16.2
timeout_in_minutes: 300
matrix:
setup:
Expand All @@ -302,7 +303,7 @@ steps:
machineType: custom-16-32768
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 8.16.1
BWC_VERSION: 8.16.2

- label: "{{matrix.image}} / 8.17.0 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.17.0
Expand All @@ -320,6 +321,22 @@ steps:
env:
BWC_VERSION: 8.17.0

- label: "{{matrix.image}} / 8.18.0 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.18.0
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: 8.18.0

- label: "{{matrix.image}} / 9.0.0 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v9.0.0
timeout_in_minutes: 300
Expand Down
1 change: 1 addition & 0 deletions .buildkite/pipelines/periodic-platform-support.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ steps:
setup:
image:
- debian-11
- debian-12
- opensuse-leap-15
- oraclelinux-7
- oraclelinux-8
Expand Down
29 changes: 24 additions & 5 deletions .buildkite/pipelines/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ steps:
- signal_reason: agent_stop
limit: 3

- label: 8.16.1 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.16.1#bwcTest
- label: 8.16.2 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.16.2#bwcTest
timeout_in_minutes: 300
agents:
provider: gcp
Expand All @@ -316,7 +316,7 @@ steps:
buildDirectory: /dev/shm/bk
preemptible: true
env:
BWC_VERSION: 8.16.1
BWC_VERSION: 8.16.2
retry:
automatic:
- exit_status: "-1"
Expand Down Expand Up @@ -344,6 +344,25 @@ steps:
- signal_reason: agent_stop
limit: 3

- label: 8.18.0 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.18.0#bwcTest
timeout_in_minutes: 300
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
machineType: n1-standard-32
buildDirectory: /dev/shm/bk
preemptible: true
env:
BWC_VERSION: 8.18.0
retry:
automatic:
- exit_status: "-1"
limit: 3
signal_reason: none
- signal_reason: agent_stop
limit: 3

- label: 9.0.0 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v9.0.0#bwcTest
timeout_in_minutes: 300
Expand Down Expand Up @@ -429,7 +448,7 @@ steps:
setup:
ES_RUNTIME_JAVA:
- openjdk21
BWC_VERSION: ["8.16.1", "8.17.0", "9.0.0"]
BWC_VERSION: ["8.16.2", "8.17.0", "8.18.0", "9.0.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down Expand Up @@ -471,7 +490,7 @@ steps:
ES_RUNTIME_JAVA:
- openjdk21
- openjdk23
BWC_VERSION: ["8.16.1", "8.17.0", "9.0.0"]
BWC_VERSION: ["8.16.2", "8.17.0", "8.18.0", "9.0.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down
66 changes: 9 additions & 57 deletions .buildkite/pipelines/pull-request/packaging-tests-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,15 @@ config:
steps:
- group: packaging-tests-unix
steps:
- label: "{{matrix.image}} / docker / packaging-tests-unix"
key: "packaging-tests-unix-docker"
command: ./.ci/scripts/packaging-test.sh destructiveDistroTest.docker-cloud-ess
timeout_in_minutes: 300
matrix:
setup:
image:
- debian-11
- opensuse-leap-15
- oraclelinux-7
- oraclelinux-8
- sles-12
- sles-15
- ubuntu-1804
- ubuntu-2004
- ubuntu-2204
- rocky-8
- rocky-9
- rhel-7
- rhel-8
- rhel-9
- almalinux-8
agents:
provider: gcp
image: family/elasticsearch-{{matrix.image}}
diskSizeGb: 350
machineType: custom-16-32768
- label: "{{matrix.image}} / packages / packaging-tests-unix"
key: "packaging-tests-unix-packages"
command: ./.ci/scripts/packaging-test.sh destructiveDistroTest.packages
timeout_in_minutes: 300
matrix:
setup:
image:
- debian-11
- opensuse-leap-15
- oraclelinux-7
- oraclelinux-8
- sles-12
- sles-15
- ubuntu-1804
- ubuntu-2004
- ubuntu-2204
- rocky-8
- rocky-9
- rhel-7
- rhel-8
- rhel-9
- almalinux-8
agents:
provider: gcp
image: family/elasticsearch-{{matrix.image}}
diskSizeGb: 350
machineType: custom-16-32768
- label: "{{matrix.image}} / archives / packaging-tests-unix"
key: "packaging-tests-unix-archives"
command: ./.ci/scripts/packaging-test.sh destructiveDistroTest.archives
- label: "{{matrix.image}} / {{matrix.PACKAGING_TASK}} / packaging-tests-unix"
key: "packaging-tests-unix"
command: ./.ci/scripts/packaging-test.sh destructiveDistroTest.{{matrix.PACKAGING_TASK}}
timeout_in_minutes: 300
matrix:
setup:
image:
- debian-11
- debian-12
- opensuse-leap-15
- oraclelinux-7
- oraclelinux-8
Expand All @@ -79,6 +26,11 @@ steps:
- rhel-8
- rhel-9
- almalinux-8
PACKAGING_TASK:
- docker
- docker-cloud-ess
- packages
- archives
agents:
provider: gcp
image: family/elasticsearch-{{matrix.image}}
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/dra-workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKFLOW="${DRA_WORKFLOW:-snapshot}"
BRANCH="${BUILDKITE_BRANCH:-}"

# Don't publish main branch to staging
if [[ "$BRANCH" == "main" && "$WORKFLOW" == "staging" ]]; then
if [[ ("$BRANCH" == "main" || "$BRANCH" == *.x) && "$WORKFLOW" == "staging" ]]; then
exit 0
fi

Expand Down
3 changes: 2 additions & 1 deletion .ci/bwcVersions
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ BWC_VERSION:
- "8.13.4"
- "8.14.3"
- "8.15.4"
- "8.16.1"
- "8.16.2"
- "8.17.0"
- "8.18.0"
- "9.0.0"
3 changes: 2 additions & 1 deletion .ci/snapshotBwcVersions
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
BWC_VERSION:
- "8.16.1"
- "8.16.2"
- "8.17.0"
- "8.18.0"
- "9.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.elasticsearch.index.mapper.NumberFieldMapper.NumberType;
import org.elasticsearch.indices.breaker.CircuitBreakerService;
import org.elasticsearch.indices.breaker.NoneCircuitBreakerService;
import org.elasticsearch.plugins.PluginsLoader;
import org.elasticsearch.plugins.PluginsService;
import org.elasticsearch.plugins.ScriptPlugin;
import org.elasticsearch.script.DocReader;
Expand Down Expand Up @@ -76,8 +77,7 @@ public class ScriptScoreBenchmark {
private final PluginsService pluginsService = new PluginsService(
Settings.EMPTY,
null,
null,
Path.of(System.getProperty("plugins.dir"))
new PluginsLoader(null, Path.of(System.getProperty("plugins.dir")))
);
private final ScriptModule scriptModule = new ScriptModule(Settings.EMPTY, pluginsService.filterPlugins(ScriptPlugin.class).toList());

Expand Down
3 changes: 3 additions & 0 deletions branches.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
{
"branch": "8.16"
},
{
"branch": "8.17"
},
{
"branch": "8.x"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
import org.elasticsearch.gradle.internal.conventions.info.GitInfo;
import org.elasticsearch.gradle.internal.conventions.precommit.PomValidationPrecommitPlugin;
import org.elasticsearch.gradle.internal.conventions.util.Util;
import org.gradle.api.Action;
import org.gradle.api.NamedDomainObjectSet;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.XmlProvider;
import org.gradle.api.file.ProjectLayout;
import org.gradle.api.plugins.BasePlugin;
Expand Down Expand Up @@ -69,6 +67,7 @@ public void apply(Project project) {
configureSourcesJar(project);
configurePomGeneration(project);
configurePublications(project);
formatGeneratedPom(project);
}

private void configurePublications(Project project) {
Expand Down Expand Up @@ -127,42 +126,27 @@ private void configurePomGeneration(Project project) {
projectVersion.get()
)
);
pomTask.doFirst(t -> pomTask.getPom().withXml(xml -> formatDependencies(xml)));
});

var publishing = extensions.getByType(PublishingExtension.class);
final var mavenPublications = publishing.getPublications().withType(MavenPublication.class);

addNameAndDescriptionToPom(project, mavenPublications);
mavenPublications.configureEach(publication -> {
// Add git origin info to generated POM files for internal builds
publication.getPom().withXml(xml -> addScmInfo(xml, gitInfo.get()));
publication.getPom().withXml(xml -> {
// Add git origin info to generated POM files for internal builds
addScmInfo(xml, gitInfo.get());
});
// have to defer this until archivesBaseName is set
project.afterEvaluate(p -> publication.setArtifactId(archivesBaseName.get()));
generatePomTask.configure(t -> t.dependsOn(generateMavenPoms));
});
}

/**
* just ensure we put dependencies to the end. more a cosmetic thing than anything else
* */
private void formatDependencies(XmlProvider xml) {
Element rootElement = xml.asElement();
var dependencies = rootElement.getElementsByTagName("dependencies");
if (dependencies.getLength() == 1 && dependencies.item(0) != null) {
org.w3c.dom.Node item = dependencies.item(0);
rootElement.removeChild(item);
rootElement.appendChild(item);
}
}

private void addNameAndDescriptionToPom(Project project, NamedDomainObjectSet<MavenPublication> mavenPublications) {
var name = project.getName();
var description = providerFactory.provider(() -> project.getDescription() != null ? project.getDescription() : "");
mavenPublications.configureEach(p -> p.getPom().withXml(xml -> {
var root = xml.asNode();
// Node versionNode = root.get("version");
// versionNode.plus(1, "name", name);
root.appendNode("name", name);
root.appendNode("description", description.get());
}));
Expand Down Expand Up @@ -209,4 +193,32 @@ static void configureSourcesJar(Project project) {
project.getTasks().named(BasePlugin.ASSEMBLE_TASK_NAME).configure(t -> t.dependsOn(sourcesJarTask));
});
}


/**
* Format the generated pom files to be in a sort of reproducible order.
*/
private void formatGeneratedPom(Project project) {
var publishing = project.getExtensions().getByType(PublishingExtension.class);
final var mavenPublications = publishing.getPublications().withType(MavenPublication.class);
mavenPublications.configureEach(publication -> {
publication.getPom().withXml(xml -> {
// Add some pom formatting
formatDependencies(xml);
});
});
}

/**
* just ensure we put dependencies to the end. more a cosmetic thing than anything else
* */
private void formatDependencies(XmlProvider xml) {
Element rootElement = xml.asElement();
var dependencies = rootElement.getElementsByTagName("dependencies");
if (dependencies.getLength() == 1 && dependencies.item(0) != null) {
org.w3c.dom.Node item = dependencies.item(0);
rootElement.removeChild(item);
rootElement.appendChild(item);
}
}
}
Loading

0 comments on commit 0fc0e42

Please sign in to comment.