Remove > CLI prompts from runnable code blocks in InfluxQL/Flux/MongoDB docs#6948
Conversation
Remove leading `>` CLI prompt characters from code blocks that are meant to be executed by users. Only keep `>` in code blocks that demonstrate console output (showing both the command at the prompt AND the result output). Changes affect 34 files across InfluxDB v1, Enterprise InfluxDB, shared influxql-v3 reference, and Telegraf content: - InfluxQL queries and management commands (sql/bash/no-lang blocks) - Flux REPL examples (js blocks) - MongoDB shell commands (shell blocks) Preserved (unchanged): - Console session blocks showing command + output (Type B: mixed > and non-> lines) - Telegraf metric output blocks (text language with > measurement,tags format) - diff blocks with < and > diff markers Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com>
> CLI prompts from runnable code blocks in InfluxQL/Flux/MongoDB docs
There was a problem hiding this comment.
Pull request overview
This PR improves documentation usability by removing > CLI prompt prefixes from code blocks that contain only runnable commands (no output), while keeping prompts in interactive session examples across InfluxQL, Flux REPL, and MongoDB-related docs.
Changes:
- Stripped
>prompt prefixes from command-only code blocks to make examples copy/paste runnable. - Preserved prompt prefixes in mixed command+output blocks to retain “session transcript” readability.
- Applied the update consistently across InfluxDB OSS v1, Enterprise v1, shared InfluxQL references, and Telegraf docs.
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| content/telegraf/v1/input-plugins/mongodb/_index.md | Removes > prompt from MongoDB shell command example. |
| content/shared/influxql-v3-reference/_index.md | Makes EXPLAIN ANALYZE example copyable by removing prompt. |
| content/shared/influxdb-v2/reference/syntax/influxql/spec.md | Removes prompt from EXPLAIN ANALYZE example. |
| content/shared/influxdb-v2/query-data/influxql/manage-data.md | Removes prompts from USE/INSERT command-only snippet. |
| content/shared/influxdb-v2/query-data/influxql/explore-data/time-and-timezone.md | Removes prompt from INSERT example. |
| content/influxdb/v2/install/upgrade/v1-to-v2/automatic-upgrade.md | Removes prompts from command-only InfluxQL statements in upgrade doc. |
| content/influxdb/v1/write_protocols/line_protocol_tutorial.md | Removes prompts from command-only INSERT examples. |
| content/influxdb/v1/write_protocols/line_protocol_reference.md | Removes prompts from multiple INSERT examples. |
| content/influxdb/v1/troubleshooting/frequently-asked-questions.md | Removes prompts from query-only examples. |
| content/influxdb/v1/troubleshooting/errors.md | Removes prompts from query-only examples. |
| content/influxdb/v1/tools/influx-cli/use-influx-cli.md | Removes prompt from INSERT example. |
| content/influxdb/v1/query_language/spec.md | Removes prompt from EXPLAIN ANALYZE example. |
| content/influxdb/v1/query_language/sample-data.md | Removes prompts from command-only snippet (CREATE DATABASE, exit). |
| content/influxdb/v1/query_language/manage-database.md | Removes prompts from command-only administration examples. |
| content/influxdb/v1/query_language/explore-data.md | Removes prompts from command-only query examples. |
| content/influxdb/v1/query_language/continuous_queries.md | Removes prompt from DROP CONTINUOUS QUERY example. |
| content/influxdb/v1/introduction/get-started/_index.md | Removes prompts from initial CLI command-only examples. |
| content/influxdb/v1/guides/downsample_and_retain.md | Removes prompts from CREATE DATABASE / retention policy examples. |
| content/influxdb/v1/flux/get-started/syntax-basics.md | Removes prompts from Flux REPL blocks that are “input-only” (no output). |
| content/influxdb/v1/administration/authentication_and_authorization.md | Removes prompts from command-only InfluxQL CLI examples. |
| content/enterprise_influxdb/v1/write_protocols/line_protocol_tutorial.md | Removes prompts from command-only INSERT examples. |
| content/enterprise_influxdb/v1/write_protocols/line_protocol_reference.md | Removes prompts from multiple INSERT examples. |
| content/enterprise_influxdb/v1/troubleshooting/frequently-asked-questions.md | Removes prompts from query-only examples. |
| content/enterprise_influxdb/v1/troubleshooting/errors.md | Removes prompts from query-only examples. |
| content/enterprise_influxdb/v1/tools/influx-cli/use-influx-cli.md | Removes prompt from INSERT example. |
| content/enterprise_influxdb/v1/query_language/spec.md | Removes prompt from EXPLAIN ANALYZE example. |
| content/enterprise_influxdb/v1/query_language/sample-data.md | Removes prompts from command-only snippet (CREATE DATABASE, exit). |
| content/enterprise_influxdb/v1/query_language/manage-database.md | Removes prompts from command-only administration examples. |
| content/enterprise_influxdb/v1/query_language/explore-data.md | Removes prompts from command-only query examples. |
| content/enterprise_influxdb/v1/query_language/continuous_queries.md | Removes prompt from DROP CONTINUOUS QUERY example. |
| content/enterprise_influxdb/v1/guides/downsample_and_retain.md | Removes prompts from CREATE DATABASE / retention policy examples. |
| content/enterprise_influxdb/v1/flux/get-started/syntax-basics.md | Removes prompts from Flux REPL blocks that are “input-only” (no output). |
| content/enterprise_influxdb/v1/administration/manage/users-and-permissions/authorization-influxql.md | Removes prompts from command-only InfluxQL authorization examples. |
| content/enterprise_influxdb/v1/administration/manage/clusters/rebalance.md | Removes prompt from ALTER RETENTION POLICY command-only snippet. |
You can also share your feedback on Copilot code review. Take the survey.
content/enterprise_influxdb/v1/query_language/continuous_queries.md
Outdated
Show resolved
Hide resolved
|
|
||
| ```shell | ||
| > db.grantRolesToUser("user", [{role: "read", actions: "find", db: "local"}]) | ||
| db.grantRolesToUser("user", [{role: "read", actions: "find", db: "local"}]) |
There was a problem hiding this comment.
I don't have access to a tool that can create GitHub issues. Here are the details for the issue:
Title: Fix invalid db.grantRolesToUser example in MongoDB input plugin docs
File: content/telegraf/v1/input-plugins/mongodb/_index.md (line 117)
Problem: The current example uses an invalid role spec:
db.grantRolesToUser("user", [{role: "read", actions: "find", db: "local"}])grantRolesToUser expects role objects in the form { role: "<roleName>", db: "<dbName>" } — the actions field is not valid in this context. If the intent is to grant specific action privileges (like find), the correct MongoDB command is db.grantPrivilegesToRole with a privileges array, not grantRolesToUser.
Suggested fix: Replace with a valid invocation, for example:
db.grantRolesToUser("user", [{role: "read", db: "local"}])There was a problem hiding this comment.
@claude Fix #6948 (comment). We need to test it to validate.
content/enterprise_influxdb/v1/query_language/continuous_queries.md
Outdated
Show resolved
Hide resolved
content/enterprise_influxdb/v1/query_language/manage-database.md
Outdated
Show resolved
Hide resolved
content/enterprise_influxdb/v1/query_language/manage-database.md
Outdated
Show resolved
Hide resolved
content/enterprise_influxdb/v1/query_language/manage-database.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| > DROP SHARD 1 | ||
| > | ||
| DROP SHARD 1 | ||
|
|
There was a problem hiding this comment.
@claude Remove unnecessary trailing empty lines from example code in this PR. For example, line 244 in content/influxdb/v1/query_language/manage-database.md
|
|
||
| ```sql | ||
| > explain analyze select mean(usage_steal) from cpu where time >= '2018-02-22T00:00:00Z' and time < '2018-02-22T12:00:00Z' | ||
| explain analyze select mean(usage_steal) from cpu where time >= '2018-02-22T00:00:00Z' and time < '2018-02-22T12:00:00Z' |
There was a problem hiding this comment.
@claude In example code blocks in this PR, move query clauses to new lines for better readability
|
Code blocks showing only commands (no output) had
>CLI prompt prefixes, making them non-copyable. This strips>from command-only blocks while preserving it in blocks that show interactive console sessions (command + result).Rules applied
>: code blocks where every non-empty line starts with>— these are standalone commands meant to be run>: code blocks with mixed>and non->lines — these show a prompt + output sessionPreserved as-is
textblocks with Telegraf metric output (> measurement,tags fields timestamp) —>is Telegraf's output indicator, not a promptdiffblocks —</>are diff markersExample
Before:
After:
Unchanged (command + output — keep
>):Scope
34 files across InfluxDB v1, Enterprise InfluxDB v1, shared InfluxQL/v3 reference, and Telegraf docs. Covers InfluxQL management and query commands, Flux REPL examples, and MongoDB shell commands.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh gh issue list --limit 20(http block)If you need me to access, download, or install something from one of these locations, you can either:
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.