Repository navigation
Validate example commands that use --cli-input-* options - #10824
Merged
Merged
Conversation
The example command check skipped any command that used --cli-input-json, --cli-input-yaml or --generate-cli-skeleton, because the test parser reported their required arguments as missing. Apply the same rule the CLI applies instead, by emitting before-building-argument-table-parser so its handlers make the other arguments optional, and restore the argument table afterwards. The service and operation names of these commands are now checked like those of any other example. Stop parsing at shell redirects and pipes, so commands such as "--generate-cli-skeleton > skeleton.json" are not read as passing ">" to the CLI.
GarrettBeatty
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
Validate example commands that use --cli-input-* options
verify_cli_commands_validskipped every example command that used--cli-input-json,--cli-input-yamlor--generate-cli-skeleton(marked as a TODO), because the test parser reported their required arguments as missing. These commands are now validated like any other example.CommandValidator.validate_cli_commandintests/functional/docs/test_examples.py_cli_required_args, which applies the CLI's own rule for required arguments: it emitsbefore-building-argument-table-parser.<service>.<operation>so the CLI's handlers make the other arguments optional when--cli-input-*or--generate-cli-skeletonis used, and restores the argument table afterwards for the other examples of the same operation--generate-cli-skeleton > skeleton.jsondon't pass>to the CLITesting
pytest tests/functional/docs/test_examples.py -n autoBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.