-
Notifications
You must be signed in to change notification settings - Fork 217
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
Support extracting workflow and activity options from context #388
Support extracting workflow and activity options from context #388
Conversation
a0e97b9
to
17259f9
Compare
// assertNonZero checks that every top level value, struct field, and item in a slice is a non-zero value. | ||
func assertNonZero(t *testing.T, i interface{}) { | ||
_assertNonZero(t, i, reflect.ValueOf(i).Type().Name()) | ||
} |
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.
Apologies if this is overwrought; I think it's nice to have peace of mind that tests would break if new fields are added but not accounted for in tests or conversion functions, but it's not essential to this changeset.
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.
Awesome! Thanks for the contribution!
To merge the license header has to be added:
|
Generated via 'go run ./internal/cmd/tools/copyright/licensegen.go'
92d0f8b
to
64bc3a5
Compare
Description, Motivation and Context
What was changed
This PR adds three new public functions to the
workflow
package:GetChildWorkflowOptions
GetActivityOptions
GetLocalActivityOptions
Motivation & Context
In interceptors and workflow/activity wrapper functions, it was previously not possible to set default option values that could be overridden by the parent context.
By extracting the existing workflow or activity options from the workflow context, we can now conditionally set defaults only when a value has not already been specified:
Closes issue: N/A
How has this been tested?
The changeset should be covered by unit tests.
Checklist: