-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Lift build date to global build info #45166
Conversation
This commit adds the build date to global build info mainly so that it is accessible as an extension property.
Pinging @elastic/es-core-infra |
@elasticmachine run elasticsearch-ci/2 |
1 similar comment
@elasticmachine run elasticsearch-ci/2 |
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's no reason to plumb this all the way through the generate and print tasks. The benefit of those is that we can cache things that are expensive to compute based on some known input (JDK directories). For the date it is a) cheap to compute and b) value cannot be cached since it is constantly changing.
I would just add this is another property we set in the plugin itself, similarly to the other items here.
Even worse, since this added as an input to the generate task, and this input is always changing, it means the generate task now never be cached or UP-TO-DATE.
I suggest we do the same for the git revision as well for the same reasons. We have to fetch it always so there's no opportunity to cache it. We also don't want to have to run the generate task again whenever the git commit changes (no need to recompute all my java home versions on every git pull
). The only stuff that should be handled by the generate task is stuff that is relatively stable, that is expensive to compute.
@mark-vieira Ah, thanks for the clarification. I misunderstood how this all fit together, so thanks for the guidance. I pushed a new commit. |
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.
Looks like we were already setting the git revision in GlobalBuildInfoPlugin
. That being the case we can remove it from the generate and print tasks completely. As it is we are effectively setting this value twice, once in GlobalBuildInfoPlugin
and again in PrintGlobalBuildInfoTask
. So as with the date we can remove all this plumbing for the git revision as well.
buildSrc/src/main/java/org/elasticsearch/gradle/info/GlobalBuildInfoPlugin.java
Show resolved
Hide resolved
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.
The date stuff looks good. As mentioned, let's rip out the git stuff in another PR.
@elasticmachine update branch |
This commit adds the build date to global build info mainly so that it is accessible as an extension property.
This commit adds the build date to global build info mainly so that it is accessible as an extension property.
This commit adds the build date to global build info mainly so that it is accessible as an extension property.
This commit adds the build date to global build info mainly so that it is accessible as an extension property.