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

Add workflow query-types command to CLI #5456

Merged
merged 5 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tools/cli/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ func newWorkflowCommands() []cli.Command {
QueryWorkflow(c)
},
},
{
Name: "query-types",
Usage: "list all available query types",
Flags: getFlagsForStack(),
Action: func(c *cli.Context) {
QueryWorkflowUsingQueryTypes(c)
},
},
{
Name: "stack",
Usage: "query workflow execution with __stack_trace as query type",
Expand Down
5 changes: 5 additions & 0 deletions tools/cli/workflowCommands.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,11 @@ func QueryWorkflowUsingStackTrace(c *cli.Context) {
queryWorkflowHelper(c, "__stack_trace")
}

// QueryWorkflowUsingQueryTypes list all query types of the workflow using __query_types as query type
func QueryWorkflowUsingQueryTypes(c *cli.Context) {
queryWorkflowHelper(c, "__query_types")
Copy link
Contributor

Choose a reason for hiding this comment

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

This feature on the client side was not yet released and is not yet supported by java client.
I'm not sure what is the best way to communicate this.

Copy link
Member

Choose a reason for hiding this comment

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

I think that's fine to have CLI doing more than you can do programmatically.

Copy link
Member

Choose a reason for hiding this comment

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

it is, but it's also implying [something] will work.

what's the failure message when this reaches a worker that doesn't support the query? it should probably be something more descriptive than a default one.

}

func queryWorkflowHelper(c *cli.Context, queryType string) {
serviceClient := cFactory.ServerFrontendClient(c)

Expand Down