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

Fix remote cache misses for checkstyle tasks #45512

Merged
merged 1 commit into from
Aug 13, 2019
Merged

Conversation

mark-vieira
Copy link
Contributor

This PR addresses a problem with cache misses for checkstyle tasks. As you can see from this build scan comparison, these two builds of the identical source tree differ in the Checkstyle task configProperties property, as well as a runtime API file input.

https://gradle-enterprise.elastic.co/c/u4minwutaak3g/jabxgddp2tql6/task-inputs?expanded=WzI5Niw0MjksMTE2Ml0&task-text=checkstyleTest#j4kf4fqcsbb54

The issue here is the property replacement being done by checkstyle for the location of our suppressions config file. We use a token ${suppressions} in our checkstyle.xml file to be a stand in for the location of the suppression file to use. We then pass the real value to the task via the configProperties task property. The issue here is that because the value given to configProperties is an absolute path, this makes cache reusing across different workspaces impossible.

To fix this we simply use the configDir task property instead, since we already copy these files into project-specific build directories. We can then use the standard ${config_loc} checkstyle property to resolve a relative path to an absolute one without the absolute path leaking into the Gradle task inputs.

Signed-off-by: Mark Vieira <portugee@gmail.com>
@mark-vieira mark-vieira added the :Delivery/Build Build or test infrastructure label Aug 13, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM

@mark-vieira
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/1

@mark-vieira mark-vieira merged commit ae5919b into master Aug 13, 2019
@colings86 colings86 deleted the checkstyle-cache-fix branch May 27, 2020 07:40
@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 v7.4.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants