Skip to content

test(docs): check that every fctl command the docs show parses - #656

Open
fctl-sh[bot] wants to merge 2 commits into
mainfrom
fctl/1676-check-docs-commands
Open

fctl-sh[bot] wants to merge 2 commits into
mainfrom
fctl/1676-check-docs-commands

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

cargo test now parses every fctl command the docs show with the CLI as it is. It reads the shell code blocks of docs/*.md and docs/llms.txt (marked sh, or not marked), the guides' scripts included, and the run: steps of the docs' GitHub workflows. It follows the shell's quoting, line continuations, $(…), pipes and redirections, and finds fctl behind FCTL_SERVER=…, sudo -u fctl, runuser -u fctl -- env …, timeout, its full path, cargo run -p fctl -- and a variable a script sets to run it (the drain script's $fctl). A change that renames a command or a flag, or changes what a value takes, now fails until the docs and guides that show it change too. It finds 755 commands. Four problems turned up, now fixed: fctl admin github and fctl account two-factor only print help on their own (cli.md now shows list and status, as the CLI wants), and diagrams and a log sat in blocks without a language (in architecture.md, self-hosting.md and llms.txt); those are now marked text. Commands written as inline code in the text aren't checked.

This is the decision #614 left open on how the guides stay current: everything CI can check is checked on every pull request (this test, xtask's link checks, and the test that the runner guide shows deploy/cloud's scripts as they are), and docs/development.md#checks says people try the guides for organizations on real accounts each quarter, and before a release that changes what they use. #655 tracks those trials and the microVM section, which need cloud accounts. I checked the test by breaking a flag in the runner guide's enroll and drain scripts, which it then names.

Worth confirming

  • Decision: real-account trials each quarter, and before releases that change enrolling, draining or removing runners, deploy/cloud, webhooks' payloads or a private instance's public paths, rather than for every release, which comes about daily.
  • Decision: the docs follow the CLI where they disagreed. Making fctl admin github list and fctl account two-factor show the status with no subcommand, as fctl admin early-access does, would be a small CLI change of its own.

Refs #614

fctl session


Note

Low risk. It adds a test-only module and edits docs; no shipped code changes.

What it does. Adds a test that reads the shell code blocks in docs/*.md and docs/llms.txt, plus the run: steps of the docs' GitHub workflows, and checks that every fctl command in them parses with the current CLI. It follows sudo, runuser, env, timeout and a $fctl variable set by a script. It also fixes docs the test flagged, marks two diagrams in llms.txt as text, and describes the check in docs/development.md.

fctl review's first look at a2ecb91 · 7 files, +513 −8 · Review agent settings

cargo test now reads the shell code blocks of docs/*.md, the guides'
scripts included, and parses each fctl command in them with the CLI as it
is: a renamed command or flag fails until the docs that show it change.
It found two commands that only print help (`fctl admin github` and
`fctl account two-factor` want `list` and `status`), now fixed, and a
diagram and a log in blocks without a language, now marked text.

development.md says what the docs' checks cover, and that people try the
guides for organizations on real accounts each quarter and before a
release that changes what they use.

Refs #614
@fctl-review

This comment has been minimized.

Comment thread crates/fctl/src/doc_commands.rs Resolved
Comment thread docs/development.md Resolved
The check of the docs' fctl commands now follows a variable a script sets
to run fctl (the runner guide's fctl-drain runs `timeout "$1" $fctl host
uninstall --wait`), `timeout` and the shell's `if`/`then`/`else`, and
reads docs/llms.txt and the `run:` steps of the docs' GitHub workflows.
That adds 15 commands, all of which parse. llms.txt's two diagrams are
marked text, as the docs' others are. development.md says what it follows
and that commands in the text itself aren't checked.

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

0 participants