Add WorkflowCheck Gradle plugin module - #2931
Conversation
e5a9fec to
dcff0f8
Compare
dcff0f8 to
b426996
Compare
| } | ||
| plugins.withId('java') { | ||
| from components.java | ||
| if (name != 'temporal-workflowcheck-gradle-plugin') { |
There was a problem hiding this comment.
I believe this is breaking the publication of the gradle plugin. The artifact has no POM metadata and is not signed at least in my testing.
| getLogger().lifecycle(stripTrailing(output)); | ||
| } | ||
|
|
||
| if (result.getExitValue() != 0 && getFailOnViolation().get()) { |
There was a problem hiding this comment.
io.temporal.workflowcheck.Main ca return a non zero value for configuration failures, but if FailOnViolation is not set then it will appear like a pass even if the analyzer didn't really run
| ```groovy | ||
| plugins { | ||
| id 'java' | ||
| id 'io.temporal.workflowcheck' |
There was a problem hiding this comment.
NIT: We should have a version here no otherwise this won't actually work if a user just copy and pastes it
|
|
||
| The plugin automatically: | ||
|
|
||
| - Detects the Temporal SDK version from `runtimeClasspath`. |
There was a problem hiding this comment.
Note, we should document the requirement temporal-sdk >= 1.33.0
|
|
||
| List<File> classpathFiles = new ArrayList<>(getClasspath().getFiles()); | ||
| String maxHeap = getMaxHeapSize().getOrNull(); | ||
| getLogger() |
There was a problem hiding this comment.
This will log every classpath we scan. This could cause a very large output for large repos right? I would consider lowering the severity
What changed?
temporal-workflowcheck-gradle-pluginmoduleio.temporal.workflowcheckio.temporal:temporal-sdkversion fromruntimeClasspath, resolves the matchingio.temporal:temporal-workflowcheckanalyzer, and registers aworkflowCheckverification task.workflowCheckinto the Gradlechecklifecycle.Why?
temporal-workflowcheckis useful for catching non-deterministic calls in Workflow implementations, but Gradle users currently need to wire the analyzer themselves. This module provides a first-party Gradle integration that automatically uses the analyzer version matching the Temporal Java SDK on the consuming project's classpath.Breaking changes?
No.
Server PR
No server changes required.
Testing
We've been using this across many different project types within Netflix for a few months and have verified that this approach even for projects with massive classpaths.
./gradlew --no-daemon :temporal-workflowcheck-gradle-plugin:test./gradlew --no-daemon :temporal-workflowcheck-gradle-plugin:spotlessCheck