Skip to content

Commit

Permalink
[7.17] Update gradle wrapper to 8.3 (#97838) (#100715)
Browse files Browse the repository at this point in the history
* Update gradle wrapper to 8.3 (#97838)

Gradle now fully supports compiling, testing and running on Java 20.
Among other general performance improvements this release introduces --test-dry-run command line option that allows checking if tests are filtered or not by gradle.
Required updating nebula ospackage plugin as setuid was broken in gradle 8.3.

(cherry picked from commit b23e000)

# Conflicts:
#	build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/LegacyYamlRestCompatTestPluginFuncTest.groovy
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaModulePathPlugin.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/AbstractYamlRestCompatTestPlugin.java
#	build-tools-internal/src/main/resources/minimumGradleVersion
#	gradle/verification-metadata.xml
#	gradle/wrapper/gradle-wrapper.jar
#	gradlew
#	x-pack/plugin/watcher/qa/with-monitoring/src/javaRestTest/java/org/elasticsearch/smoketest/MonitoringWithWatcherRestIT.java

* [7.17] Use patched nebula os package gradle plugin

* Update testingconvention precommit integ test
  • Loading branch information
breskeby committed Oct 16, 2023
1 parent 9f8f12d commit a080bb2
Show file tree
Hide file tree
Showing 16 changed files with 213 additions and 192 deletions.
6 changes: 3 additions & 3 deletions build-tools-internal/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=5022b0b25fe182b0e50867e77f484501dba44feeea88f5c1f13b6b4660463640
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
distributionSha256Sum=bb09982fdf52718e4c7b25023d10df6d35a5fff969860bdf5a5bd27a3ab27a9e
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,6 @@ class TestingConventionsPrecommitPluginFuncTest extends AbstractGradlePrecommitP
result.task(":testingConventions").outcome == TaskOutcome.UP_TO_DATE
}

def "testing convention plugin is configuration cache compatible"() {
given:
simpleJavaBuild()
testClazz("org.acme.valid.SomeTests", "org.apache.lucene.util.LuceneTestCase") {
"""
public void testMe() {
}
"""
}
when:
def result = gradleRunner("precommit", "--configuration-cache").build()
then:
assertOutputContains(result.getOutput(), "0 problems were found storing the configuration cache.")

when:
result = gradleRunner("precommit", "--configuration-cache").build()
then:
assertOutputContains(result.getOutput(), "Configuration cache entry reused.")
}

def "checks base class convention"() {
given:
simpleJavaBuild()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* conventional configured tasks of {@link RestIntegTestTask}
*/
@CacheableTask
public class RestIntegTestTask extends StandaloneRestIntegTestTask {}
public abstract class RestIntegTestTask extends StandaloneRestIntegTestTask {}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.2
8.3
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* {@link Nested} inputs.
*/
@CacheableTask
public class StandaloneRestIntegTestTask extends Test implements TestClustersAware, FileSystemOperationsAware {
public abstract class StandaloneRestIntegTestTask extends Test implements TestClustersAware, FileSystemOperationsAware {

private Collection<ElasticsearchCluster> clusters = new HashSet<>();
private boolean debugServer = false;
Expand Down
7 changes: 0 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,6 @@ tasks.register("branchConsistency") {
tasks.named("wrapper").configure {
distributionType = 'ALL'
doLast {
final DistributionLocator locator = new DistributionLocator()
final GradleVersion version = GradleVersion.version(wrapper.gradleVersion)
final URI distributionUri = locator.getDistributionFor(version, wrapper.distributionType.name().toLowerCase(Locale.ENGLISH))
final URI sha256Uri = new URI(distributionUri.toString() + ".sha256")
final String sha256Sum = new String(sha256Uri.toURL().bytes)
wrapper.getPropertiesFile() << "distributionSha256Sum=${sha256Sum}\n"
println "Added checksum to wrapper properties"
// copy wrapper properties file to build-tools-internal to allow seamless idea integration
def file = new File("build-tools-internal/gradle/wrapper/gradle-wrapper.properties")
Files.copy(wrapper.getPropertiesFile().toPath(), file.toPath(), REPLACE_EXISTING)
Expand Down
17 changes: 15 additions & 2 deletions distribution/packages/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,20 @@ import java.util.regex.Pattern
* dpkg -c path/to/elasticsearch.deb
*/

plugins {
id "com.netflix.nebula.ospackage-base" version "11.0.0"
buildscript {
repositories {
maven {
url 'https://jitpack.io'
}
mavenCentral()
}
dependencies {
classpath "com.github.breskeby:gradle-ospackage-plugin:2da19425133"
}
}

apply plugin: "com.netflix.nebula.ospackage-base"

void addProcessFilesTask(String type, boolean oss, boolean jdk) {
String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"

Expand Down Expand Up @@ -200,6 +210,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
dirMode 02750
into('/etc')
permissionGroup 'elasticsearch'
setgid true
includeEmptyDirs true
createDirectoryEntry true
include("elasticsearch") // empty dir, just to add directory entry
Expand All @@ -208,6 +219,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
from("${packagingFiles}/etc/elasticsearch") {
into('/etc/elasticsearch')
dirMode 02750
setgid = true
fileMode 0660
permissionGroup 'elasticsearch'
includeEmptyDirs true
Expand Down Expand Up @@ -263,6 +275,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
user u
permissionGroup g
dirMode mode
setgid (mode == 02750)
}
}
copyEmptyDir('/var/log/elasticsearch', 'elasticsearch', 'elasticsearch', 02750)
Expand Down
2 changes: 1 addition & 1 deletion gradle/build.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ checkstyle = "com.puppycrawl.tools:checkstyle:10.3"
commons-codec = "commons-codec:commons-codec:1.11"
commmons-io = "commons-io:commons-io:2.2"
docker-compose = "com.avast.gradle:gradle-docker-compose-plugin:0.17.5"
forbiddenApis = "de.thetaphi:forbiddenapis:3.2"
forbiddenApis = "de.thetaphi:forbiddenapis:3.5.1"
hamcrest = "org.hamcrest:hamcrest:2.1"
httpcore = "org.apache.httpcomponents:httpcore:4.4.12"
httpclient = "org.apache.httpcomponents:httpclient:4.5.10"
Expand Down

0 comments on commit a080bb2

Please sign in to comment.