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

Artifactory doesn't meet configuration cache requirements #102

Open
maksym-moroz opened this issue Jan 22, 2024 · 3 comments
Open

Artifactory doesn't meet configuration cache requirements #102

maksym-moroz opened this issue Jan 22, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@maksym-moroz
Copy link

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 maksym-moroz added the bug Something isn't working label Jan 22, 2024
@maksym-moroz
Copy link
Author

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.

@ahna92
Copy link

ahna92 commented Jul 24, 2024

We are also facing this issue ,

id("com.jfrog.artifactory") version "5.2.3"
* What went wrong:
Configuration cache problems found in this build.

31 problems were found storing the configuration cache, 8 of which seem unique.
- Task `:artifactoryDeploy` of type `org.jfrog.gradle.plugin.artifactory.task.DeployTask`: cannot serialize object of type 'org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See https://docs.gradle.org/8.2.1/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:artifactoryDeploy` of type `org.jfrog.gradle.plugin.artifactory.task.DeployTask`: cannot serialize object of type 'org.jfrog.gradle.plugin.artifactory.task.ExtractModuleTask', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See https://docs.gradle.org/8.2.1/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:artifactoryDeploy` of type `org.jfrog.gradle.plugin.artifactory.task.DeployTask`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/8.2.1/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
- Task `:artifactoryPublish` of type `org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/8.2.1/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
- Task `:extractModuleInfo` of type `org.jfrog.gradle.plugin.artifactory.task.ExtractModuleTask`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/8.2.1/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
- Task `:lib:artifactoryPublish` of type `org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask`: cannot serialize object of type 'org.gradle.api.publish.maven.internal.publication.DefaultMavenPublication', a subtype of 'org.gradle.api.publish.Publication', as these are not supported with the configuration cache.
  See https://docs.gradle.org/8.2.1/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:lib:artifactoryPublish` of type `org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/8.2.1/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
- Task `:lib:extractModuleInfo` of type `org.jfrog.gradle.plugin.artifactory.task.ExtractModuleTask`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/8.2.1/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

See the complete report at file:///Users/me/StudioProjects/project/android/build/reports/configuration-cache/1deqk42euvnt03jmj395oe93s/5upf8vrf3cmzjg76y8lu1m5fm/configuration-cache-report.html
> Invocation of 'Task.project' by task ':lib:artifactoryPublish' at execution time is unsupported.
> Invocation of 'Task.project' by task ':artifactoryPublish' at execution time is unsupported.
> Invocation of 'Task.project' by task ':extractModuleInfo' at execution time is unsupported.
> Invocation of 'Task.project' by task ':lib:extractModuleInfo' at execution time is unsupported.
> Invocation of 'Task.project' by task ':artifactoryDeploy' at execution time is unsupported.

@nskvortsov
Copy link

Also a recently reported excessive capture of the build environment: #127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants