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

DO NOT MERGE: Draft work on improving help messaging #561

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

fairlydurable
Copy link
Contributor

EDU-2415: Docs team assist for temporal CLI help text

josh-berry and others added 3 commits May 6, 2024 17:52
Also:
* Adds language for `temporal`, `temporal activity`, `temporal activity
  complete` and `temporal activity fail`.

NOTES

* I'm a little confused by the inconsistency of punctuation.
* How wordy do you want the command-line usage to be? There's already an
  overwhelming amount of "wall of text".

I was thinking more:

```
* `--env` (string) - Active environment name. Default: default. Env: TEMPORAL_ENV.
* `--env-file` (string) - Path to environment settings file (defaults to `$HOME/.config/temporalio/temporal.yaml`).
* `--log-level` (string-enum) - Log level. Default is "info" for most commands and "warn" for `server start-dev`.
  Options: debug, info, warn, error, never. Default: info.
* `--log-format` (string) - Log format. Options are "text" and "json". Default is "text".
* `--output`, `-o` (string-enum) - Non-logging data output format. Options: text, json, jsonl,
  none. Default: text.
* `--time-format` (string-enum) - Time format. Options: relative, iso, raw. Default: relative.
* `--color` (string-enum) - Output coloring. Options: always, never, auto. Default: auto.
* `--no-json-shorthand-payloads` (bool) - Show all payloads as raw, even if they are JSON. Default: false.
```

over

```
* `--env` (string) - Read additional options from the `ENV` environment. (See "temporal env --help" for more about environments.) Default: default. Env: TEMPORAL_ENV.
* `--env-file` (string) - Read/store per-environment configuration in `PATH` (defaults to "$HOME/.config/temporalio/temporal.yaml").
* `--log-level` (string-enum) - Log level. Default is "info" for most commands and "warn" for the development server.
  Options: debug, info, warn, error, never. Default: info.
* `--log-format` (string) - Emit log messages in "text" or "json" format. Default is "text".
* `--output`, `-o` (string-enum) - Emit output in the `FMT` format. Does not affect logs; use --log-format instead. Options: text, json, jsonl,
  none. Default: text.
* `--time-format` (string-enum) - Emit timestamps in the `FMT` format. Options: relative, iso, raw. Default: relative.
* `--color` (string-enum) - Colorize output. Does not affect logs. Options: always, never, auto. Default: auto.
* `--no-json-shorthand-payloads` (bool) - Show all payloads as raw payloads even if they are JSON.
```

ISSUES

1. There's no way to bundle the `temporal` options, which are
   imported elsewhere. They have to be there and they are
   distracting, and contribute to overwhelmed users.

2. Even though I set a description for complete and fail, they are not shown

   cli% ./temporal activity complete
   Error: required flag(s) "activity-id", "result", "workflow-id" not set
   Usage:
     temporal activity complete [flags]

   Ditto for temporal activity fail.
Proof of concept material is pretty much there before I move forward.
@fairlydurable fairlydurable marked this pull request as draft May 14, 2024 21:10
Copy link
Collaborator

@josh-berry josh-berry left a comment

Choose a reason for hiding this comment

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

Thanks! I left a bunch of comments but I think it's all pretty minor.

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
temporalcli/commandsmd/commands.md Outdated Show resolved Hide resolved
temporalcli/commandsmd/commands.md Outdated Show resolved Hide resolved
temporalcli/commandsmd/commands.md Outdated Show resolved Hide resolved
temporalcli/commandsmd/commands.md Outdated Show resolved Hide resolved
temporalcli/commandsmd/commands.md Outdated Show resolved Hide resolved
temporalcli/commandsmd/commands.md Outdated Show resolved Hide resolved
temporalcli/commandsmd/commands.md Outdated Show resolved Hide resolved
temporalcli/commandsmd/commands.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@josh-berry josh-berry left a comment

Choose a reason for hiding this comment

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

Reviewed all the stuff in the giant preamble comment at the beginning. Will continue with my review but wanted to give you this to start with.


* All URLs are borked due to Info Arch re-org (fixed for now)
* What changes have been introduced asynchronously. I've seen stuff on Slack.
* What's the best way to do async conversations other than PRs?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Slack or email works too.

NOTES FOR ERICA

* All URLs are borked due to Info Arch re-org (fixed for now)
* What changes have been introduced asynchronously. I've seen stuff on Slack.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since you last rebased, here's what I can see:

diff --git a/temporalcli/commandsmd/commands.md b/temporalcli/commandsmd/commands.md
index 175feef..a4a0224 100644
--- a/temporalcli/commandsmd/commands.md
+++ b/temporalcli/commandsmd/commands.md
@@ -201,6 +201,10 @@ If the environment is not specified, the `default` environment is used.

 List all environments.

+<!--
+* ignores-missing-env
+-->
+
 ### temporal env set: Set environment properties.

 `temporal env set --env environment -k property -v value`
@@ -214,6 +218,7 @@ If the environment is not specified, the `default` environment is used.

 <!--
 * maximum-args=2
