Closed trevjonez closed 11 months ago
Hi @trevjonez, thanks for reporting, we appreciate your suggestions and explanations. For now, our suggested workaround is using the Gradle --no-configuration-cache
flag which will switch off the feature even if the property is set to true in gradle.properties
. To include the Gradle flag with snyk command, it has to be preceded by double dash, e.g. snyk test -- --no-configuration-cache
.
I have reported your request. Until we have the time to work on a long-term solution, we are planning to add this flag by default to the command we run in the init script.
Expected behaviour
Any configuration or plugin injected to gradle projects should be configuration cache compatible to ensure the snyk plugin does not become a developer productivity bottleneck.
Actual behaviour
Currently the init script that is injected causes issues with configuration cache enabled projects.
Steps to reproduce
add the following to a gradle project's
gradle.properties
Invoke the snyk added tasks with the init script added.
Workaround for CI builds
add a sed command before invoking the snyk CLI to disable configuration caching.
Thinking out loud
As mentioned in https://github.com/snyk/snyk-gradle-plugin/issues/192#issuecomment-1240028727 I think it is likely time the snyk gradle integration is reworked to use a full pre-published gradle plugin. This would allow testing via gradleTestKit and potentially being able to simplify the main snyk cli by relocating the invocation configuration to a gradle DSL checked in by the consumer.