Skip to content

feat: actionable error messages for unsupported Git hosts#68

Merged
danielmeppiel merged 1 commit into
mainfrom
improvement/actionable-host-errors
Jan 22, 2026
Merged

feat: actionable error messages for unsupported Git hosts#68
danielmeppiel merged 1 commit into
mainfrom
improvement/actionable-host-errors

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator
  • Add unsupported_host_error() function with clear fix instructions
  • Show supported hosts list (github.com, *.ghe.com, Azure DevOps)
  • Include platform-specific env var examples (Linux/macOS/Windows)
  • Display mismatch when GITHUB_HOST is set but different host is used
  • Add unit tests for new error message function

Copilot AI review requested due to automatic review settings January 22, 2026 15:39
Comment thread tests/unit/test_github_host.py Dismissed
Comment thread tests/unit/test_github_host.py Dismissed
Comment thread tests/unit/test_github_host.py Dismissed
Comment thread tests/unit/test_github_host.py Dismissed
Comment thread tests/unit/test_github_host.py Dismissed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a centralized, actionable error message for unsupported Git hosts and wires it into the dependency parsing logic, so users get clear guidance when they hit host validation failures.

Changes:

  • Added unsupported_host_error() in github_host.py to generate a detailed message listing supported hosts and platform-specific GITHUB_HOST configuration examples, including showing the current GITHUB_HOST when it doesn’t match the attempted host.
  • Updated DependencyReference.parse() in apm_package.py to use unsupported_host_error() for unsupported-host failures, ensuring consistent messaging across hostname validation paths.
  • Extended unit tests in tests/unit/test_github_host.py to cover the new error helper, including content checks (supported host list, env var instructions, and current host mismatch behavior).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/unit/test_github_host.py Adds tests verifying unsupported_host_error() contents and behavior when GITHUB_HOST is set, improving coverage of the new helper.
src/apm_cli/utils/github_host.py Introduces unsupported_host_error() and its user-facing message, enumerating supported hosts and including platform-specific GITHUB_HOST setup instructions.
src/apm_cli/models/apm_package.py Integrates unsupported_host_error() into DependencyReference.parse() for unsupported-host failures, aligning security checks with clearer, centralized error messaging.

Comment thread src/apm_cli/utils/github_host.py
Comment thread src/apm_cli/models/apm_package.py
- Add unsupported_host_error() function with clear fix instructions
- Show supported hosts list (github.com, *.ghe.com, Azure DevOps)
- Include platform-specific env var examples (Linux/macOS/Windows)
- Display mismatch when GITHUB_HOST is set but different host is used
- Add unit tests for new error message function
@danielmeppiel danielmeppiel force-pushed the improvement/actionable-host-errors branch from dea840a to bce754e Compare January 22, 2026 16:31
Comment thread tests/unit/test_github_host.py Dismissed
Comment thread tests/unit/test_github_host.py Dismissed
Comment thread tests/unit/test_github_host.py Dismissed
Comment thread tests/unit/test_github_host.py Dismissed
Comment thread tests/unit/test_github_host.py Dismissed
Comment thread tests/unit/test_github_host.py Dismissed
@danielmeppiel danielmeppiel merged commit e5768d8 into main Jan 22, 2026
31 of 32 checks passed
@danielmeppiel danielmeppiel deleted the improvement/actionable-host-errors branch February 27, 2026 09:42
sergio-sisternes-epam pushed a commit that referenced this pull request May 19, 2026
…-errors

feat: actionable error messages for unsupported Git hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants