feat: actionable error messages for unsupported Git hosts#68
Merged
Conversation
danielmeppiel
commented
Jan 22, 2026
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
Contributor
There was a problem hiding this comment.
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()ingithub_host.pyto generate a detailed message listing supported hosts and platform-specificGITHUB_HOSTconfiguration examples, including showing the currentGITHUB_HOSTwhen it doesn’t match the attempted host. - Updated
DependencyReference.parse()inapm_package.pyto useunsupported_host_error()for unsupported-host failures, ensuring consistent messaging across hostname validation paths. - Extended unit tests in
tests/unit/test_github_host.pyto 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. |
- 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
dea840a to
bce754e
Compare
sergio-sisternes-epam
pushed a commit
that referenced
this pull request
May 19, 2026
…-errors feat: actionable error messages for unsupported Git hosts
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.