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

docs: improve doc strings text #436

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

crowecawcaw
Copy link
Contributor

What was the problem/requirement? (What/Why)

The client includes help text for its commands, and some of the help text could be improved.

What was the solution? (How)

Update help text as needed.

Fixes #324
Fixes #365

What is the impact of this change?

Someone can more easily understand how to use the client.

How was this change tested?

  • Have you run hatch run test ?
    Yes

  • Have you run hatch run integ:test ? See DEVELOPMENT.md on "Run integration tests"
    No

Was this change documented?

Yes

Is this a breaking change?

No

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

src/deadline/client/cli/_groups/bundle_group.py Outdated Show resolved Hide resolved
src/deadline/client/cli/_groups/bundle_group.py Outdated Show resolved Hide resolved
src/deadline/client/cli/_groups/bundle_group.py Outdated Show resolved Hide resolved
Comment on lines 17 to 18
Manage AWS Deadline Cloud's workstation configuration. Config options are organized
and documented in config_file.SETTINGS.
Copy link
Contributor

Choose a reason for hiding this comment

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

What steps does a user take to then figure this information from the help text? Do they have to go code spelunking? I wonder if we can avoid that. Example:

(deadline) bash-3.2$ deadline config
Usage: deadline config [OPTIONS] COMMAND [ARGS]...

  Manage AWS Deadline Cloud's workstation configuration. Config options are
  organized and documented in config_file.SETTINGS.

Options:
  -h, --help  Show this message and exit.

Commands:
  get   Gets an AWS Deadline Cloud workstation configuration setting.
  gui   Open the workstation configuration settings GUI.
  set   Sets an AWS Deadline Cloud workstation configuration setting.
  show  Show AWS Deadline Cloud's current workstation configuration.

If we do change this, the get and set command will also have to change:

(deadline) bash-3.2$ deadline config set --help
Usage: deadline config set [OPTIONS] SETTING_NAME VALUE

  Sets an AWS Deadline Cloud workstation configuration setting.

  For example `deadline config set defaults.farm_id <farm-id>`. Run `deadline
  config --help` to show available settings.

Options:
  -h, --help  Show this message and exit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrapping the documentation into deadline config show.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Excerpt of sample output:

 > deadline config show

AWS Deadline Cloud configuration file:
   /Users/crowest/.deadline/config

deadline-cloud-monitor.path: ...
   The filesystem path to Deadline Cloud monitor, set during login process.

defaults.aws_profile_name: ...
   The AWS profile name to use by default. Set to '' to use the default
   credentials. Other settings are saved with the profile.

settings.job_history_dir: ~/.deadline/job_history/ ... (default)
   The directory in which to place the job submission history for this AWS
   profile name.

defaults.farm_id: farm-281174...
   The Farm ID to use by default.

settings.storage_profile_id:  (default)
   The storage profile that this workstation conforms to. It specifies where
   shared file systems are mounted, and where named job attachments should go.

defaults.queue_id: queue-38906...
   The Queue ID to use by default.

src/deadline/client/cli/_groups/job_group.py Outdated Show resolved Hide resolved
"[1] SKIP: Do not download these files\n"
"[2] OVERWRITE: Download these files and overwrite existing files\n"
"[3] CREATE_COPY: Download the file with a new name, appending '(1)' to the end",
help="The resolution method to use when a file already exists:\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

starting with resolution feels odd to me, but I guess that's what the option is named. "How to handle existing files" might be a shorter way to put it. I think it's probably fine though. Just musing out loud.

src/deadline/client/config/config_file.py Outdated Show resolved Hide resolved
@epmog
Copy link
Contributor

epmog commented Aug 28, 2024

Change looks good, just a few suggestions. 2 additional things that don't get captured in the diff:

  1. Would help if we included the updated help text in the PR as a user would experience it. Though I checked it out locally to view the differences
  2. Some additional changes we may want would be to add short help's to some of the commands to prevent some truncation. Ref: https://click.palletsprojects.com/en/8.1.x/documentation/#command-short-help

for example:

deadline isn't truncated but there's also a lot of self-referential AWS Deadline Cloud. Maybe we can shrink those down, since the user is already using the deadline cloud client cli.

$ deadline
Usage: deadline [OPTIONS] COMMAND [ARGS]...

  The AWS Deadline Cloud CLI provides functionality to interact with the AWS
  Deadline Cloud service.

Options:
  --version                       Show the version and exit.
  --log-level [ERROR|WARNING|INFO|DEBUG]
                                  Set the logging level.
  -h, --help                      Show this message and exit.

Commands:
  auth            Commands to handle AWS Deadline Cloud authentication.
  bundle          Commands to work with Open Job Description job bundles.
  config          Manage AWS Deadline Cloud's workstation configuration.
  farm            Commands to work with AWS Deadline Cloud Farm resources.
  fleet           Commands to work with AWS Deadline Cloud Fleet resources.
  handle-web-url  Runs AWS Deadline Cloud commands sent from a web browser.
  job             Commands to work with AWS Deadline Cloud Jobs.
  queue           Commands for AWS Deadline Cloud Queues.
  worker          Commands to work with AWS Deadline Cloud Workers.

but deadline bundle has cut-off help text:

$ deadline bundle
Usage: deadline bundle [OPTIONS] COMMAND [ARGS]...

  Commands to work with Open Job Description job bundles.

Options:
  -h, --help  Show this message and exit.

Commands:
  gui-submit  Opens GUI to submit an Open Job Description job bundle to...
  submit      Submits an Open Job Description job bundle to AWS Deadline...

same with other ones like deadline job

$ deadline job
Usage: deadline job [OPTIONS] COMMAND [ARGS]...

  Commands to work with AWS Deadline Cloud Jobs.

Options:
  -h, --help  Show this message and exit.

Commands:
  cancel           Cancel an AWS Deadline Cloud Job from running.
  download-output  Download the output attached to an AWS Deadline Cloud...
  get              Get the details of an AWS Deadline Cloud Job.
  list             Lists the Jobs in an AWS Deadline Cloud Queue.
  trace-schedule   EXPERIMENTAL - Print statistics about how a job, and...

Might make sense to include that here in this change?

Signed-off-by: Stephen Crowe <[email protected]>
@crowecawcaw crowecawcaw changed the title Improve doc strings text docs: improve doc strings text Aug 29, 2024
Copy link

sonarcloud bot commented Aug 29, 2024

@crowecawcaw
Copy link
Contributor Author

Sample output from deadline:

> deadline
Usage: deadline [OPTIONS] COMMAND [ARGS]...

  The AWS Deadline Cloud CLI provides functionality to interact with the AWS
  Deadline Cloud service.

Options:
  --version                       Show the version and exit.
  --log-level [ERROR|WARNING|INFO|DEBUG]
                                  Set the logging level.
  -h, --help                      Show this message and exit.

Commands:
  auth            Commands to handle authentication.
  bundle          Commands to work with Open Job Description job bundles.
  config          Manage Deadline's workstation configuration.
  farm            Commands to work with farms.
  fleet           Commands to work with fleets.
  handle-web-url  Runs AWS Deadline Cloud commands sent from a web browser.
  job             Commands to work with jobs.
  queue           Commands for queues.
  worker          Commands to work with workers.

Copy link
Contributor

@epmog epmog left a comment

Choose a reason for hiding this comment

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

LGTM. Ship it!

@crowecawcaw crowecawcaw merged commit 343bf7b into aws-deadline:mainline Aug 30, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants