Repository navigation
chore: command docs needed for new API operations - #212
github-actions[bot] wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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.
| 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." |
There was a problem hiding this comment.
🔴 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.
The production OpenAPI spec has operations without a curated command doc. Each
file below is a
draft: truestub scaffolded from the spec (arguments,same-group related commands, one schema-generated example). Drafts render no
examples in
--helpor on the Help Center, and the release gate blocks thenext 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 onlywhere the CLI adds behavior, then remove
draft: true. Validate with:New operations:
count-attribute-attribution-setscreate-custom-metriccreate-customer-notificationcreate-customer-subscriptioncreate-user-notificationdelete-custom-metricdelete-customer-notificationdelete-customer-subscriptiondelete-user-notificationget-attribute-attribution-setget-attribute-workload-detailsget-attribute-workloads-cost-data-statusget-attribute-workloads-signalsget-custom-metricget-customer-notificationget-customer-subscriptionget-invoice-pdfget-user-notificationlist-attribute-attribution-set-versionslist-attribute-attribution-setslist-attribute-workload-non-network-resource-typeslist-attribute-workloads-cloud-providerslist-attribute-workloads-filter-valueslist-attribute-workloads-resource-tag-keyslist-attribute-workloads-resource-tag-valueslist-custom-metricslist-customer-notificationslist-customer-subscriptionslist-extended-metricslist-user-notificationsquery-attribute-workload-resources-over-timequery-attribute-workload-resources-statsquery-attribute-workload-resources-tablequery-attribute-workloads-over-timequery-attribute-workloads-statsquery-attribute-workloads-tableupdate-custom-metricupdate-customer-notificationupdate-customer-subscriptionupdate-user-notificationSee COMMAND-DOCS-SPEC.md §3 for the file format.