-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Change finalization of elasticsearch distribution #64403
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
Conversation
d8f5f87
to
08cb078
Compare
@elasticmachine test this please |
b7675dc
to
1f1b370
Compare
@@ -75,6 +75,31 @@ class TestClustersPluginFuncTest extends AbstractGradleFuncTest { | |||
assertNoCustomDistro('myCluster') | |||
} | |||
|
|||
def "can declare test cluster in lazy evaluated task configuration block"() { |
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.
One scenario we wanna support with this PR
587c796
to
999d39c
Compare
@elasticsearchmachine test this please |
Pinging @elastic/es-core-infra (:Core/Infra/Build) |
c2a6997
to
d821451
Compare
buildSrc/src/integTest/groovy/org/elasticsearch/gradle/TestClustersPluginFuncTest.groovy
Show resolved
Hide resolved
|
||
private Optional<TaskDependency> dockerBuildDependencies() { | ||
// For non-required Docker distributions, skip building the distribution is Docker is unavailable | ||
return (isDocker() && getFailIfUnavailable() == false && dockerSupport.get().getDockerAvailability().isAvailable == false) |
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 doesn't seem right. In both scenarios we return what is effectively an empty set of dependencies. If docker is available, or we don't consider this to be optional, we should return the configuration's build dependencies.
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.
reworked this
buildSrc/src/main/java/org/elasticsearch/gradle/ElasticsearchDistribution.java
Show resolved
Hide resolved
@@ -103,13 +105,16 @@ public String toString() { | |||
private final Property<Boolean> bundledJdk; | |||
private final Property<Boolean> failIfUnavailable; | |||
private final Configuration extracted; | |||
private Function<ElasticsearchDistribution, ElasticsearchDistribution> distributionFinalizer; |
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.
Couldn't this just be Action<Distribution>
? I don't see where we ever actually use the returned result of this function.
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.
fixed
buildSrc/src/main/java/org/elasticsearch/gradle/test/DistroTestPlugin.java
Outdated
Show resolved
Hide resolved
@breskeby not sure why this PR is showing as having a bunch of unrelated changes. Did a merge go wrong? |
Probably a rebase. Let me check |
- avoid to rely on afterEvaluate lifecycle hook - allows us to define test cluster only in the task creation which can be later than afterevaluate
7a8f58e
to
bb199cf
Compare
@mark-vieira fixed |
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.
Changes LGTM
- Avoid to rely on afterEvaluate lifecycle hook in DistributionDownloadPlugin - Allows us to define test cluster only in the task creation which can be later than afterevaluate which allows us to move tasks that rely on test clusters using task avoidance api. - This should result in test clusters only being defined when actually used in the build - This unblocks further progress on elastic#56610
- Avoid to rely on afterEvaluate lifecycle hook in DistributionDownloadPlugin - Allows us to define test cluster only in the task creation which can be later than afterevaluate which allows us to move tasks that rely on test clusters using task avoidance api. - This should result in test clusters only being defined when actually used in the build - This unblocks further progress on #56610
DistributionDownloadPlugin