Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New flag: workflow show --event-details #555

Merged
merged 1 commit into from
May 10, 2024
Merged

Conversation

dandavison
Copy link
Contributor

Fixes #545. Remove details JSON from workflow show output by default.

Before

cli(main) temporal workflow show -w hello-activity-workflow-id
Progress:
  ID           Time                     Type                   Details
    1  2024-05-09T15:53:37Z  WorkflowExecutionStarted    {"workflowType":{"name":"GreetingWorkflow"}, "taskQueue":{"name":"hello-activity-task-queue", "kind":"TASK_QUEUE_KIND_NORMAL"}, "input":{"payloads":[{"metada
ta":{"encoding":"anNvbi9wbGFpbg=="}, "data":"IldvcmxkIg=="}]}, "workflowTaskTimeout":"10s", "originalExecutionRunId":"b2174d63-f219-43b5-983f-391eac38a439", "identity":"45578@dan-2.local", "firstExecutionRunId":"b2
174d63-f219-43b5-983f-391eac38a439", "attempt":1, "firstWorkflowTaskBackoff":"0s", "workflowId":"hello-activity-workflow-id"}
    2  2024-05-09T15:53:37Z  WorkflowTaskScheduled       {"taskQueue":{"name":"hello-activity-task-queue", "kind":"TASK_QUEUE_KIND_NORMAL"}, "startToCloseTimeout":"10s", "attempt":1}
    3  2024-05-09T15:53:37Z  WorkflowTaskStarted         {"scheduledEventId":"2", "identity":"45578@dan-2.local", "requestId":"d68881c9-3b89-4329-8ef4-06483b65c312", "historySizeBytes":"314"}
    4  2024-05-09T15:53:37Z  WorkflowTaskCompleted       {"scheduledEventId":"2", "startedEventId":"3", "identity":"45578@dan-2.local", "workerVersion":{"buildId":"a8e1284553e035c44548066db56b7dde"}, "sdkMetadata":
{"coreUsedFlags":[2, 1]}, "meteringMetadata":{}}
    5  2024-05-09T15:53:37Z  ActivityTaskScheduled       {"activityId":"1", "activityType":{"name":"compose_greeting"}, "taskQueue":{"name":"hello-activity-task-queue", "kind":"TASK_QUEUE_KIND_NORMAL"}, "header":{}
, "input":{"payloads":[{"metadata":{"encoding":"anNvbi9wbGFpbg=="}, "data":"eyJncmVldGluZyI6IkhlbGxvIiwibmFtZSI6IldvcmxkIn0="}]}, "scheduleToCloseTimeout":"0s", "scheduleToStartTimeout":"0s", "startToCloseTimeout":
"10s", "heartbeatTimeout":"0s", "workflowTaskCompletedEventId":"4", "retryPolicy":{"initialInterval":"1s", "backoffCoefficient":2, "maximumInterval":"100s"}, "useCompatibleVersion":true}
    6  2024-05-09T15:53:37Z  ActivityTaskStarted         {"scheduledEventId":"5", "identity":"45578@dan-2.local", "requestId":"c6505ce4-62d9-402b-a6b8-a5931ac372ce", "attempt":1}
    7  2024-05-09T15:53:37Z  ActivityTaskCompleted       {"result":{"payloads":[{"metadata":{"encoding":"anNvbi9wbGFpbg=="}, "data":"IkhlbGxvLCBXb3JsZCEi"}]}, "scheduledEventId":"5", "startedEventId":"6", "identity
":"45578@dan-2.local"}
    8  2024-05-09T15:53:37Z  WorkflowTaskScheduled       {"taskQueue":{"name":"45578@dan-2.local-134d9c8495a5461e82e9b92f7ed943ce", "kind":"TASK_QUEUE_KIND_STICKY", "normalName":"hello-activity-task-queue"}, "start
ToCloseTimeout":"10s", "attempt":1}
    9  2024-05-09T15:53:37Z  WorkflowTaskStarted         {"scheduledEventId":"8", "identity":"45578@dan-2.local", "requestId":"8044cf60-5145-4fea-90eb-340390f30569", "historySizeBytes":"975"}
   10  2024-05-09T15:53:37Z  WorkflowTaskCompleted       {"scheduledEventId":"8", "startedEventId":"9", "identity":"45578@dan-2.local", "workerVersion":{"buildId":"a8e1284553e035c44548066db56b7dde"}, "sdkMetadata":
{}, "meteringMetadata":{}}
   11  2024-05-09T15:53:37Z  WorkflowExecutionCompleted  {"result":{"payloads":[{"metadata":{"encoding":"anNvbi9wbGFpbg=="}, "data":"IkhlbGxvLCBXb3JsZCEi"}]}, "workflowTaskCompletedEventId":"10"}
Results:
  Status  COMPLETED
  Result  "Hello, World!"

After

cli(545-workflow-show-details) temporal workflow show -w hello-activity-workflow-id
Progress:
  ID           Time                     Type
    1  2024-05-09T15:53:37Z  WorkflowExecutionStarted
    2  2024-05-09T15:53:37Z  WorkflowTaskScheduled
    3  2024-05-09T15:53:37Z  WorkflowTaskStarted
    4  2024-05-09T15:53:37Z  WorkflowTaskCompleted
    5  2024-05-09T15:53:37Z  ActivityTaskScheduled
    6  2024-05-09T15:53:37Z  ActivityTaskStarted
    7  2024-05-09T15:53:37Z  ActivityTaskCompleted
    8  2024-05-09T15:53:37Z  WorkflowTaskScheduled
    9  2024-05-09T15:53:37Z  WorkflowTaskStarted
   10  2024-05-09T15:53:37Z  WorkflowTaskCompleted
   11  2024-05-09T15:53:37Z  WorkflowExecutionCompleted
Results:
  Status  COMPLETED
  Result  "Hello, World!"

during workflow progress. If set when using JSON output, this will include the entire "history" JSON key of the
started run (does not follow runs).
* `--event-details` (bool) - If set when using text output, include event details JSON in printed output.
If set when using JSON output, this will include the entire "history" JSON key of the started run.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was drive-by editing. It seemed to me that the presence of the flag was not related to whether it follows runs.

@dandavison dandavison force-pushed the 545-workflow-show-details branch 2 times, most recently from ecd75a3 to 8c8cf45 Compare May 10, 2024 14:57
@dandavison dandavison merged commit 9471d7d into main May 10, 2024
7 checks passed
@dandavison dandavison deleted the 545-workflow-show-details branch May 10, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Make worfkflow show Details off by default
2 participants