Skip to content

chore: command docs needed for new API operations - #212

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
chore/command-docs-drift-20261123
Open

github-actions[bot] wants to merge 1 commit into
mainfrom
chore/command-docs-drift-20261123

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

The production OpenAPI spec has operations without a curated command doc. Each
file below is a draft: true stub scaffolded from the spec (arguments,
same-group related commands, one schema-generated example). Drafts render no
examples in --help or on the Help Center, and the release gate blocks the
next tag until every one is curated
.

To finish a stub: rewrite the example(s) as real usage (2–4, common case
first, quote every command: value), fix the argument text, add notes only
where the CLI adds behavior, then remove draft: true. Validate with:

curl -sSL https://api.doit.com/openapi.yaml -o /tmp/openapi.yaml
DCI_COMMAND_DOCS_SPEC=/tmp/openapi.yaml go test -run TestCommandDocs .

New operations:

  • count-attribute-attribution-sets
  • create-custom-metric
  • create-customer-notification
  • create-customer-subscription
  • create-user-notification
  • delete-custom-metric
  • delete-customer-notification
  • delete-customer-subscription
  • delete-user-notification
  • get-attribute-attribution-set
  • get-attribute-workload-details
  • get-attribute-workloads-cost-data-status
  • get-attribute-workloads-signals
  • get-custom-metric
  • get-customer-notification
  • get-customer-subscription
  • get-invoice-pdf
  • get-user-notification
  • list-attribute-attribution-set-versions
  • list-attribute-attribution-sets
  • list-attribute-workload-non-network-resource-types
  • list-attribute-workloads-cloud-providers
  • list-attribute-workloads-filter-values
  • list-attribute-workloads-resource-tag-keys
  • list-attribute-workloads-resource-tag-values
  • list-custom-metrics
  • list-customer-notifications
  • list-customer-subscriptions
  • list-extended-metrics
  • list-user-notifications
  • query-attribute-workload-resources-over-time
  • query-attribute-workload-resources-stats
  • query-attribute-workload-resources-table
  • query-attribute-workloads-over-time
  • query-attribute-workloads-stats
  • query-attribute-workloads-table
  • update-custom-metric
  • update-customer-notification
  • update-customer-subscription
  • update-user-notification

See COMMAND-DOCS-SPEC.md §3 for the file format.

@github-actions
github-actions Bot requested review from a team, apgiorgi, chaim0m and taltultc as code owners November 23, 2026 06:52

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Besides the inline finding, I checked two more things. The TODO placeholder examples should stay out of --help, because command_docs.go treats a draft: true doc as absent at lines 185-186. Every new example also uses only placeholder IDs (<customer-subscription-id>, <user-id>, and so on) or example.com addresses, so tenant-identifier hygiene holds.

Extended reasoning...

The PR adds 40 scaffolded draft YAML files under command-docs/ and changes no Go code. It touches no auth, injection or data-exposure surface. The draft-rendering check and the tenant-identifier check were both done by reading the code and the new files.

Comment on lines +7 to +19
dimension: "What one row (or one series) stands for:

- `workload`: one Kubernetes workload on one cluster. Only these rows carry `workloadId`,
the input of the `/attribute/v1/workloads/w/*` operations.
- `workloadName`: all workloads with the same name, across clusters.
- `workloadType`: one workload type.
- `namespace`: one Kubernetes namespace.
- `platform`: one cluster (name, type, region, account and cloud).
- `accountId`: one cloud account that hosts clusters.
- `resource`: one billed cloud resource used by workloads.
- `resourceType`: one billed service.
- `costDescription`: one billing SKU description.
- `platformCloudProvider`: one cloud that clusters run on."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Seven scaffolded argument notes are invalid YAML for Prettier. Omni's Prettier lint can fail on them after the release sync, and the markdown list collapses into one bullet. These are double-quoted strings whose continuation lines start at column 0. Fix: write every multi-line argument as an indented block scalar (|), or indent its continuation lines, then run Prettier. Same pattern at 7 sites (query-attribute-workloads-over-time.yaml:7, query-attribute-workloads-stats.yaml:7, query-attribute-workloads-table.yaml:7, list-attribute-workloads-filter-values.yaml:7, get-customer-notification.yaml:7, delete-customer-notification.yaml:7, update-customer-notification.yaml:7). [also at: command-docs/query-attribute-workloads-over-time.yaml:20 - Help readers get the dimension list merged into one run-on line, and Prettier linting in omni's CI may reject seven of these files.; command-docs/query-attribute-workloads-stats.yaml:19 - Seven drafts have multi-line quoted argument notes whose continuation lines start at column 0, so the repo's prettier CI step can fail and markdown lists get folded.]

Why this was flagged

tools/commanddocs/main.go:236 passes the spec description through yamlQuote (main.go:306-311). That function escapes only quotes and backslashes, so raw newlines land in the files with no indentation. In query-attribute-workloads-over-time.yaml:7-19 the dimension: value continues at column 0. The YAML 1.2 spec requires these continuation lines to be indented deeper than the dimension key. Prettier's YAML parser rejects under-indented multi-line double-quoted strings with "Multi-line double-quoted string needs to be sufficiently indented". So prettier --check in omni's CI, which AGENTS.md says lints these files after the release sync, would fail or rewrite them. Even where a lenient parser accepts the text, each single newline folds to a space. The dimension markdown list then becomes one bullet that holds every dimension. No existing command-docs file has column-0 continuation lines, so the base branch never had this problem.

Verification: tools/commanddocs/main.go:236 writes " " + parameter.OptionName() + ": " + yamlQuote(description). yamlQuote (main.go:306-311) only wraps the text in quotes and escapes \ and ". It does not re-indent embedded newlines, so a multi-line spec description comes out with its continuation lines at column 0. Seven new files have this.

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.

0 participants