Commit 67af3a2
authored
Add support for Standalone Nexus Operations (#1046)
## NOTE: REQUIRES OSS SERVER VERSION v1.32.0
## What changed?
Add support for stand alone nexus operations to the CLI.
## Checklist
<!-- Your PR should satisfy all these requirements. However, feel free
to remove items that don't apply to the PR. Consider giving this
checklist to an AI agent before opening your PR. -->
**Stability**
- [ ] Breaking changes are marked with 💥 in the PR title and release
notes
- [ ] Changes to JSON output (`-o json` / `-o jsonl`) are treated as
breaking changes
**Design**
- [x] This feature does not depend on Cloud-only APIs or behavior (it
works against an OSS server)
- [x] New commands follow `temporal <noun> <verb>` structure (e.g.
`temporal workflow start`)
- [x] New flags are named after the API concept, not the implementation
mechanism (good: `--search-attribute`, bad: `--index-field`)
- [x] New flags don't duplicate an existing flag that serves the same
purpose
- [ ] New flags do not have short aliases without strong justification
- [x] Experimental features are marked with `(Experimental)` in
`commands.yaml`
**Help text** (see style guide at the top of `commands.yaml`)
- [x] All flags shown in help text and examples are implemented and
functional
- [x] Summaries use sentence case and have no trailing period
- [x] Long descriptions end with a period and include at least one
example invocation
- [ ] Examples use long flags (`--namespace`, not `-n`), one flag per
line
- [x] Placeholder values use `YourXxx` form (`YourWorkflowId`,
`YourNamespace`)
**Behavior**
- [x] Results go to stdout; errors and warnings go to stderr
- [x] Error messages are lowercase with no trailing punctuation
**Tests**
- [x] Added functional test(s) (`SharedServerSuite`)
- [x] Added unit test(s) (`func TestXxx`) where applicable
## Manual tests
<!-- Edit the code samples below to provide setup and happy-path and
error-path testing instructions. -->
**Setup**
```
temporal operator nexus endpoint create
--name my-endpoint
--target-namespace default
--target-task-queue my-tq
```
**Happy path**
```
$ temporal nexus operation start
--endpoint my-endpoint
--service my-service
--operation my-op
--operation-id my-op-1
--input '"hello"'
Started Nexus Operation:
Endpoint my-endpoint
Service my-service
Operation my-op
OperationId my-op-1
RunId 7e7c8b2a-...-...
Namespace default
```
**Error case**
```
$ temporal nexus operation start
--service my-service
--operation my-op
--operation-id my-op-2
Error: required flag(s) "endpoint" not set
```
**Composition** — start an operation, then fetch its result, then list/describe:
```
$ temporal nexus operation start
--endpoint my-endpoint
--service my-service
--operation my-op
--operation-id my-op-3
--input '"world"'
$ temporal nexus operation result --operation-id my-op-3
Results:
Status COMPLETED
Result "got: world"
$ temporal nexus operation describe --operation-id my-op-3
OperationId my-op-3
RunId 7e7c8b2a-...-...
Endpoint my-endpoint
Service my-service
Operation my-op
Status Succeeded
...
```1 parent e20ca61 commit 67af3a2
7 files changed
Lines changed: 1811 additions & 3 deletions
File tree
- internal/temporalcli
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
476 | | - | |
477 | | - | |
| 476 | + | |
| 477 | + | |
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
| |||
Large diffs are not rendered by default.
0 commit comments