Nexus Standalone: Start + Describe#9487
Conversation
469761d to
5653b5c
Compare
c11d5be to
18cc7c6
Compare
5653b5c to
e524f3e
Compare
18cc7c6 to
ace3e84
Compare
e524f3e to
9f16247
Compare
ace3e84 to
3984b20
Compare
9f16247 to
318f104
Compare
3984b20 to
f29c9cc
Compare
318f104 to
d0991cc
Compare
8bcb6e7 to
d7411cf
Compare
d0991cc to
764aa94
Compare
d7411cf to
4d205bd
Compare
764aa94 to
48cb4b5
Compare
853646f to
9d77393
Compare
48cb4b5 to
a56b849
Compare
a7032dd to
b362c16
Compare
a56b849 to
dd59299
Compare
dd59299 to
3573e90
Compare
01a8083 to
293d69c
Compare
293d69c to
259059f
Compare
c2bb9c9 to
fc63ef8
Compare
| ) (bool, error) { | ||
| return false, serviceerror.NewUnimplemented("unimplemented") | ||
| // TODO: implement | ||
| return false, nil |
There was a problem hiding this comment.
Required to make tests pass.
259059f to
8ae49db
Compare
fc63ef8 to
e384f18
Compare
|
|
||
| func operationExecutionStatus(status nexusoperationpb.OperationStatus) enumspb.NexusOperationExecutionStatus { | ||
| switch status { | ||
| case nexusoperationpb.OPERATION_STATUS_SCHEDULED, |
bffc1f9 to
942ddd7
Compare
| } | ||
|
|
||
| // DescribeNexusOperation queries current operation state. | ||
| // TODO: Add long-poll support. |
There was a problem hiding this comment.
Will be added together with Poll API.
| return chasm.TerminateComponentResponse{}, nil | ||
| } | ||
| return chasm.TerminateComponentResponse{}, transitionFailed.Apply(o, ctx, EventFailed{}) | ||
| } |
There was a problem hiding this comment.
^ needed for chasm.RootComponent
|
|
||
| service NexusOperationService { | ||
| rpc StartNexusOperation(StartNexusOperationRequest) returns (StartNexusOperationResponse) { | ||
| option (temporal.server.api.routing.v1.routing).business_id = "frontend_request.operation_id"; |
There was a problem hiding this comment.
You will need to add to both RPCs:
option (temporal.server.api.common.v1.api_category).category = API_CATEGORY_STANDARD;
Use nexusoperation.Enabled flag instead of ChasmNexusEnabled for standalone operation APIs. All handlers check the feature flag. Added StartDisabled/DescribeDisabled tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Per review feedback: both StartNexusOperation and DescribeNexusOperation need API_CATEGORY_STANDARD annotation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bergundy
left a comment
There was a problem hiding this comment.
Overall LGTM. I had a hard stop and didn't quite get to reviewing the tests or the the search attribute validation logic (which is okay if it was copied from SAA).
chasm/lib/nexusoperation/frontend.go
Outdated
| func (h *frontendHandler) StartNexusOperationExecution(context.Context, *workflowservice.StartNexusOperationExecutionRequest) (*workflowservice.StartNexusOperationExecutionResponse, error) { | ||
| return nil, serviceerror.NewUnimplemented("StartNexusOperationExecution not implemented") | ||
| func (h *frontendHandler) checkEnabled(namespaceName string) error { | ||
| if !h.config.ChasmEnabled(namespaceName) || !h.config.ChasmNexusEnabled(namespaceName) { |
There was a problem hiding this comment.
We need a separate DC here to enable standalone to be able to turn the two separate features on.
chasm/lib/nexusoperation/handler.go
Outdated
| NamespaceID: req.GetNamespaceId(), | ||
| BusinessID: frontendReq.GetOperationId(), | ||
| }, | ||
| func(ctx chasm.MutableContext, req *nexusoperationpb.StartNexusOperationRequest) (*Operation, error) { |
There was a problem hiding this comment.
Would you please create a NewStandaloneOperation constructor instead of inlining all of this logic?
|
|
||
| // closeTime returns the close time of the operation based on LastAttemptCompleteTime for terminal states. | ||
| func (o *Operation) closeTime() *timestamppb.Timestamp { | ||
| switch o.Status { |
There was a problem hiding this comment.
nit: you can also check if LifecycleState isn't "running", it would save a tiny bit of duplicate logic but not critical.
|
|
||
| func operationExecutionStatus(status nexusoperationpb.OperationStatus) enumspb.NexusOperationExecutionStatus { | ||
| switch status { | ||
| case nexusoperationpb.OPERATION_STATUS_SCHEDULED, |
What changed?
Add Nexus Standalone Describe and Start handlers.
How did you test it?