Add options to GetVersion for executeWithVersion and executeWithMinVersion #1008
+730
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed?
GetVersionOptions
class with builder pattern for configuring version control behaviorexecuteWithVersion(int version)
option to force a specific version instead of max supported versionexecuteWithMinVersion()
option to use min supported version instead of max supported versiongetVersion()
method to accept optionalGetVersionOptions
parametergetVersionWithCustomVersion()
andgetVersionWithMinVersion()
ClockDecisionContext
andDecisionContext
for version selectionWhy?
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:
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?
GetVersionOptionsTest.java
covering all builder methods and edge casesEnhancedGetVersionTest.java
demonstrating real workflow execution with new optionsTestWorkflowEnvironmentGetVersionTest.java
to verify testing framework supportWorkflowTest.java
to ensure backward compatibilitygetVersion()
calls continue to work without modificationdocker-compose -f docker-compose.yaml run unit-test-test-service
passedPotential risks
getVersion()
without options will continue to work exactly as beforeRelease notes
This is a notable feature addition that should be mentioned in the release notes:
GetVersionOptions
executeWithVersion()
andexecuteWithMinVersion()
options togetVersion()
methodgetVersionWithCustomVersion()
andgetVersionWithMinVersion()
Documentation Changes
Yes, documentation updates should be made to reflect the new version control features:
GetVersionOptions
executeWithVersion()
andexecuteWithMinVersion()
The documentation should be updated in the Cadence documentation repository to help users understand and adopt these new features effectively.