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

Resolve checkstyle cache miss #6072

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

tylerbertrand
Copy link
Contributor

Description

Resolves a cache miss caused by an absolute path present in Checkstyle's configProperties extension property. The cache_file entry in configProperties was previously being set to the absolute path of the cache file.

The value of the cache_file entry has been updated to the relative path to the cache file from Checkstyle's configDir. The value of configDir is available in checkstyle.xml as config_loc, per the Gradle documentation here. In checkstyle.xml, the cache_file relative path is then appended to config_loc to construct the full path to the cache file.

Updating configProperties to only contain relative paths avoids cache misses that may occur based on the absolute path of the repository.

Task input comparison showing configProperties differences causing a cache miss
Task input comparison showing no differences in inputs with this fix applied

Motivation and Context

Avoiding absolute paths in input properties ensures that the project can take full advantage of both the local and remote build caches from either local or CI builds independent of the absolute path of the repository.

How Has This Been Tested?

Running a clean build shows that the Checkstyle cache file is still written at the correct path - build/checkstyle/cacheFile.

Gradle's build validation scripts show configProperties input differences before this fix was applied, and no input differences with the fix applied.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.

Instead of the absolute path to checkstyle cacheFile which was causing a cache miss, use the relative path from configDir for cacheFile path
@vlsi vlsi merged commit 91d8aea into apache:master Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants