Skip to content
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

Determine the minimum gradle version based on the wrapper #32226

Merged
merged 3 commits into from
Jul 25, 2018

Conversation

alpar-t
Copy link
Contributor

@alpar-t alpar-t commented Jul 20, 2018

This is restrictive and forces users of the plugin to move together with
us, but without integration tests it's close to impossible to make sure
that the claimed compatability is really there.
If we do want to offer more flexibility, we should add those tests
first.

@nik9000 this is the promised follow-up to #32200

This is restrictive and forces users of the plugin to move together with
us, but without integration tests it's close to impossible to make sure
that the claimed compatability is really there.
If we do want to offer more flexibility, we should add those tests
first.
@alpar-t alpar-t added :Delivery/Build Build or test infrastructure v7.0.0 v6.4.0 labels Jul 20, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it is worth grabbing the version from the zip file in the distribution url so we don't have to write more stuff?

@@ -78,6 +83,7 @@ task writeVersionProperties {
processResources {
dependsOn writeVersionProperties
from tempPropertiesFile
from wrapperProperties
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should rename this file so it is more obvious what we are using it for. Or maybe not write the entire file, just the version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially added the file as is thinking about parsing it from the URL, but then realized that the wrapper know about the version it's going to use. In retrospect I'm not sure why I choose to add it to the properties files, I think the initial idea rooted, it makes much more sense to add a minimumGradleVersion resource that just has this version number.

@alpar-t
Copy link
Contributor Author

alpar-t commented Jul 23, 2018

I made changes so that we track minimum Gradle exactly like version like minimum Java version, it just so happens that right now, we auto-update this with the wrapper. My hope is that we'll be able to add some tests soon so that when we move to Gradle 4.10 we can add a test for 4.9 for confidence that we can still support it, then we might stop auto updating it with the wrapper. On the other hand, we might consider different minimum versions for build-tools and the elasticsearch build as a whole, right now both are checked against this. Checking the elasticsearch build is meaningful in case someone runs the build without the wrapper.

@nik9000
Copy link
Member

nik9000 commented Jul 23, 2018

My hope is that we'll be able to add some tests soon so that when we move to Gradle 4.10 we can add a test for 4.9 for confidence that we can still support it, then we might stop auto updating it with the wrapper.

I think we have so much on our plate right now that that isn't worth it.

build.gradle Outdated
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"
println "Added checksum and version to wrapper properties"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this println isn't accurate any more, right?

@@ -4,3 +4,4 @@ distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=39e2d5803bbd5eaf6c8efe07067b0e5a00235e8c71318642b2ed262920b27721
gradleVersion=4.9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't be in the file if you regenerate it, right?

@nik9000
Copy link
Member

nik9000 commented Jul 23, 2018

LGTM!

@alpar-t alpar-t merged commit b6c1493 into elastic:master Jul 25, 2018
@alpar-t alpar-t deleted the fix-gradle-version-check-part2 branch July 25, 2018 06:21
alpar-t added a commit that referenced this pull request Jul 25, 2018
* Determine the minimum gradle version based on the wrapper

This is restrictive and forces users of the plugin to move together with
us, but without integration tests it's close to impossible to make sure
that the claimed compatability is really there.
If we do want to offer more flexibility, we should add those tests
first.

* Track gradle version in individual file

* PR review
jasontedor added a commit that referenced this pull request Jul 25, 2018
* elastic/master:
  Number of utilities for writing gradle integration tests (#32282)
  Determine the minimum gradle version based on the wrapper (#32226)
  Enable FIPS JVM in CI (#32330)
  Fix JarHell on X-Pack protocol
jasontedor added a commit that referenced this pull request Jul 25, 2018
* elastic/6.x:
  Tests: Fix XPack upgrade tests (#32352)
  Remove invalid entry from 6.3.2 release notes
  Number of utilities for writing gradle integration tests (#32282)
  Determine the minimum gradle version based on the wrapper (#32226)
  Enable FIPS JVM in CI (#32330)
  Build: Fix jarHell error I caused by last backport
  Build: Shadow x-pack:protocol into x-pack:plugin:core (#32240)
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Jul 25, 2018
* ccr:
  Number of utilities for writing gradle integration tests (elastic#32282)
  Determine the minimum gradle version based on the wrapper (elastic#32226)
  Enable FIPS JVM in CI (elastic#32330)
  Build: Fix jarHell error I caused by last backport
  Use shadow plugin in ccr/qa
  Fix JarHell on X-Pack protocol
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team v6.4.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants