Skip to content

Conversation

pandeyanshuman
Copy link

What changed?

  • Added support for enhanced version control options in workflow execution:
    • Introduced GetVersionOptions class with builder pattern for configuring version control behavior
    • Added executeWithVersion(int version) option to force a specific version instead of max supported version
    • Added executeWithMinVersion() option to use min supported version instead of max supported version
    • Enhanced getVersion() method to accept optional GetVersionOptions parameter
    • Added convenience methods getVersionWithCustomVersion() and getVersionWithMinVersion()
    • Updated all workflow interceptor interfaces and implementations to support new options
    • Updated internal replay logic in ClockDecisionContext and DecisionContext for version selection
    • Added comprehensive testing framework support for enhanced version control features
    • Added extensive test coverage including unit tests, integration tests, and TestWorkflowEnvironment tests

Why?

This change ports the enhanced version control functionality from the Go client (PRs #1427 and #1428) to the Java client, enabling safer deployment strategies and more granular control over workflow version execution. The new options allow developers to:

  • Separate code deployment from feature activation through controlled version rollouts
  • Force specific versions for testing or gradual rollouts
  • Use minimum supported versions for backward compatibility scenarios
  • Test workflows with enhanced version control in unit test environments

This improves the workflow versioning system by providing more granular control over version execution, enabling safer rollouts of workflow changes.

How did you test it?

  • Added comprehensive unit tests in GetVersionOptionsTest.java covering all builder methods and edge cases
  • Added integration tests in EnhancedGetVersionTest.java demonstrating real workflow execution with new options
  • Added TestWorkflowEnvironmentGetVersionTest.java to verify testing framework support
  • Updated existing WorkflowTest.java to ensure backward compatibility
  • Verified that all existing getVersion() calls continue to work without modification
  • Tested version selection logic in replay mode and non-replay mode
  • Validated that convenience methods work correctly and produce expected results
  • Ensured TestWorkflowEnvironment properly emulates Cadence worker behavior for enhanced features
  • Unit tests docker-compose -f docker-compose.yaml run unit-test-test-service passed

Potential risks

  • Low Risk: The changes are fully backward-compatible - existing workflows using getVersion() without options will continue to work exactly as before
  • Low Risk: New functionality is additive and doesn't modify existing behavior
  • Low Risk: All existing tests continue to pass, indicating no regression in functionality
  • Minimal Risk: If the new options are used incorrectly, workflows may behave differently than expected, but this is mitigated by comprehensive documentation and examples

Release notes

This is a notable feature addition that should be mentioned in the release notes:

  • New Feature: Enhanced version control for workflows with GetVersionOptions
  • New Feature: Added executeWithVersion() and executeWithMinVersion() options to getVersion() method
  • New Feature: Added convenience methods getVersionWithCustomVersion() and getVersionWithMinVersion()
  • Enhancement: Improved testing framework support for version-controlled workflows
  • Compatibility: Fully backward-compatible - no breaking changes

Documentation Changes

Yes, documentation updates should be made to reflect the new version control features:

  • Update workflow versioning documentation to include examples of the new GetVersionOptions
  • Add examples showing safe deployment strategies using executeWithVersion() and executeWithMinVersion()
  • Document the convenience methods and their use cases
  • Update testing documentation to show how to test workflows with enhanced version control
  • Consider adding a new section on "Safe Deployment Strategies" or "Advanced Version Control"

The documentation should be updated in the Cadence documentation repository to help users understand and adopt these new features effectively.

Add support for ExecuteWithVersion and ExecuteWithMinVersion options to getVersion method,
porting functionality from cadence-go-client PRs #1427 and #1428.

Changes:
- Add GetVersionOptions class with builder pattern for version control configuration
- Add executeWithVersion() and executeWithMinVersion() methods to GetVersionOptions
- Add overloaded getVersion() method that accepts GetVersionOptions parameter
- Add convenience methods getVersionWithCustomVersion() and getVersionWithMinVersion()
- Update all workflow interceptor interfaces and implementations to support new options
- Update DecisionContext, ClockDecisionContext, and related classes for version selection logic
- Add testing framework support for enhanced version control features
- Add comprehensive test coverage for new functionality

This enables safer deployment strategies and more granular control over workflow
version execution, allowing developers to:
- Force specific versions instead of max supported version
- Use minimum supported version for backward compatibility
- Test workflows with enhanced version control in test environments

Fixes compilation errors and ensures all existing functionality remains compatible.
@pandeyanshuman pandeyanshuman marked this pull request as ready for review June 25, 2025 16:07
@pandeyanshuman pandeyanshuman enabled auto-merge (squash) June 25, 2025 16:11
@pandeyanshuman pandeyanshuman changed the title Add options to get version Add options to GetVersion for executeWithVersion and executeWithMinVersion Jun 25, 2025
shijiesheng and others added 15 commits October 13, 2025 13:04
…al log for TEnumType converter (cadence-workflow#1011)

What changed?

added deprecation log for TEnumType converter
log only payload class rather than body
Why?

In V4, default support for thrift message will be dropped
What changed?

point API to the new central publisher portal
change github release action to directly release
Why?

deprecation of old nexus portal

How did you test it?

locally uploaded (see https://central.sonatype.com/artifact/com.uber.cadence/cadence-client/3.12.8-rc.1)
* Added github action tests

* Fix naming in yaml file

---------

Co-authored-by: Mandy Chen <[email protected]>
* Always upload artifacts

* Test upload after fail

* Try with running test

* Remove forced fail

---------

Co-authored-by: Mandy Chen <[email protected]>
What changed?

Remove internal TaskListKind entity
use thrift entity directly (like everywhere else in the repo)
Why?

This complicates things and particularly for thrift deprecation

How did you test it?

Unit Test



Signed-off-by: Shijie Sheng <[email protected]>
Signed-off-by: Shijie Sheng <[email protected]>

What changed?

Remove raw history support in client. (It's already reviewed and merged in a side branch cadence-workflow#1004 ) Now we are checking into main branch

Why?

History is stored as Thrift encoded binary. Sending raw history in Thrift will no longer be supported in V4

How did you test it?

Unit Test
Signed-off-by: Shijie Sheng <[email protected]>

What changed?

Add new internal entities that will replace thrift ones.
These entities will be used in the next few diffs that removed thrift support.

To generate entities, ./scripts/v4_entity_generator/run.sh

Why?

Thrift entities are not easily replaceable by GRPC ones. One quick approach for deprecation is to generate similar interface internal entities to replace thrift ones.

How did you test it?

These are generated by script
cadence-workflow#1022)

What changed?

Migration Guide

To construct GRPC Workflow Service use new WorkflowServiceGrpc() instead of new Thrift2ProtoAdapter(IGrpcServiceStubs.newInstance());
Removed TException and now all workflow service method returns CadenceError instead;
Replaced thrift generated entities with internal entities (Currently still generated from thrift files but no longer has runtime dependency on thrift);
Removed support for thrift entities in default data converter;
Why?

Java thrift deprecation

How did you test it?

Unit Test
…ow#1027)

What changed?

Default data converter would throw I/O exception and thus fail workflow processing if the exception no longer exists. This PR changes the behavior by return null instead.

Why?

In V4, thrift exceptions will be removed and thus this is needed to avoid breaking existing workflows.

How did you test it?

Unit Test
…-workflow#1030)

What changed?

nullable check before setting the field in GRPC entities
Why?

GRPC entities have nullable checks
auto-merge was automatically disabled October 13, 2025 11:08

Pull request was closed

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.

5 participants