-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Update Gradle wrapper to 9.0.0 #132932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Gradle wrapper to 9.0.0 #132932
Conversation
Pinging @elastic/es-delivery (Team:Delivery) |
jackson = "2.15.0" | ||
junit5 = "5.12.1" | ||
spock = "2.1-groovy-3.0" | ||
spock = "2.3-groovy-4.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required due to groovy update within gradle
include ':consumer' | ||
include ':producer-tar' | ||
""" | ||
subProject("consumer") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gradle throws error if the project folder does not exist yet. therefore tweaks to our tests in that area.
""" | ||
|
||
subProject(":distribution:archives:integ-test-zip") << "configurations.create('extracted')\n" | ||
subProject(":distribution:archives:integ-test-zip") << "configurations.create('default')\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
manual creating default
configuration is deprecated now
from fileTree("archiveRoot") | ||
into('config') { | ||
dirMode 0750 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that APi has been removed
|
||
package org.elasticsearch.gradle.internal | ||
|
||
import groovy.ant.AntBuilder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages for some groovy util classes have moved
* @param value the value used in the replacement. For example "bar" | ||
*/ | ||
public void replaceValueInMatch(String subKey, Object value) { | ||
getTransformations().add(new ReplaceValueInMatch(subKey, MAPPER.convertValue(value, JsonNode.class))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JsonNode cannot be serialized anymore due to restrictions to the serializer. (details in commit messages). therefore we wrap this in a serializable class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it simply because JsonNode
doesn't implement java.io.Serializable
?
Could you use BaseJsonNode
? As far as I can see this is the only subclass of the JsonNode
and implement Serializable
. This way we could potentially avoid having SerializableJsonNode
class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No its not that. its the fact that NodeSerialisation relies on ObjectInputStream#.readFully which is unsupported by the gradle serialization. Usually serializing any more complex class often results in a hassle in Gradle therefore should be avoided as it causes this kind of unexpected behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I misinterpreted the change. I thought SerializableJsonNode is just a wrapper on JsonNode, but it actually stores the original value and only change it to JsonNode when toJsonNode()
is called.
Is there any risk related to the value
not being Serializable
? Would it make sense to changed if from Object
to Serializable
?
httpclient5 = "org.apache.httpcomponents.client5:httpclient5:5.4.2" | ||
idea-ext = "gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:1.1.4" | ||
javaparser = "com.github.javaparser:javaparser-core:3.18.0" | ||
javaparser = "com.github.javaparser:javaparser-core:3.27.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw some flakyness around this with the update. so pushed a new version that has fixed this. My assumption is there is some caching /serialization issue
bf41c69
to
e4db346
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding the comments. This is super helpful.
In general it looks good.
I've left two comments in the code for the potential minor improvements and one question.
YAMLFactory YAML_FACTORY = new YAMLFactory(); | ||
ObjectMapper MAPPER = new ObjectMapper(YAML_FACTORY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you decide to keep using JsonNode
(see previous comment).
I would consider moving the MAPPER to the static field of the class. I assume the construction of the object is not very costly, but since it is called multiple times it it still beneficial.
ObjectMapper is thread-safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah there'is a overhead with this. but should only be triggered by execution time which means we don't need to deal with this class at configuration time at all. I'll take another look on using a static field usually I try to avoid those for avoiding unpredicted state in the gradle daemon / classloading issues
* @param value the value used in the replacement. For example "bar" | ||
*/ | ||
public void replaceValueInMatch(String subKey, Object value) { | ||
getTransformations().add(new ReplaceValueInMatch(subKey, MAPPER.convertValue(value, JsonNode.class))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it simply because JsonNode
doesn't implement java.io.Serializable
?
Could you use BaseJsonNode
? As far as I can see this is the only subclass of the JsonNode
and implement Serializable
. This way we could potentially avoid having SerializableJsonNode
class.
import javax.inject.Inject; | ||
|
||
public class ExtractCurrentVersionsTask extends AbstractVersionsTask { | ||
public abstract class ExtractCurrentVersionsTask extends AbstractVersionsTask { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand correctly that you've changed the tasks classes to be abstract, to make them compatible with lazy configuration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually i don't remember why i did that here. it should not be required to be lazy task compatible. Let me change that back or find out why that was required
To keep supporting configuration cache we need to avoid Serializing JsonNode instances
e4db346
to
9f74701
Compare
💔 Backport failed
You can use sqren/backport to manually backport by running |
Updating to the latest Gradle GA version to keep our build uptodate * Rework RestCompatTestTransformTask to CC compatibility * Fix build integration tests due to api changes * Updating javaparser
Updating to the latest Gradle GA version to keep our build uptodate * Rework RestCompatTestTransformTask to CC compatibility * Fix build integration tests due to api changes * Updating javaparser (cherry picked from commit 8e2c948) # Conflicts: # build-tools-internal/src/main/resources/minimumGradleVersion # gradle/build.versions.toml # gradle/verification-metadata.xml
Updating to the latest Gradle GA version to keep our build uptodate * Rework RestCompatTestTransformTask to CC compatibility * Fix build integration tests due to api changes * Updating javaparser (cherry picked from commit 8e2c948) # Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/idea/IdeaXmlUtil.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/RestCompatTestTransformTask.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/close_to/ReplaceValueInCloseTo.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/text/ReplaceIsTrue.java # build-tools-internal/src/main/resources/minimumGradleVersion # build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/close_to/ReplaceValueInCloseToTests.java
Updating to the latest Gradle GA version to keep our build uptodate * Rework RestCompatTestTransformTask to CC compatibility * Fix build integration tests due to api changes * Updating javaparser (cherry picked from commit 8e2c948) # Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/idea/IdeaXmlUtil.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/RestCompatTestTransformTask.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/close_to/ReplaceValueInCloseTo.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/text/ReplaceIsTrue.java # build-tools-internal/src/main/resources/minimumGradleVersion # build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/close_to/ReplaceValueInCloseToTests.java # gradle/build.versions.toml # gradle/verification-metadata.xml
💔 Some backports could not be created
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
Updating to the latest Gradle GA version to keep our build uptodate * Rework RestCompatTestTransformTask to CC compatibility * Fix build integration tests due to api changes * Updating javaparser (cherry picked from commit 8e2c948) # Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/idea/IdeaXmlUtil.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/RestCompatTestTransformTask.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/close_to/ReplaceValueInCloseTo.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/text/ReplaceIsTrue.java # build-tools-internal/src/main/resources/minimumGradleVersion # build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/close_to/ReplaceValueInCloseToTests.java
Updating to the latest Gradle GA version to keep our build uptodate * Rework RestCompatTestTransformTask to CC compatibility * Fix build integration tests due to api changes * Updating javaparser (cherry picked from commit 8e2c948) # Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/idea/IdeaXmlUtil.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/RestCompatTestTransformTask.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/close_to/ReplaceValueInCloseTo.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/text/ReplaceIsTrue.java # build-tools-internal/src/main/resources/minimumGradleVersion # build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/close_to/ReplaceValueInCloseToTests.java
Updating to the latest Gradle GA version to keep our build uptodate * Rework RestCompatTestTransformTask to CC compatibility * Fix build integration tests due to api changes * Updating javaparser (cherry picked from commit 8e2c948) # Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/idea/IdeaXmlUtil.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/RestCompatTestTransformTask.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/close_to/ReplaceValueInCloseTo.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/text/ReplaceIsTrue.java # build-tools-internal/src/main/resources/minimumGradleVersion # build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/close_to/ReplaceValueInCloseToTests.java # gradle/build.versions.toml # gradle/verification-metadata.xml
Updating to the latest Gradle GA version to keep our build uptodate * Rework RestCompatTestTransformTask to CC compatibility * Fix build integration tests due to api changes * Updating javaparser (cherry picked from commit 8e2c948) # Conflicts: # build-tools-internal/src/main/resources/minimumGradleVersion # gradle/build.versions.toml # gradle/verification-metadata.xml
* Update Gradle wrapper to 9.0.0 (#132932) Updating to the latest Gradle GA version to keep our build uptodate * Rework RestCompatTestTransformTask to CC compatibility * Fix build integration tests due to api changes * Updating javaparser (cherry picked from commit 8e2c948) # Conflicts: # build-tools-internal/src/main/resources/minimumGradleVersion # gradle/build.versions.toml # gradle/verification-metadata.xml * Fix verification data
* Update Gradle wrapper to 9.0.0 (#132932) Updating to the latest Gradle GA version to keep our build uptodate * Rework RestCompatTestTransformTask to CC compatibility * Fix build integration tests due to api changes * Updating javaparser (cherry picked from commit 8e2c948) # Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/idea/IdeaXmlUtil.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/RestCompatTestTransformTask.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/close_to/ReplaceValueInCloseTo.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/text/ReplaceIsTrue.java # build-tools-internal/src/main/resources/minimumGradleVersion # build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/close_to/ReplaceValueInCloseToTests.java # gradle/build.versions.toml # gradle/verification-metadata.xml * Fix merge issues * More fixes lost in backports * Fix docker bin context copy
* Update Gradle wrapper to 9.0.0 (#132932) Updating to the latest Gradle GA version to keep our build uptodate * Rework RestCompatTestTransformTask to CC compatibility * Fix build integration tests due to api changes * Updating javaparser (cherry picked from commit 8e2c948) # Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/idea/IdeaXmlUtil.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/RestCompatTestTransformTask.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/close_to/ReplaceValueInCloseTo.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/text/ReplaceIsTrue.java # build-tools-internal/src/main/resources/minimumGradleVersion # build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/close_to/ReplaceValueInCloseToTests.java * Fix merge conflict * More fixes lost in backports * Fix docker bin context copy
Updating to the latest Gradle GA version to keep our build uptodate * Rework RestCompatTestTransformTask to CC compatibility * Fix build integration tests due to api changes * Updating javaparser
Updating to the latest Gradle GA version to keep our build uptodate