Skip to content

docs(gmail): correct draft send command tip - #924

Open
ZIFeIYUuuuuuu wants to merge 1 commit into
googleworkspace:mainfrom
ZIFeIYUuuuuuu:fix/914-correct-draft-send-tip
Open

docs(gmail): correct draft send command tip#924
ZIFeIYUuuuuuu wants to merge 1 commit into
googleworkspace:mainfrom
ZIFeIYUuuuuuu:fix/914-correct-draft-send-tip

Conversation

@ZIFeIYUuuuuuu

Copy link
Copy Markdown

Correct the Gmail --draft send command shown to users

Problem

After gws gmail +send --draft (and the other Gmail helpers that share this path) succeeds, the printed tip tells users to run:

gws gmail users.drafts.send --body '{"id":"<draft-id>"}'

That is not valid discovery command syntax: resources and methods are separate positional arguments, and request parameters/body use --params and --json. Copying the tip therefore results in a command that fails before sending the draft.

Changes

  • Centralize the displayed command in draft_send_tip().
  • Print the valid equivalent:
gws gmail users drafts send --params '{"userId":"me"}' --json '{"id":"<draft-id>"}'
  • Add a unit test asserting the exact command string.
  • Add the required patch changeset.

Validation

  • cargo test -p google-workspace-cli helpers::gmail::tests::test_draft_send_tip_uses_valid_discovery_command_syntax -- --exact --nocapture: 1 passed.
  • cargo test -p google-workspace-cli helpers::gmail::tests -- --nocapture: 113 passed.
  • cargo fmt --all -- --check: passed.
  • cargo clippy -p google-workspace-cli -- -D warnings -A clippy::collapsible-match: passed; the allow covers an existing unrelated warning in helpers/script.rs.
  • git diff --check: passed.

This is a user-facing documentation/error-message correction only; the draft creation and send API calls are unchanged. Closes #914.

@changeset-bot

changeset-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 756ad75

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@googleworkspace/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@googleworkspace-bot googleworkspace-bot added the area: core Core CLI parsing, commands, error handling, utilities label Sep 9, 2026
@google-cla

google-cla Bot commented Sep 9, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ZIFeIYUuuuuuu
ZIFeIYUuuuuuu force-pushed the fix/914-correct-draft-send-tip branch from 9780b42 to 756ad75 Compare September 9, 2026 10:22
@googleworkspace-bot

Copy link
Copy Markdown
Collaborator

/gemini review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Core CLI parsing, commands, error handling, utilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(gmail): the --draft tip prints a send command that fails (users.drafts.send --body)

2 participants