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

downloadSchemasTask is always executed even when inputs don't change #179

Open
filipblondeel opened this issue Apr 19, 2024 · 2 comments
Open

Comments

@filipblondeel
Copy link

filipblondeel commented Apr 19, 2024

As mentioned in discussion #178, the downloadSchemasTask is always executed even when the inputs don't change.

I have created https://github.com/filipblondeel/imflog-schema-registry-plugin_issue-179 with a minimal Gradle build that shows this behavior.

When I run ./gradlew downloadSchemasTask multiple times, the downloadSchemasTask is never marked as 'UP-TO-DATE'. However, since the inputs of the task don't change, I would expect it to be up-to-date after the first run.

@filipblondeel
Copy link
Author

filipblondeel commented May 7, 2024

I tried setting the outputs property of the downloadSchemasTask to make the incremental build work but that causes this error:

> Task :downloadSchemasTask FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':downloadSchemasTask'.
> Cannot fingerprint input property 'metadataConfig': value 'MetadataExtension(enabled=false, outputPath=null)' cannot be serialized.

See: https://github.com/filipblondeel/imflog-schema-registry-plugin_issue-179/blob/with-output-set/build.gradle.kts

@ImFlog
Copy link
Owner

ImFlog commented May 31, 2024

Hey, sorry for the delay, found a couple minutes today to look at some issues of this project.
Looking quickly at your example I think It may be related to the fact that MetadataExtension and DownloadSubjects are Kotlin data classes, which are not Serializable and they are passed as Input of the Gradle task.

If we migrate those data classes to Classes that implement Serializable we might be able to use the task caching correclty.
Might want to not cache the cases where we pass -1 for version as it means we want to resolve the version at each run.

If you want to throw a PR starting only on the DownloadTask for instance to validate this, that would be great !
If not I will work on this next when I get the chance 😅

filipblondeel added a commit to filipblondeel/schema-registry-plugin that referenced this issue 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

No branches or pull requests

2 participants