jfrog / artifactory-gradle-plugin

JFrog Gradle plugin for Build Info extraction and Artifactory publishing.
Apache License 2.0
20 stars 15 forks source link

Artifactory doesn't meet configuration cache requirements #102

Open maksym-moroz opened 6 months ago

maksym-moroz commented 6 months ago

Describe the bug

No ability to enable configuration cache while using artifactory as well as the fact artifactory makes use of cross configuration killing gains possible by configureondemand Gradle feature

Current behavior

Cross configuration and use of Project in task actions, implicit input/outputs instead of specified explicitly

Reproduction steps

Use artifactory gradle plugin

Expected behavior

Artifactory plugins adhere to best practices for Gradle plugins, avoid cross configuration, use lazy APIs, migrate all configuration cache incompatible code to new APIs https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements

Artifactory Gradle plugin version

5.1.13

Operating system type and version

MacOS

JFrog Artifactory version

No response

Gradle version

No response

maksym-moroz commented 6 months ago

I took a look around and found #89 that brings up this issue and #58 is supposed to address this. Looking at the code I think there was a misunderstanding on your part what configuration cache actually means.

58 adds the functional test that passes the command "gradle --configuration-cache" which in turn essentially runs help with configuration cache enabled.

I think you are conflicting task avoidance like register() instead of eager creating during configuration with what it means to actually make your plugin compatible with configuration cache. Configuration cache works by defining strict IO rules which allow for the actual caching, and that means there are strict requirements you can find here. This means what you actually want to do in your test is to call runGradleArtifactoryPublish passing down the configuration cache flag. It will highlight a plethora of issues and those are the ones that need to be addressed to make artifactory plugin configuration cache compatible. Let me know if you need more details.