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

Use steps name as task input instead of steps to generate a consistent cache key #2169

Closed
wants to merge 2 commits into from

Conversation

jprinet
Copy link

@jprinet jprinet commented Jun 12, 2024

Fixes #2168

@@ -28,7 +28,7 @@
* to not introduce any windows-style newlines as well.
*/
public interface FormatterStep extends Serializable, AutoCloseable {
/** The name of the step, for debugging purposes. */
/** The name of the step, for debugging purposes and to uniquely identify a step when computing the Gradle Build Cache key. */

Choose a reason for hiding this comment

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

What happens if the implementation of the FormatterStep changes? I worry that the name alone is not enough, and that this could introduce negative cache hits.

Copy link
Author

Choose a reason for hiding this comment

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

That's a very good point, I did not consider implementation changes

Copy link
Author

Choose a reason for hiding this comment

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

Not sure if relying on (meaningful) hashcode could work

Copy link
Author

Choose a reason for hiding this comment

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

Double thinking it, an implementation change should be shipped in a new version of the plugin, which would be reflected in the task classpath.

@nedtwigg
Copy link
Member

Thanks for the initiative, I think this approach is barking up the wrong tree. See my comment in #2168.

@nedtwigg nedtwigg closed this Jun 12, 2024
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.

Gradle build cache miss due to volatility of SpotlessTask.steps input
3 participants