fix(cli): remove generic "refer to our docs" note from cli errors#4136
Open
anxkhn wants to merge 1 commit into
Open
fix(cli): remove generic "refer to our docs" note from cli errors#4136anxkhn wants to merge 1 commit into
anxkhn wants to merge 1 commit into
Conversation
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.
Description
The CLI's two generic error handlers always appended:
regardless of the actual error, so every failure (e.g. "workspace already exists", invalid args) pointed at the same intro page. As #4126 notes, that is not specific to what the user is facing and clutters the output.
This removes the generic intro-page footer but keeps a docs link when the command or exception provides a specific one:
main()parser-ValueErrorpath: footer removed (no command context there); the error line is unchanged.main()catch-all command-error path: drop theDEFAULT_DOCS_URLintro fallback and only emit the note when a command/exception supplies its owndocs_url(e.g.dlt telemetry-> the telemetry docs). The real error line (red) is always kept.DEFAULT_DOCS_URLconstant (no other references).Out of scope: the deploy command's note (
_deploy_command.py:483) is left intact - it points at deploy-specific docs after concretegit initremediation, so it is contextual and useful rather than the generic intro link. Happy to drop it too if you read "all CLI commands" literally.Related Issues
NOTE: Please refer to our docs#4126Additional Context
Tested with
tests/workspace/cli/common/test_cli_invoke.py: addedtest_command_error_omits_generic_docs_note(failing command with no docs link -> error shown, no footer) andtest_command_error_keeps_specific_docs_note(command with its owndocs_url-> contextual link still shown). Rantests/workspace/cli+tests/plugins(507 passed) andmake lint(ruff / flake8 / black / mypy) clean.