Skip to content

Add workflow metadata command#743

Merged
Sushisource merged 5 commits intomainfrom
metadata-query
Jan 23, 2025
Merged

Add workflow metadata command#743
Sushisource merged 5 commits intomainfrom
metadata-query

Conversation

@Sushisource
Copy link
Member

@Sushisource Sushisource commented Jan 22, 2025

What was changed

  • Added new workflow metadata command to run the built-in metadata query and show results

Not-JSON looks like this:

Metadata:
              WorkflowType       DevWorkflow
              QueryDefinitions   [{"name":"__open_sessions","description":"Open sessions on the workflow"}, {"name":"__stack_trace","description":"Current stack trace"}, {"name":"__temporal_workflow_metadata","description":"Metadata about the workflow"}, {"name":"my-query","description":"q-desc"}]
              SignalDefinitions  [{"name":"my-signal","description":"sig-desc"}]
              UpdateDefinitions  [{"name":"my-update","description":"upd-desc"}]
              CurrentDetails     current-deets

Which is debatable since it's sorta half-JSON. I dunno if we want to recursively headerize this or not

Why?

Useful to run this from the CLI

Checklist

  1. Closes

  2. How was this tested:
    Added tests

  3. Any docs updates needed?

```
option-sets:
- workflow-reference
- query-modifiers
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be ok if we didn't even accept query reject condition, but meh

@dandavison
Copy link
Contributor

I dunno if we want to recursively headerize this or not

I think that would make sense and be what most users would expect. At least, having one line per handler

@Sushisource
Copy link
Member Author

Looks like this now:

         Metadata:
          Query Definitions:
            __open_sessions                 Open sessions on the workflow
            __stack_trace                   Current stack trace          
            __temporal_workflow_metadata    Metadata about the workflow  
            my-query                        q-desc                       
          Signal Definitions:
            my-signal    sig-desc   
          Update Definitions:
            my-update    upd-desc   
          Current Details:
            current-deets

@dandavison
Copy link
Contributor

Looks like this now:

WDYT about the alignment -- would be nice to have the descriptions aligned, or perhaps just don't indent them at all if we're not going to enforce an alignment that works for all rows.

@Sushisource Sushisource merged commit de6f1c7 into main Jan 23, 2025
8 checks passed
@Sushisource Sushisource deleted the metadata-query branch January 23, 2025 17:06
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.

3 participants