Description
Cadence client API like ReplayWorkflowHistoryFromJSONFile is used for protection against non-backward compatible changes to workflow implementation. The idea is to store sample of some execution histories and then have a unit test which replay new workflow implementation using ReplayWorkflowHistoryFromJSONFile API to look for non determinism error. This provides good protection if user makes non-backwards compatible changes in the workflow implementation resulting in different code path which triggers different decisions by the workflow implementation. Cadence client can easily detect such changes and fail unit test by throwing non-deterministic error.
Current approach does not work for the following 2 use cases:
- Workflow implementation makes a non-backwards compatible change to local state within workflow implementation which does not result into different decision on replay.
- Workflow implementation completes/ContinueAsNew with a different result.
Straw-man proposal to allow user to add protection for above 2 cases by having more fine grained semantics exposed through replay API. We need a replayer API to allow following:
- Capability to replay upto various event id
- Allow Query results to be exposed to caller after replay
- Allow Completion/ContinueAsNew result to be exposed to caller after replay
With these capabilities we believe clients should be able to add protection for non-backward compatible changes as part unit test by asserting internal workflow state during replay.