Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
90c6fef
wip
JVerwolf Jul 8, 2025
6254fe9
[CI] Auto commit changes from spotless
Jul 8, 2025
430ff53
Merge branch 'main' into new-tv-logic
JVerwolf Jul 9, 2025
c0b7219
wip
JVerwolf Jul 9, 2025
2e2b792
start migration to transport version set
jdconrad Jul 9, 2025
ce38dd4
Merge remote-tracking branch 'jverwolf/new-tv-logic' into new-tv-logic
jdconrad Jul 9, 2025
48ce548
load transport version sets
jdconrad Jul 10, 2025
1332a79
spotless
jdconrad Jul 10, 2025
2880d45
change latest to local
jdconrad Jul 10, 2025
862e5e2
clean up
jdconrad Jul 10, 2025
f12d3d8
more clean up
jdconrad Jul 10, 2025
f5bb750
fix naming bug
jdconrad Jul 10, 2025
6237548
more conversions
jdconrad Jul 10, 2025
c1bfa55
more migrations
jdconrad Jul 10, 2025
5f216a1
another migration
jdconrad Jul 10, 2025
64aad8f
Update build tasks
JVerwolf Jul 10, 2025
5581209
Merge branch 'new-tv-logic' of github.com:JVerwolf/elasticsearch into…
JVerwolf Jul 10, 2025
e36cb13
[CI] Auto commit changes from spotless
Jul 10, 2025
b9f4338
another migration
jdconrad Jul 10, 2025
4f83383
Merge branch 'main' into new-tv-logic
jdconrad Jul 14, 2025
fd02122
more migrations
jdconrad Jul 14, 2025
0e36d2b
update build tasks
JVerwolf Jul 14, 2025
68665f4
Merge branch 'new-tv-logic' of github.com:JVerwolf/elasticsearch into…
JVerwolf Jul 14, 2025
75eff06
Fix typo
JVerwolf Jul 14, 2025
26689f5
Fix bug
JVerwolf Jul 14, 2025
d28d79d
[CI] Auto commit changes from spotless
Jul 14, 2025
22e0cdb
more migrations
jdconrad Jul 14, 2025
64ba9b5
fix current version issue
jdconrad Jul 14, 2025
49540db
Exclude `.triggered-watches` from indices cleanup in REST tests (#131…
nielsbauman Jul 14, 2025
93551e3
Remove deprecated `Metadata.Builder#putProjectCustom` (#130862)
nielsbauman Jul 14, 2025
b044bc3
Handle failures that occur during field-caps (#130840)
dnhatn Jul 14, 2025
e525178
[CI] Auto commit changes from spotless
Jul 14, 2025
5901c0a
more migrations
jdconrad Jul 14, 2025
1b1e454
more migrations
jdconrad Jul 14, 2025
ec4a20a
Merge branch 'main' into new-tv-logic
jdconrad Jul 15, 2025
014b8fc
fix name
jdconrad Jul 15, 2025
d95e63f
Update build tasks
JVerwolf Jul 15, 2025
aefc963
spotless
JVerwolf Jul 15, 2025
281b587
Merge branch 'new-tv-logic' of github.com:JVerwolf/elasticsearch into…
JVerwolf Jul 15, 2025
d9ce8fe
Add more build logic
JVerwolf Jul 18, 2025
fc15f37
[CI] Auto commit changes from spotless
Jul 18, 2025
417ea88
Add more build logic
JVerwolf Jul 23, 2025
7c12577
Merge branch 'new-tv-logic' of github.com:JVerwolf/elasticsearch into…
JVerwolf Jul 23, 2025
8f87acc
spotless
JVerwolf Jul 23, 2025
9d251fb
[CI] Auto commit changes from spotless
Jul 23, 2025
b646468
WIP
JVerwolf Jul 24, 2025
69b6e9b
Merge branch 'new-tv-logic' of github.com:JVerwolf/elasticsearch into…
JVerwolf Jul 24, 2025
587a1fc
spotless
JVerwolf Jul 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions build-tools-internal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,30 @@ gradlePlugin {
id = 'elasticsearch.internal-yaml-rest-test'
implementationClass = 'org.elasticsearch.gradle.internal.test.rest.InternalYamlRestTestPlugin'
}
locateTransportVersionsPlugin { // TODO ask mark what the heck is going on with this missing function
id = 'elasticsearch.locate-transport-versions'
implementationClass = 'org.elasticsearch.gradle.internal.transport.LocateTransportVersionsPlugin'
}
generateTransportVersionManifestPlugin { // TODO ask mark what the heck is going on with this missing function
id = 'elasticsearch.generate-transport-version-manifest'
implementationClass = 'org.elasticsearch.gradle.internal.transport.GenerateTransportVersionManifestPlugin'
}
generateTransportVersionDataPlugin {
id = 'elasticsearch.generate-transport-version-data'
implementationClass = 'org.elasticsearch.gradle.internal.transport.GenerateTransportVersionDataPlugin'
}
validateTransportVersionsPlugin {
id = 'elasticsearch.validate-transport-versions'
implementationClass = 'org.elasticsearch.gradle.internal.transport.ValidateTransportVersionsPlugin'
}
aggregateTransportVersionDeclarationsPlugin {
id = 'elasticsearch.aggregate-transport-versionDeclarations-plugin'
implementationClass = 'org.elasticsearch.gradle.internal.transport.AggregateTransportVersionDeclarationsPlugin'
}
validateTransportVersionDataFilesPlugin {
id = 'elasticsearch.validate-transport-version-data-files'
implementationClass = 'org.elasticsearch.gradle.internal.transport.ValidateTransportVersionDataFilesPlugin'
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.elasticsearch.gradle.internal.info.BuildParameterExtension;
import org.elasticsearch.gradle.internal.precommit.JarHellPrecommitPlugin;
import org.elasticsearch.gradle.internal.test.ClusterFeaturesMetadataPlugin;
import org.elasticsearch.gradle.internal.transport.LocateTransportVersionsPlugin;
import org.elasticsearch.gradle.plugin.PluginBuildPlugin;
import org.elasticsearch.gradle.plugin.PluginPropertiesExtension;
import org.elasticsearch.gradle.util.GradleUtils;
Expand All @@ -36,6 +37,16 @@ public void apply(Project project) {
project.getPluginManager().apply(JarHellPrecommitPlugin.class);
project.getPluginManager().apply(ElasticsearchJavaPlugin.class);
project.getPluginManager().apply(ClusterFeaturesMetadataPlugin.class);
// We need to wire this up
/*
Old way is to set up a config here, then depend on it in the other plugin.
The new way is called variant aware artifacts or something
Basically attach some attributes to the artifacts
Then those attributes are how we are tying this together.
Now instead of saying I want this specific config, we now say I want the artifact from this project that has these attributes

*/
project.getPluginManager().apply(LocateTransportVersionsPlugin.class);
boolean isCi = project.getRootProject().getExtensions().getByType(BuildParameterExtension.class).getCi();
// Clear default dependencies added by public PluginBuildPlugin as we add our
// own project dependencies for internal builds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public EmbeddedProviderExtension(Project project, TaskProvider<Task> metaTask) {
this.metaTask = metaTask;
}

// here, this creates the provider manifest
void impl(String implName, Project implProject) {
String projectName = implProject.getName();
String capitalName = capitalize(projectName);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

package org.elasticsearch.gradle.internal.transport;

import org.gradle.api.Plugin;
import org.gradle.api.Project;

import java.util.Map;

public class AggregateTransportVersionDeclarationsPlugin implements Plugin<Project> {
public static final String ALL_TRANSPORT_VERSION_NAMES_FILE = "generated-transport-info/all-transport-version-names.txt";

@Override
public void apply(Project project) {
// need to have this task depend on all the tasks with BaseInternalPluginBuildPlugin registered
// need to get the output of all those tasks as input to this task
System.out.println("Potato: AggregateTransportVersionDeclarationsPlugin");
// First thing is to create a configuration (holder for dependency information. Configurations are how the dep graph is modeled).
var configuration = project.getConfigurations().create("aggregateTransportVersionDeclarations");
var deps = project.getDependencies();

project.getRootProject()
.getSubprojects()
.stream()
.filter(
p -> p.getParent().getPath().equals(":modules")
|| p.getParent().getPath().equals(":plugins")
|| p.getParent().getPath().equals(":x-pack:plugin")
)
.forEach(p -> {
deps.add(
configuration.getName(),
deps.project(Map.of("path", p.getPath(), "configuration", "locateTransportVersionsConfig"))
); // adding a dep to the config we created
});

var aggregationTask = project.getTasks()
.register("aggregateTransportVersionDeclarations", AggregateTransportVersionDeclarationsTask.class, t -> {
t.dependsOn(configuration); // this task can only run after this config is resolved
t.getTransportVersionNameDeclarationsFiles().setFrom(configuration);
t.getOutputFile().set(project.getLayout().getBuildDirectory().file(ALL_TRANSPORT_VERSION_NAMES_FILE));
});

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

package org.elasticsearch.gradle.internal.transport;

import org.gradle.api.DefaultTask;
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.tasks.InputFiles;
import org.gradle.api.tasks.OutputFile;
import org.gradle.api.tasks.TaskAction;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

public abstract class AggregateTransportVersionDeclarationsTask extends DefaultTask {

@InputFiles
public abstract ConfigurableFileCollection getTransportVersionNameDeclarationsFiles();

@OutputFile
public abstract RegularFileProperty getOutputFile();

@TaskAction
public void aggregateTransportVersionDeclarations() {
final var files = getTransportVersionNameDeclarationsFiles().getFiles();
var allTVNames = files.stream().flatMap(file -> {
try {
return Files.lines(Path.of(file.getPath()));
} catch (IOException e) {
throw new RuntimeException("Cannot read Transport Versions name declarations file", e);
}
}).toList();

File file = new File(getOutputFile().get().getAsFile().getAbsolutePath());
try (FileWriter writer = new FileWriter(file)) {
for (String tvName : allTVNames) {
writer.write(tvName + "\n");
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

package org.elasticsearch.gradle.internal.transport;

import org.gradle.api.Plugin;
import org.gradle.api.Project;

public class GenerateTransportVersionDataPlugin implements Plugin<Project> {

@Override
public void apply(Project project) {
project.getTasks().register("generateTransportVersionData", GenerateTransportVersionDataTask.class, t -> {
t.setDescription("Generate transport version data"); // todo update this to be more descriptive
t.setGroup("Transport Versions"); // todo
t.getDataFileDirectory().set(project.getLayout().getProjectDirectory().file("src/main/resources/org/elasticsearch/transport/"));
t.getTVSetName().set("FOO"); // todo
t.getReleaseVersionForTV().set("9.2"); // todo
});
}
}
Loading