Skip to content

Conversation

cidrblock
Copy link
Contributor

Problem

When users encounter validation errors with molecule login, the error messages provide specific information about what went wrong but don't direct users to documentation that explains proper usage patterns and available options.

Solution

Add references to the official documentation in error messages to improve discoverability of usage information and help users understand how to properly use the login command.

Changes

Updated three common error scenarios in molecule login to include documentation links:

  • Multiple hosts without --host flag: When multiple instances are running and user doesn't specify which host to login to
  • Host not found: When the specified hostname doesn't match any available hosts
  • Ambiguous host pattern: When the hostname pattern matches multiple hosts and requires disambiguation

Each error message now includes:

For more information: https://ansible.readthedocs.io/projects/molecule/usage/#molecule-login

Behavior

Before:

$ molecule login --host invalid
CRITICAL There are no hosts that match 'invalid'. You can only login to valid hosts.

After:

$ molecule login --host invalid  
CRITICAL There are no hosts that match 'invalid'. You can only login to valid hosts.

For more information: https://ansible.readthedocs.io/projects/molecule/usage/#molecule-login

This provides users with a direct path to comprehensive documentation explaining login usage, available options, and examples.

@cidrblock cidrblock requested a review from a team as a code owner August 18, 2025 14:54
@cidrblock cidrblock marked this pull request as draft August 18, 2025 16:07
@cidrblock cidrblock changed the title Add documentation links to molecule login error messages Add documentation links to molecule login error message Aug 19, 2025
cidrblock and others added 3 commits August 19, 2025 10:28
Include reference to official documentation when users encounter common
login validation errors to improve discoverability of usage information.

Changes:
- Add documentation URL to error when no --host specified with multiple hosts
- Add documentation URL to error when specified host doesn't match any hosts
- Add documentation URL to error when host pattern matches multiple hosts
- Update dictionary and usage documentation

The documentation link points to the molecule login section which explains
proper usage patterns and available options.
Include reference to official documentation when users encounter common
login validation errors to improve discoverability of usage information.

Changes:
- Add documentation URL to error when no --host specified with multiple hosts
- Add documentation URL to error when specified host doesn't match any hosts
- Add documentation URL to error when host pattern matches multiple hosts
- Update dictionary and usage documentation

The documentation link points to the molecule login section which explains
proper usage patterns and available options.
@Qalthos Qalthos enabled auto-merge (squash) August 20, 2025 15:53
@cidrblock cidrblock disabled auto-merge August 20, 2025 16:18
@cidrblock cidrblock merged commit 0367817 into main Aug 20, 2025
22 of 24 checks passed
@cidrblock cidrblock deleted the doc_login branch August 20, 2025 16:18
@cidrblock
Copy link
Contributor Author

(coverage upload failure)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants