Add support for Standalone Nexus Operations#1046
Conversation
Evanthx
left a comment
There was a problem hiding this comment.
Found a few nit-picks! Your call on whether they are worth addressing, they are all quite minor.
| if err := printNexusOperationFailure(cctx, operationID, runID, v.Failure); err != nil { | ||
| cctx.Logger.Error("Nexus operation failed, and printing the output also failed", "error", err) | ||
| } | ||
| return fmt.Errorf("nexus operation failed") |
There was a problem hiding this comment.
Should Nexus be capitalized? Same for line 112 above and 131, 492 below. Didn't do a complete check for places, but looking at the code for "fmt.Errorf.*nexus" I see it both ways!
There was a problem hiding this comment.
in errors it should be lower case based on convention, same as workflow and logs it may be uppercase
| // Matches the SDK's pollActivityTimeout in internal_activity_client.go. | ||
| const pollNexusOperationTimeout = 60 * time.Second | ||
|
|
||
| // pollNexusOperationOutcome polls for a nexus operation result using a |
There was a problem hiding this comment.
Feel free to ignore this comment - would this be better as a method on Handle then, both for reuse and so that if someone made a change to Handle.Get later this method would be visible there to get the equivalent change? ie, maybe Handle would then have a Get and a RawGet method, something like that?
| } | ||
| resultJSON, err := json.Marshal(valuePtr) | ||
| if err != nil { | ||
| return fmt.Errorf("failed marshaling result: %w", err) |
There was a problem hiding this comment.
Line 202 and 210 return the exact same string as 177 and 184. So if we get that error, we won't actually know which line failed, just that it's one of those two. Given that they are doing the same thing to the same object it might not matter much, but it's nice to just go to the offending log line without having to wonder which line it was.
VegetarianOrc
left a comment
There was a problem hiding this comment.
A few minor nits, but looks good to me!
849b8da to
9a27d93
Compare
chaptersix
left a comment
There was a problem hiding this comment.
I don't want to block you based on these but makes corrections if needed.
| temporal nexus operation start \ | ||
| --endpoint YourEndpoint \ | ||
| --service YourService \ | ||
| --operation YourOperation \ | ||
| --operation-id YourOperationId \ | ||
| --input '{"some-key": "some-value"}' |
There was a problem hiding this comment.
from the cli, how does a user discover the proper service endpoint and operation?
There was a problem hiding this comment.
The user has to know that, same as to start an activity the user has to know the task queue and activity type
| "activity.enableStandalone": true, | ||
| "activity.longPollTimeout": 2 * time.Second, | ||
| "nexusoperation.enableStandalone": true, | ||
| "history.enableChasmCallbacks": true, |
There was a problem hiding this comment.
I we should somehow track when we can disable these overrides. some of these could be removed.
|
Also, could you note the min server version required for these commands? (Just to make sure we don't release these changes before the next OSS release) |
a61e597 to
9b5b016
Compare
…#1104) ## Summary Backports server-independent changes from `main` into `release/1.8.x`. Every commit here was verified to build and pass codegen against the release line's current dependency pins (`server v1.31.0`, `sdk v1.41.1`, `api v1.62.8`) — nothing pulls in the newer server/SDK/API that landed on `main` via #1017. Scope agreed as: bug fixes + CLI changes + CI/tooling. Dependency bumps (#1040, #1052, #1063) and server-version-dependent features are intentionally excluded. ## Included (22 commits, cherry-picked with `-x`) **CLI / bug fixes** - #1006 Fix help with value flags (addresses #1003 — `--help` with value flags like `--address 123` surfaced `pflag: help requested` as an error) - #1012 skip CountWorkflow in batch operations when `--yes` is set - #1016 Sort output of listing search attributes - #1029 Workflow delete now prompts for confirmation - #1033 Add persistence info to start-dev banner - #1047 Add `temporal schedule list-matching-times` command - #1056 Fix task-queue config set help: use real fairness weight flag names - #1059 Prefix dev server cluster ID with `dev-server-` - #1089 fix: tls is not added for profiles without tls - #1099 Clarify activity pause timeout behavior - #941 auto-generate deprecation warnings from YAML config **Tests** - #1005 Fix flakey test by disabling EC2 metadata lookup - #1020 Remove `time.Sleep()` in commands.taskqueue_test.go **CI / tooling** - #1015 pin alpine docker image to 3.23.4 - #1024 remediate missing-dependency-cooldown - #1034 Bump actions/upload-artifact from 4 to 7 - #1044 improve dependabot config - #1045 add PR template - #1054 pin and bump GitHub Actions to latest versions - #1057 use allow instead of ignore for dependency-type in dependabot config - #1080 Bump the github-actions group with 2 updates ## Excluded (rely on the new server/SDK version) #1017 (server bump v1.31.0 -> v1.32.0-157.0), #1046, #1087, #1001, #1091, #1084 ## Verification - `go build ./...` passes - all test packages compile - `make gen` reports no codegen drift - server/sdk/api pins unchanged from `release/1.8.x` ## CI endpoint fix (added) Also backports the API-key CI test endpoint change from #1087 (`us-east-1` -> `ca-central-1`) as a standalone CI-only commit. This resolves the `Request unauthorized` failure in the "Test cloud API key" steps on `release/1.8.x`. The rest of #1087 (Nexus Operation command code) is excluded as it depends on the new server version. --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Sai Asish Y <say.apm35@gmail.com> Co-authored-by: Kevin Woo <3469532+kevinawoo@users.noreply.github.com> Co-authored-by: Rodrigo Zhou <rodrigo.zhou@temporal.io> Co-authored-by: Stephan Behnke <stephanos@users.noreply.github.com> Co-authored-by: Jiechen Zhong <jiechen.zhong@temporal.io> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Kent Gruber <kent.gruber@temporal.io> Co-authored-by: picatz <14850816+picatz@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: John Votta <jpvotta@gmail.com> Co-authored-by: Nasit Sarwar Sony <nasitsony96@gmail.com> Co-authored-by: hussam-salah <156124396+hussam-salah@users.noreply.github.com> Co-authored-by: Sai Asish Y <say.apm35@gmail.com> Co-authored-by: Bitalizer <23104115+bitalizer@users.noreply.github.com> Co-authored-by: Sean Kane <spkane31@gmail.com> Co-authored-by: Jessica Laughlin <JLDLaughlin@users.noreply.github.com>
NOTE: REQUIRES OSS SERVER VERSION v1.32.0
What changed?
Add support for stand alone nexus operations to the CLI.
Checklist
Stability
-o json/-o jsonl) are treated as breaking changesDesign
temporal <noun> <verb>structure (e.g.temporal workflow start)--search-attribute, bad:--index-field)(Experimental)incommands.yamlHelp text (see style guide at the top of
commands.yaml)--namespace, not-n), one flag per lineYourXxxform (YourWorkflowId,YourNamespace)Behavior
Tests
SharedServerSuite)func TestXxx) where applicableManual tests
Setup
Happy path
Error case
Composition — start an operation, then fetch its result, then list/describe: