-
Notifications
You must be signed in to change notification settings - Fork 805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor high-coupling method into functions in applyEvent for a more testability #6089
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
newStateBuilder stateBuilderProvider | ||
newMutableState mutableStateProvider | ||
newReplicationTaskFn newReplicationTaskFn | ||
newBranchManager branchManagerProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add Fn
suffix to these function parameters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do.
} | ||
return r.applyNonStartEventsToNoneCurrentBranch(ctx, context, mutableState, branchIndex, releaseFn, task) | ||
// passed in r because there's a recursive call within applyNonStartEventsToNoneCurrentBranchWithContinueAsNew | ||
return r.applyNonStartEventsToNoneCurrentBranchFn(ctx, context, mutableState, branchIndex, releaseFn, task, r) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I could do this here. It is actually a recursive call. If I change this applyEvents method to be a function, there would be too many things to be passed in into this function.
newStateBuilder stateBuilderProvider | ||
newMutableState mutableStateProvider | ||
newReplicationTaskFn newReplicationTaskFn | ||
newBranchManager branchManagerProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do.
Pull Request Test Coverage Report for Build 018fe0a0-cddd-4e8a-9e06-8a5a8650a29cDetails
💛 - Coveralls |
… testability (cadence-workflow#6089) * refactor coupled functions for a more testability * renaming old functions
What changed?
Refactored methods in applyEvent to be functions, and make them as historyReplicator parameters
Why?
Easier to do unit test
How did you test it?
Potential risks
Release notes
Documentation Changes