Skip to content

Hibernate Search: mark checkstyle:check as not cacheable#195

Closed
ribafish wants to merge 1 commit into
mainfrom
gk/hibernate-search-cache-fix
Closed

Hibernate Search: mark checkstyle:check as not cacheable#195
ribafish wants to merge 1 commit into
mainfrom
gk/hibernate-search-cache-fix

Conversation

@ribafish
Copy link
Copy Markdown
Member

@ribafish ribafish commented Mar 19, 2026

Summary

  • Mark checkstyle:check as not cacheable via post-checkout hook injecting notCacheableBecause into develocity-custom-user-data.groovy
  • Fixes 83 cache misses caused by two issues:
    • (79 misses) resources.1.directory points at ${rootProject.directory} (workspace root), fingerprinting the entire directory tree including target/ dirs from previous builds
    • (4 misses) testSourceDirectories includes target/generated-test-sources/test-annotations with annotation processor output (*__.java metamodel files) that only appear after compiler:testCompile
  • Upstream PR to fix both root causes: Fix build cache relocatability for checkstyle:check hibernate/hibernate-search#5067

Test plan

checkstyle:check is not cache-relocatable because project resources
include ${rootProject.directory}, fingerprinting the entire workspace
root tree including target/ dirs from previous builds (83 cache misses).

Upstream PR: hibernate/hibernate-search#5067
@ribafish
Copy link
Copy Markdown
Member Author

@ribafish ribafish requested a review from Copilot March 19, 2026 11:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Hibernate Search experiment workflow to work around non-relocatable build cache behavior by injecting Develocity build cache metadata that marks Checkstyle as not cacheable.

Changes:

  • Add a workflow step that installs a global post-checkout git hook.
  • The hook appends a buildCache.registerMojoMetadataProvider block into .mvn/develocity-custom-user-data.groovy to set notCacheableBecause(...) for the Maven Checkstyle plugin.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread .github/workflows/run-experiments-hibernate-search.yml
Comment thread .github/workflows/run-experiments-hibernate-search.yml
Comment thread .github/workflows/run-experiments-hibernate-search.yml
@ribafish
Copy link
Copy Markdown
Member Author

Reply to copilot comments:

  1. "Targets all mojos, not just checkstyle:check" — True but irrelevant; both check and checkstyle goals have the same issue. This is the established pattern (see OpenAPI Generator PR Fix OpenAPI Generator post-checkout hook for surefire cache exclusion #186).
  2. "Hook appends on every checkout, could duplicate" — Not an issue; the validation scripts check out once per build. Same pattern used across all other hooks in this repo.
  3. "Assumes .mvn/ exists" — It does; Hibernate Search ships .mvn/ with develocity.xml and extensions.xml.

@ribafish
Copy link
Copy Markdown
Member Author

This looks like it won't be needed:

Upstream PR has activity: hibernate/hibernate-search#5067
-> they migrated some changes to hibernate/hibernate-develocity-maven-extension#86

@ribafish ribafish closed this Mar 25, 2026
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