Skip to content

Add WorkflowCheck Gradle plugin module - #2931

Open
robzienert wants to merge 2 commits into
temporalio:mainfrom
robzienert:add-workflowcheck-gradle-plugin
Open

Add WorkflowCheck Gradle plugin module#2931
robzienert wants to merge 2 commits into
temporalio:mainfrom
robzienert:add-workflowcheck-gradle-plugin

Conversation

@robzienert

@robzienert robzienert commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What changed?

  • Added a new temporal-workflowcheck-gradle-plugin module
  • Published a Gradle plugin with id io.temporal.workflowcheck
  • The plugin detects the consumer's io.temporal:temporal-sdk version from runtimeClasspath, resolves the matching io.temporal:temporal-workflowcheck analyzer, and registers a workflowCheck verification task.
  • Wired workflowCheck into the Gradle check lifecycle.
  • Added configuration for source sets, failure behavior, valid-method output, default config suppression, extra config files, ASM override, and forked JVM heap size.
  • Added Gradle TestKit coverage and module README usage documentation.

Why?

temporal-workflowcheck is 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

@robzienert
robzienert force-pushed the add-workflowcheck-gradle-plugin branch 2 times, most recently from e5a9fec to dcff0f8 Compare June 26, 2026 21:54
@robzienert
robzienert force-pushed the add-workflowcheck-gradle-plugin branch from dcff0f8 to b426996 Compare June 26, 2026 22:00
@robzienert
robzienert marked this pull request as ready for review June 26, 2026 22:00
@robzienert
robzienert requested a review from a team as a code owner June 26, 2026 22:00
Comment thread gradle/publishing.gradle
}
plugins.withId('java') {
from components.java
if (name != 'temporal-workflowcheck-gradle-plugin') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, we should document the requirement temporal-sdk >= 1.33.0


List<File> classpathFiles = new ArrayList<>(getClasspath().getFiles());
String maxHeap = getMaxHeapSize().getOrNull();
getLogger()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will log every classpath we scan. This could cause a very large output for large repos right? I would consider lowering the severity

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

Successfully merging this pull request may close these issues.

2 participants