[SDK Ergonomics] NEXUS-519: Support Query-backed Nexus Operations - #11274
Conversation
c6bd436 to
d0784fb
Compare
52ae6e5 to
2657210
Compare
|
Claude finished @mavemuri's task in 7m 1s —— View job Review complete
Overall the change looks sound: the |
2657210 to
ad84e98
Compare
7c59a1e to
203efe9
Compare
long-nt-tran
left a comment
There was a problem hiding this comment.
I think we definitely need a couple Nexus-based query test here as well. Off the top of my head, I think we should at least test:
- Ongoing workflow, well-formed query (happy path)
- Ongoing workflow, malformed query (correct error returned)
- Completed workflow, well-formed query (and under different
QueryRejectConditionstates) - Completed workflow, malformed query (and under different
QueryRejectConditionstates)
When I did linking for signals I put that under tests/nexus_workflow_test.go, but feel free to make a new tests/nexus_query_test.go instead of piling on.
For example, here's how we'd set up such a Nexus-based test -- I'm using a Nexus signal test as a reference:
- Map the handler (on the callee side) to a query (example with signal)
- Map the Nexus op (on the callee side) to a query (example with signal)
- Have a caller workflow invoke the Nexus operation (example with signal)
- In my test I validated that the signal shows up in history, but for query I think you can validate that the query successfully returns, or some validation that indicates the expected success/failure outcome(s)
Agree, had added more cases in the sdk-go PR temporalio/sdk-go#2508 |
203efe9 to
f559856
Compare
f559856 to
84ffca9
Compare
long-nt-tran
left a comment
There was a problem hiding this comment.
Thanks for adding more tests!
| name: "well-formed replayable query succeeds", | ||
| query: &querypb.WorkflowQuery{QueryType: queryName}, | ||
| reason: "Query processed", | ||
| result: "failed", |
There was a problem hiding this comment.
nit: maybe send a different value to the signal handler rather than "failed" :D (i.e., "completed") I was slightly confused at first glance why "failed" meant success here
There was a problem hiding this comment.
Ah sure! just wanted to convey that this is something that the completed workflow handler would return(to not confuse with "state" of workflow etc), maybe "processed" instead? will fix
84ffca9 to
46344cb
Compare
46344cb to
064ae72
Compare
…mporalio#11274) ## What changed? Adds server support for WorkflowQuery-backed Nexus Operations ## Why? Part of effort to expose all Temporal primitives as Nexus Operations ## How did you test it? - [x] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [x] added new functional test(s) ## TODO: - [x] temporalio/api#842
What changed?
Adds server support for WorkflowQuery-backed Nexus Operations
Why?
Part of effort to expose all Temporal primitives as Nexus Operations
How did you test it?
TODO: