Skip to content

Commit 228ece6

Browse files
Merge remote-tracking branch 'elastic/master' into eventually-consistent-mock-repo
2 parents ba6abf6 + 16a2c42 commit 228ece6

File tree

845 files changed

+17260
-7225
lines changed

Some content is hidden

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

845 files changed

+17260
-7225
lines changed

.ci/init.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (System.env.ELASTIC_ARTIFACTORY_USERNAME == null || System.env.ELASTIC_ARTIFA
66
settings.pluginManagement {
77
repositories {
88
maven {
9+
name "artifactory-gradle-plugins"
910
url "https://artifactory.elstc.co/artifactory/gradle-plugins"
1011
credentials {
1112
username System.env.ELASTIC_ARTIFACTORY_USERNAME
@@ -21,6 +22,7 @@ if (System.env.ELASTIC_ARTIFACTORY_USERNAME == null || System.env.ELASTIC_ARTIFA
2122
buildscript {
2223
repositories {
2324
maven {
25+
name "artifactory-gradle-release"
2426
url "https://artifactory.elstc.co/artifactory/gradle-release/"
2527
credentials {
2628
username System.env.ELASTIC_ARTIFACTORY_USERNAME
@@ -31,6 +33,7 @@ if (System.env.ELASTIC_ARTIFACTORY_USERNAME == null || System.env.ELASTIC_ARTIFA
3133
}
3234
repositories {
3335
maven {
36+
name "artifactory-gradle-release"
3437
url "https://artifactory.elstc.co/artifactory/gradle-release/"
3538
credentials {
3639
username System.env.ELASTIC_ARTIFACTORY_USERNAME

TESTING.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ These are the linux flavors supported, all of which we provide images for
374374
* debian-9 aka stretch, the current debian stable distribution
375375
* centos-6
376376
* centos-7
377+
* rhel-8
377378
* fedora-28
378379
* fedora-29
379380
* oel-6 aka Oracle Enterprise Linux 6

Vagrantfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ Vagrant.configure(2) do |config|
124124
sles_common config, box
125125
end
126126
end
127+
'rhel-8'.tap do |box|
128+
config.vm.define box, define_opts do |config|
129+
config.vm.box = 'elastic/rhel-8-x86_64'
130+
rpm_common config, box
131+
end
132+
end
127133

128134
windows_2012r2_box = ENV['VAGRANT_WINDOWS_2012R2_BOX']
129135
if windows_2012r2_box && windows_2012r2_box.empty? == false
@@ -244,7 +250,7 @@ def linux_common(config,
244250
SHELL
245251

246252
config.vm.provision 'jdk-11', type: 'shell', inline: <<-SHELL
247-
curl -sSL https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz | tar xz -C /opt/
253+
curl -sSL https://download.oracle.com/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz | tar xz -C /opt/
248254
SHELL
249255

250256
# This prevents leftovers from previous tests using the
@@ -405,7 +411,7 @@ def windows_common(config, name)
405411

406412
config.vm.provision 'windows-jdk-11', type: 'shell', inline: <<-SHELL
407413
New-Item -ItemType Directory -Force -Path "C:/java"
408-
Invoke-WebRequest "https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_windows-x64_bin.zip" -OutFile "C:/java/jdk-11.zip"
414+
Invoke-WebRequest "https://download.oracle.com/java/GA/jdk11/9/GPL/openjdk-11.0.2_windows-x64_bin.zip" -OutFile "C:/java/jdk-11.zip"
409415
Expand-Archive -Path "C:/java/jdk-11.zip" -DestinationPath "C:/java/"
410416
SHELL
411417

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ subprojects {
8888
}
8989
repositories {
9090
maven {
91-
name = 'localTest'
91+
name = 'test'
9292
url = "${rootProject.buildDir}/local-test-repo"
9393
}
9494
}
@@ -162,8 +162,8 @@ task verifyVersions {
162162
* after the backport of the backcompat code is complete.
163163
*/
164164

165-
boolean bwc_tests_enabled = false
166-
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/41426" /* place a PR link here when committing bwc changes */
165+
boolean bwc_tests_enabled = true
166+
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
167167
if (bwc_tests_enabled == false) {
168168
if (bwc_tests_disabled_issue.isEmpty()) {
169169
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")

buildSrc/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ if (project != rootProject) {
189189
task integTest(type: Test) {
190190
// integration test requires the local testing repo for example plugin builds
191191
dependsOn project.rootProject.allprojects.collect {
192-
it.tasks.matching { it.name == 'publishNebulaPublicationToLocalTestRepository'}
192+
it.tasks.matching { it.name == 'publishNebulaPublicationToTestRepository'}
193193
}
194194
dependsOn setupLocalDownloads
195195
exclude "**/*Tests.class"

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ import org.gradle.api.artifacts.ModuleVersionIdentifier
3939
import org.gradle.api.artifacts.ProjectDependency
4040
import org.gradle.api.artifacts.ResolvedArtifact
4141
import org.gradle.api.artifacts.dsl.RepositoryHandler
42+
import org.gradle.api.artifacts.repositories.ArtifactRepository
43+
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
44+
import org.gradle.api.artifacts.repositories.MavenArtifactRepository
4245
import org.gradle.api.credentials.HttpHeaderCredentials
4346
import org.gradle.api.execution.TaskActionListener
4447
import org.gradle.api.execution.TaskExecutionGraph
@@ -580,6 +583,16 @@ class BuildPlugin implements Plugin<Project> {
580583

581584
/** Adds repositories used by ES dependencies */
582585
static void configureRepositories(Project project) {
586+
project.getRepositories().all { repository ->
587+
if (repository instanceof MavenArtifactRepository) {
588+
final MavenArtifactRepository maven = (MavenArtifactRepository) repository
589+
assertRepositoryURIUsesHttps(maven, project, maven.getUrl())
590+
repository.getArtifactUrls().each { uri -> assertRepositoryURIUsesHttps(project, uri) }
591+
} else if (repository instanceof IvyArtifactRepository) {
592+
final IvyArtifactRepository ivy = (IvyArtifactRepository) repository
593+
assertRepositoryURIUsesHttps(ivy, project, ivy.getUrl())
594+
}
595+
}
583596
RepositoryHandler repos = project.repositories
584597
if (System.getProperty("repos.mavenLocal") != null) {
585598
// with -Drepos.mavenLocal=true we can force checking the local .m2 repo which is
@@ -589,6 +602,7 @@ class BuildPlugin implements Plugin<Project> {
589602
}
590603
repos.jcenter()
591604
repos.ivy {
605+
name "elasticsearch"
592606
url "https://artifacts.elastic.co/downloads"
593607
patternLayout {
594608
artifact "elasticsearch/[module]-[revision](-[classifier]).[ext]"
@@ -617,6 +631,12 @@ class BuildPlugin implements Plugin<Project> {
617631
}
618632
}
619633

634+
private static void assertRepositoryURIUsesHttps(final ArtifactRepository repository, final Project project, final URI uri) {
635+
if (uri != null && uri.toURL().getProtocol().equals("http")) {
636+
throw new GradleException("repository [${repository.name}] on project with path [${project.path}] is using http for artifacts on [${uri.toURL()}]")
637+
}
638+
}
639+
620640
/**
621641
* Returns a closure which can be used with a MavenPom for fixing problems with gradle generated poms.
622642
*

buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class PluginBuildPlugin extends BuildPlugin {
8989
project.extensions.getByType(PluginPropertiesExtension).extendedPlugins.each { pluginName ->
9090
// Auto add dependent modules to the test cluster
9191
if (project.findProject(":modules:${pluginName}") != null) {
92+
project.integTest.dependsOn(project.project(":modules:${pluginName}").tasks.bundlePlugin)
9293
project.testClusters.integTest.module(
9394
project.file(project.project(":modules:${pluginName}").tasks.bundlePlugin.archiveFile)
9495
)
@@ -98,9 +99,8 @@ class PluginBuildPlugin extends BuildPlugin {
9899

99100
project.tasks.run.dependsOn(project.tasks.bundlePlugin)
100101
if (isModule) {
101-
project.tasks.run.clusterConfig.module(project)
102102
project.tasks.run.clusterConfig.distribution = System.getProperty(
103-
'run.distribution', 'integ-test-zip'
103+
'run.distribution', isXPackModule ? 'default' : 'oss'
104104
)
105105
} else {
106106
project.tasks.run.clusterConfig.plugin(project.path)

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,8 @@ class ClusterFormationTasks {
936936
}
937937
doLast {
938938
project.delete(node.pidFile)
939+
// Large tests can exhaust disk space, clean up jdk from the distribution to save some space
940+
project.delete(new File(node.homeDir, "jdk"))
939941
}
940942
}
941943
}

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestIntegTestTask.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ class RestIntegTestTask extends DefaultTask {
120120
if (usesTestclusters == true) {
121121
ElasticsearchCluster cluster = project.testClusters."${name}"
122122
nonInputProperties.systemProperty('tests.rest.cluster', "${-> cluster.allHttpSocketURI.join(",") }")
123-
nonInputProperties.systemProperty('tests.config.dir', "${-> cluster.singleNode().getConfigDir() }")
124123
nonInputProperties.systemProperty('tests.cluster', "${-> cluster.transportPortURI }")
125124
} else {
126125
// we pass all nodes to the rest cluster to allow the clients to round-robin between them

buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class VagrantTestPlugin implements Plugin<Project> {
3030
'oel-6',
3131
'oel-7',
3232
'opensuse-42',
33+
'rhel-8',
3334
'sles-12',
3435
'ubuntu-1604',
3536
'ubuntu-1804'
@@ -173,6 +174,7 @@ class VagrantTestPlugin implements Plugin<Project> {
173174
which should work for 5.0.0+. This isn't a real ivy repository but gradle
174175
is fine with that */
175176
repos.ivy {
177+
name "elasticsearch"
176178
artifactPattern "https://artifacts.elastic.co/downloads/elasticsearch/[module]-[revision].[ext]"
177179
}
178180
}

0 commit comments

Comments
 (0)