-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Upgrade to Gradle Wrapper 4.8 #31271
Conversation
The current does not work with Gradle 4.8 RC1
Pinging @elastic/es-core-infra |
@@ -561,3 +561,27 @@ gradle.projectsEvaluated { | |||
} | |||
} | |||
} | |||
|
|||
apply plugin: 'compare-gradle-builds' |
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 wonder if we should keep this long term. I just feel like we won't need it again for six months and when we want it again we'll have to edit all of this to make it work.
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 worth applying the plugin at all if we don't have build.compare
set?
if (assemble) { | ||
assemble.dependsOn(t) | ||
project.getGradle().getTaskGraph().whenReady { | ||
project.tasks.withType(GenerateMavenPom.class) { GenerateMavenPom t -> |
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.
👍
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.
Can you add a comment with the gradle issue number?
@@ -1,6 +1,6 @@ | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip | |||
distributionBase=GRADLE_USER_HOME |
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.
👍
@@ -625,6 +630,10 @@ class BuildPlugin implements Plugin<Project> { | |||
jarTask.manifest.attributes('Change': shortHash) | |||
} | |||
} | |||
// Force manifest entries that change by nature to a constant to be able to compare builds more effectively |
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 feel the same way about this one too. Until we need it again it'll sit there making folks wonder "when do we set this!?" and when we finally go to use it again we'll need to make other changes.
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 think it is worth adding something like "when comparing builds, force manifest entries..." that way it is clear to the reader that we only do this when it is required to compare builds.
configuration.resolutionStrategy.failOnVersionConflict() | ||
configuration.resolutionStrategy { | ||
failOnVersionConflict() | ||
preferProjectModules() |
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.
👍
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.
Can you add a comment with the gradle issue number?
@@ -106,7 +106,6 @@ GradleVersion logVersion = GradleVersion.current() > GradleVersion.version('4.3' | |||
|
|||
dependencies { | |||
compileOnly "org.gradle:gradle-logging:${logVersion.getVersion()}" | |||
compile 'ru.vyarus:gradle-animalsniffer-plugin:1.2.0' // Gradle 2.14 requires a version > 1.0.1 |
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 don't have a strong opinion on comparing the builds. I don't like the change to generate an empty manifest, but unfortunately the plugin doesn't give us any options to influence how it compares ( however it does seem from how it's implemented it's a future goal ). That being said, I think this will be useful way sooner than 6 months. In fact I think that it will be useful as a sanity check for most build related changes, just looking at what I plan to do next, comparing building with jdk11, and dealing with deprications in 4.8, like stable publishing, i'll be able to use this. |
Do you think it'd make sense to only set up the compare plugin if you set |
@nik9000 generally, I like command line options with conventions that help one avoid typing, but in this case, it could replace |
We had some options but we had them integrated in way that caused trouble and we ended up switching to options. I'd prefer we not develop a convention for "where to check out the old version of Elasticsearch to compare the builds" so I like the idea of a command line option for it. And as a side benefit we don't have to apply the plugin if you don't set the option. |
ci, test this please |
@@ -221,14 +221,16 @@ static Policy readPolicy(URL policyFile, Map<String, URL> codebases) { | |||
if (aliasProperty.equals(property) == false) { | |||
propertiesSet.add(aliasProperty); | |||
String previous = System.setProperty(aliasProperty, url.toString()); | |||
if (previous != null) { | |||
// allow to re-set to what was previously there. https://github.com/elastic/elasticsearch/issues/31324 |
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.
When I pulled this locally and reverted the changes to this file I didn't have any trouble. We've traditionally been very weary of making changes to this file so I'd really like to make sure we need this before we do it, even if it is temporary.
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.
Oh, wait, I just got it! Neat.
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.
This looks like it is caused by gradle not passing any system properties to the test sometimes. We use the absence of a system property set by gradle to engage "IDE mode" when running tests which mucks with the security features a bit. If you run tests from gradle in IDE mode they won't work right. Security, at least, won't work right. If these were to happen for other tests then it'd explode in other ways.
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've dug some more. This is caused by us running the tests with the built in gradle test runner rather than the randomized runner. We configure the randomized runner to run with the system properties but we don't ever configure the standard runner.
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.
And some more: this is not caused by the build compare plugin. Maybe by gradle 4.8 or maybe by one of our hacks to make 4.8 work.
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.
Ok - I reverted the 4.8 change locally but kept the other changes and everything looks to work. I don't think we can upgrade to 4.8 until we get to the bottom of this.
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.
Thanks for looking into this @nik9000. I'll create a feature branch.
I won't revert this change just yet, as it does allow us to uncover additional issues, like the CI run here just found, the build hangs, and it's easily reproducible with ./gradlew :example-plugins:painless-whitelist:check
.
This upgrade of Gradle and JDK is turning out to be much harder than it should.
I was under the impression that we always replace the Gradle test runner with the randomized one. I wonder if for some reason that doesn't happen, or doesn't always happen for some reason. I did have a suspicion that we are not running with the randomized runner, but when I looked at it I didn't find evidence of this being the case.
help!!!😭
but!!!!! |
Closing this as the work was move to |
@doubleuhy I added that to #31399. Please find the proper channels to communicate. This has nothing to do with this PR, having it hare makes everything more difficult to track and organize PR. |
relates to #31230 : move to gradle 4.8 so we can start using JDK 11 in CI
Changes: