-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Make gradle build finished logic CC compatible #96475
Make gradle build finished logic CC compatible #96475
Conversation
Pinging @elastic/es-delivery (Team:Delivery) |
related to #57918 |
e3fafeb
to
885d8c7
Compare
3fcce38
to
deb9137
Compare
} | ||
} | ||
} | ||
project.getPlugins().apply(ElasticsearchBuildFinishedPlugin.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.
Can we just apply this plugin to the root project and ditch this pre-compiled script plugin altogether?
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
BuildScanExtension extension = target.getExtensions().getByType(BuildScanExtension.class); | ||
File daemonsLogDir = new File(target.getGradle().getGradleUserHomeDir(), "daemon/" + target.getGradle().getGradleVersion()); | ||
|
||
getFlowScope().always(BuildFinishedFlowAction.class, spec -> { |
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.
What on earth is a FlowAction
and how does this equate to a "build finished"? I can't see anythere here that defines when this action runs.
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.
Don't get me started. That is the last half baked overly complicated gradle api that allows code executing on buildFinished. The when is declared implicitly by this line where we map the BuildWorkResult which implicitly defers this code execution till that result is available. There is currently only getFlowProviders().getBuildWorkResult()
as "flow provider". It's been around for some versions now, obviously incubating but all that is available right now.
spec.getParameters().getFilteredFiles().addAll(getFlowProviders().getBuildWorkResult().map((result) -> {
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.
So calling getBuildWorkResult()
implicitly makes this a "build finished" hook. That's not confusing...
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.
it is. but yes.
This reverts commit 841f711.
The buildfinished build logic in Gradle is not configuration cache. compatible. To allow CI builds running builds with configuration cache enabled we need to move away from using this API to newer APIs provided by Gradle.
Gradle Configuration Cache: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:intro
This generally allows us to run builds with configuration cache enabled on our CI infrastructure as all builds use this build finish logic.