-
Notifications
You must be signed in to change notification settings - Fork 225
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
Upgrade to Nexus SDK 0.2.0 #1802
Conversation
1524297
to
1a3b09b
Compare
temporalnexus/operation.go
Outdated
|
||
// workflowRunOperationToken is the decoded form of the workflow run operation token. | ||
type workflowRunOperationToken struct { | ||
NamespaceName string `json:"ns"` |
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.
Is this format expected to be consistent across SDKs?
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'd expect it to. Happy for others to chime in.
@@ -2504,7 +2504,7 @@ func (env *testWorkflowEnvironmentImpl) ExecuteNexusOperation( | |||
}, true) | |||
case *nexuspb.StartOperationResponse_AsyncSuccess: | |||
env.postCallback(func() { | |||
opID = v.AsyncSuccess.GetOperationId() | |||
opID = v.AsyncSuccess.GetOperationToken() |
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.
nit
opID = v.AsyncSuccess.GetOperationToken() | |
opToken = v.AsyncSuccess.GetOperationToken() |
@@ -3241,7 +3241,7 @@ func (h *testNexusOperationHandle) startedCallback(opID string, e error) { | |||
// Ignore duplciate starts. | |||
return | |||
} | |||
h.operationID = opID | |||
h.operationToken = opID |
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.
nit
h.operationToken = opID | |
h.operationToken = opToken |
@@ -444,9 +467,17 @@ func (h *nexusTaskHandler) nexusHandlerErrorToProto(handlerErr *nexus.HandlerErr | |||
if err != nil { | |||
return nil, err | |||
} | |||
var retryBehavior enumspb.NexusHandlerErrorRetryBehavior |
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.
// Not using errors.As to be consistent ApplicationError checking with the rest of the SDK. | ||
if appErr, ok := err.(*ApplicationError); ok && appErr.NonRetryable() { | ||
return nexus.NewFailedOperationError(appErr) | ||
return &nexus.HandlerError{ | ||
// TODO(bergundy): Change this to a non retryable internal error after the 1.27.0 server release. |
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 we create to track this? Also doesn't this need to be done before GA since it is a breaking change?
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.
@@ -444,9 +467,17 @@ func (h *nexusTaskHandler) nexusHandlerErrorToProto(handlerErr *nexus.HandlerErr | |||
if err != nil { |
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.
Nit: it seems like we have all the Nexus error conversion logic here https://github.com/temporalio/sdk-go/pull/1802/files#diff-82a19cd3836c5a75e55d9c5d4400c0bfdd09029eb29fd1fa9755cf1a724f4654R86 except this one function. Not blocking but might be nice to group it.
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.
There's maybe a slight duplication but I don't think it's very critical apart from the grouping.
return base64.URLEncoding.WithPadding(base64.NoPadding).EncodeToString(data), nil | ||
} | ||
|
||
func loadWorkflowRunOperationToken(data string) (workflowRunOperationToken, error) { |
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.
During the meeting yesterday @cretz suggested we reserve v
for a versioning field and fail if it is present. Did we decided not to do that?
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.
Ah thanks, that slipped my mind.
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.
Coming in the next commit.
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 think we need an interceptor to get the client, I can add it here or in a separate PR.
return base64.URLEncoding.WithPadding(base64.NoPadding).EncodeToString(data), nil | ||
} | ||
|
||
func loadWorkflowRunOperationToken(data string) (workflowRunOperationToken, error) { |
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.
Ah thanks, that slipped my mind.
Not sure I understand what do you mean exactly by "need an interceptor" here? We don't have Temporal Nexus inbound or outbound interceptors that is on my plate. When we add them |
39fdda4
to
3372fb9
Compare
bacdf79
to
b14e6b0
Compare
Do not merge before we update the dependencies to use a published api-go and Nexus Go SDK.
Tested against server 1.26.2 and changes made in temporalio/temporal#7241.