Skip to content

Commit ec36926

Browse files
authored
SAA drop type and task queue (#959)
## What was changed Drop execution type and task queue from start standalone activity output ## Why? They are not currently guaranteed correct in the `conflictPolicy=UseExisting` case ## Testing ``` $ temporal activity start --start-to-close-timeout 1s --task-queue hello-standalone-activity-task-queue --type compose_greeting --activity-id act-1 --input '{"greeting": "mygreeting", "name": "myname"}' Running execution: ActivityId act-1 RunId 019cd407-83cc-7c8e-ba17-5a3125e4e7cd Namespace default $ temporal activity result -a act-1 Results: Status COMPLETED Result "mygreeting, myname!" $ temporal activity start --start-to-close-timeout 1s --task-queue hello-standalone-activity-task-queue --type compose_greeting --activity-id act-2 -o json --input '{"greeting": "mygreeting", "name": "myname"}' { "activityId": "act-2", "runId": "019cd408-38a3-7e15-8b36-58f966f156de", "namespace": "default" } ```
1 parent 1e42cea commit ec36926

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

internal/temporalcli/commands.activity.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (c *TemporalActivityStartCommand) run(cctx *CommandContext, args []string)
5151
if err != nil {
5252
return err
5353
}
54-
return printActivityExecution(cctx, c.ActivityId, handle.GetRunID(), c.Type, c.Parent.Namespace, c.TaskQueue)
54+
return printActivityExecution(cctx, c.ActivityId, handle.GetRunID(), c.Parent.Namespace)
5555
}
5656

5757
func (c *TemporalActivityExecuteCommand) run(cctx *CommandContext, args []string) error {
@@ -66,7 +66,7 @@ func (c *TemporalActivityExecuteCommand) run(cctx *CommandContext, args []string
6666
return err
6767
}
6868
if !cctx.JSONOutput {
69-
if err := printActivityExecution(cctx, c.ActivityId, handle.GetRunID(), c.Type, c.Parent.Namespace, c.TaskQueue); err != nil {
69+
if err := printActivityExecution(cctx, c.ActivityId, handle.GetRunID(), c.Parent.Namespace); err != nil {
7070
cctx.Logger.Error("Failed printing execution info", "error", err)
7171
}
7272
}
@@ -108,22 +108,18 @@ func startActivity(
108108
return handle, nil
109109
}
110110

111-
func printActivityExecution(cctx *CommandContext, activityID, runID, activityType, namespace, taskQueue string) error {
111+
func printActivityExecution(cctx *CommandContext, activityID, runID, namespace string) error {
112112
if !cctx.JSONOutput {
113113
cctx.Printer.Println(color.MagentaString("Running execution:"))
114114
}
115115
return cctx.Printer.PrintStructured(struct {
116116
ActivityId string `json:"activityId"`
117117
RunId string `json:"runId"`
118-
Type string `json:"type"`
119118
Namespace string `json:"namespace"`
120-
TaskQueue string `json:"taskQueue"`
121119
}{
122120
ActivityId: activityID,
123121
RunId: runID,
124-
Type: activityType,
125122
Namespace: namespace,
126-
TaskQueue: taskQueue,
127123
}, printer.StructuredOptions{})
128124
}
129125

internal/temporalcli/commands.activity_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,7 @@ func (s *SharedServerSuite) TestActivity_Start() {
542542
s.Contains(out, "Running execution:")
543543
s.ContainsOnSameLine(out, "ActivityId", "start-test")
544544
s.Contains(out, "RunId")
545-
s.ContainsOnSameLine(out, "Type", "DevActivity")
546545
s.ContainsOnSameLine(out, "Namespace", "default")
547-
s.ContainsOnSameLine(out, "TaskQueue", s.Worker().Options.TaskQueue)
548546

549547
// JSON
550548
res = s.Execute(
@@ -561,9 +559,7 @@ func (s *SharedServerSuite) TestActivity_Start() {
561559
s.NoError(json.Unmarshal(res.Stdout.Bytes(), &jsonOut))
562560
s.Equal("start-test-json", jsonOut["activityId"])
563561
s.NotEmpty(jsonOut["runId"])
564-
s.Equal("DevActivity", jsonOut["type"])
565562
s.Equal("default", jsonOut["namespace"])
566-
s.NotEmpty(jsonOut["taskQueue"])
567563
}
568564

569565
func (s *SharedServerSuite) TestActivity_Start_With_Headers() {

0 commit comments

Comments
 (0)