feat: add has_last_result? to WorkflowInfo #351
Merged
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 was changed
Added
has_last_result?to determine if there was a previous workflow resultWhy?
Adding
has_last_result?allow to differentiate between no previous result and anilprevious result.This was the same approach taken by the Python SDK temporalio/sdk-python#1067 to differentiate between no previous result and a
nil/Noneresult. I think this makes sense, but unsure if there's a more idiomatic Ruby way of approaching this.Checklist
Closes [Feature Request] Provide last result and last failure to workflows #281
How was this tested:
Added unit tests using
last_failure,last_resultandhas_last_result?. These tests were adapted from the Python SDK tests.Any docs updates needed?
I believe the YARD docs should be sufficient