Skip to content

Add upgrade-on-CAN support#2811

Merged
THardy98 merged 6 commits intomasterfrom
pr/upgrade-on-can
Mar 27, 2026
Merged

Add upgrade-on-CAN support#2811
THardy98 merged 6 commits intomasterfrom
pr/upgrade-on-can

Conversation

@THardy98
Copy link
Copy Markdown
Contributor

@THardy98 THardy98 commented Mar 18, 2026

Summary

  • Allow PINNED workflows to detect when the target worker deployment version has changed via WorkflowInfo.isTargetWorkerDeploymentVersionChanged()
  • Add initialVersioningBehavior option on ContinueAsNewOptions to support upgrading to the latest version on continue-as-new (AUTO_UPGRADE)
  • Update proto submodule for new ContinueAsNewVersioningBehavior and targetWorkerDeploymentVersionChanged fields
  • Add isTargetWorkerDeploymentVersionChanged() override in DummySyncWorkflowContext
  • Add integration test for the full upgrade-on-CAN flow

@THardy98 THardy98 marked this pull request as ready for review March 18, 2026 16:30
@THardy98 THardy98 requested a review from a team as a code owner March 18, 2026 16:30
@THardy98 THardy98 force-pushed the pr/upgrade-on-can branch 3 times, most recently from 13b3773 to 82235fc Compare March 18, 2026 19:09
boolean isContinueAsNewSuggested();

/**
* @return the reasons why continue-as-new is suggested, or an empty list if not suggested. This
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'd suggest adding a mention that this requires server > v1.x.y at the time that the current WFT was initially executed; i.e. the list will always be empty on older servers.

It is not always pertinent to mention server versions, but in this specific case, I fear that some user may damage their existing workflow executions if they start using this API with incorrect assumptions.

THardy98 and others added 5 commits March 27, 2026 15:22
- Add isTargetWorkerDeploymentVersionChanged() to WorkflowInfo, plumbed
  through WorkflowTaskStateMachine → WorkflowStateMachines →
  ReplayWorkflowContext → WorkflowInfoImpl → WorkflowInfo
- Add initialVersioningBehavior on ContinueAsNewOptions, allowing
  workflows to CAN with AUTO_UPGRADE to move to the new version
- Wire initialVersioningBehavior encoding in SyncWorkflowContext
- Update API proto submodule to include api#709 and #721 changes
- Fix NexusWorker deprecation warnings from proto update

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rsioning test

The CAN test workflows no longer inherit unnecessary mySignal/getState
methods from QueryableWorkflow. Instead they implement a dedicated
ContinueAsNewVersionUpgradeWorkflow interface with execute(int attempt),
matching the pattern used by other SDKs (Python/Go/TS/.NET).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add @SuppressWarnings("deprecation") to test methods calling the
deprecated setOperationError() API, preventing -Werror from failing
the build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@THardy98 THardy98 force-pushed the pr/upgrade-on-can branch from 00ee392 to 0135f11 Compare March 27, 2026 22:22
@THardy98 THardy98 merged commit da5e8a1 into master Mar 27, 2026
17 checks passed
@THardy98 THardy98 deleted the pr/upgrade-on-can branch March 27, 2026 22:57
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.

3 participants