+* ignores-missing-env
 -->

 #### Options
@@ -815,9 +820,8 @@ temporal workflow execute

 #### Options

-* `--event-details` (bool) - If set when using text output, this will print the event details instead of just the event
-  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 (does not follow runs).

 Includes options set for [shared workflow start](#options-set-for-shared-workflow-start).
 Includes options set for [workflow start](#options-set-for-workflow-start).
@@ -926,6 +930,7 @@ Use the options listed below to change the command's behavior.

 * `--follow`, `-f` (bool) - Follow the progress of a Workflow Execution in real time (does not apply
   to JSON output).
+* `--event-details` (bool) - If set when using text output, include event details JSON in printed output.

 Includes options set for [workflow reference](#options-set-for-workflow-reference).

You can see this yourself using:

git fetch origin
git diff ...origin/main -- temporalcli/commandsmd/commands.md

or something like that because mind blown.

* Word wrapping to 80 chars
* What about options? they tend to run long
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, options can also be wrapped.


* Word wrapping to 80 chars
* What about options? they tend to run long
* Could the text go to a second line after the spaced-dash?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes

* Word wrapping to 80 chars
* What about options? they tend to run long
* Could the text go to a second line after the spaced-dash?
* Could long descriptions be autowrapped outside code examples? -- NEW Q
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes; we should probably track that as a separate issue though (outside this PR).

[Signal](/workflows#signal)
[Update](/workflows#update)

* -h, -o, -v are wonky:
Copy link
Collaborator

Choose a reason for hiding this comment

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

The alignment is intentional, I think, if that's what you're referring to—short options are usually shown before long options in the CLI tool we use (and in most others I'm aware of, since most people prefer short options—less typing).

* `--ui-port` (int) -


----
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can start a separate (internal) Notion page with all of the above, I think; some/many of these are breaking changes, so we need to decide if it's worth breaking people's scripts and such for this. But we should definitely capture all of this in one place (along with what you had in your Google doc). LMK if you want me to start a page somewhere.

example.
Use square brackets to highlight its optional nature if the long
description would suffer from two very similar command invocations.
* Use YourEnvironment, YourNamespace, etc as metasyntactic stand-ins.
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should probably be consistent with the META-VARIABLES in the flags.

Copy link
Collaborator

@josh-berry josh-berry left a comment

Choose a reason for hiding this comment

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

Made it as far as temporal operator, will continue next week.


Includes options set for [workflow reference](#options-set-for-workflow-reference).

### temporal batch: Manage batch jobs

Copy link
Collaborator

Choose a reason for hiding this comment

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

Extra newline


#### Options

* `--limit` (int) - Limit the number of items to print.
* `--limit` (int) -
Max output count.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems a little obtuse—"count" of what?

Comment on lines +532 to +533
Terminate a batch job with the provided job ID. Provide a reason for the
termination. This explanation is stored with the Service for later reference.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Terminate a batch job with the provided job ID. Provide a reason for the
termination. This explanation is stored with the Service for later reference.
Terminate a batch job with the provided job ID. You must provide a reason for the
termination. This explanation is stored with the Service for later reference.

Comment on lines +553 to +555
Environments manage key-value presets, auto-configuring Temporal CLI options
for you. Set up distinct environments like "dev" and "prod" for convenience.
For example:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Environments manage key-value presets, auto-configuring Temporal CLI options
for you. Set up distinct environments like "dev" and "prod" for convenience.
For example:
Environments manage key-value presets, auto-configuring Temporal CLI options
for you. You can set up distinct environments like "dev" and "prod" for convenience.
For example:

or

```
temporal env delete --env prod --key tls-key-path
Copy link
Collaborator

Choose a reason for hiding this comment

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

extra space before --key

```

If the environment is not specified, the `default` environment is used.
If you don't specify an environment name, with `--env` or by setting
`TEMPORAL_ENV` as an environmental variable in your shell, this command
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
`TEMPORAL_ENV` as an environmental variable in your shell, this command
`TEMPORAL_ENV` as an environment variable in your shell, this command

Comment on lines +627 to +629
List the environments you have set up on your local computer. The output
enumerates the environments stored in the Temporal environment file on
your computer ("$HOME/.config/temporalio/temporal.yaml").
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
List the environments you have set up on your local computer. The output
enumerates the environments stored in the Temporal environment file on
your computer ("$HOME/.config/temporalio/temporal.yaml").
List the environments you have set up on your local computer.
Environments are stored in "$HOME/.config/temporalio/temporal.yaml".

(Sorry I'm not getting the wrapping exactly right on these suggestions; hard to do in GitHub's UI)

`temporal env set --env prod -k address -v 127.0.0.1:7233`
`temporal env set --env prod -k tls-cert-path -v /home/my-user/certs/cluster.cert`
If you don't specify an environment name, with `--env` or by setting
`TEMPORAL_ENV` as an environmental variable in your shell, this command
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
`TEMPORAL_ENV` as an environmental variable in your shell, this command
`TEMPORAL_ENV` as an environment variable in your shell, this command

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.

None yet

2 participants