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

Lift build date to global build info #45166

Merged
merged 3 commits into from
Aug 3, 2019

Conversation

jasontedor
Copy link
Member

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.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@jasontedor
Copy link
Member Author

@elasticmachine run elasticsearch-ci/2

1 similar comment
@jasontedor
Copy link
Member Author

@elasticmachine run elasticsearch-ci/2

Copy link
Contributor

@mark-vieira mark-vieira left a 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.

@jasontedor
Copy link
Member Author

@mark-vieira Ah, thanks for the clarification. I misunderstood how this all fit together, so thanks for the guidance. I pushed a new commit.

Copy link
Contributor

@mark-vieira mark-vieira left a 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.

Copy link
Contributor

@mark-vieira mark-vieira left a 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.

@jasontedor
Copy link
Member Author

@elasticmachine update branch

@jasontedor jasontedor merged commit 8a0263f into elastic:master Aug 3, 2019
jasontedor added a commit that referenced this pull request Aug 3, 2019
This commit adds the build date to global build info mainly so that it
is accessible as an extension property.
jasontedor added a commit that referenced this pull request Aug 3, 2019
This commit adds the build date to global build info mainly so that it
is accessible as an extension property.
jasontedor added a commit that referenced this pull request Aug 3, 2019
This commit adds the build date to global build info mainly so that it
is accessible as an extension property.
@jasontedor jasontedor deleted the build-date-build-info branch August 3, 2019 18:56
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants