Repository navigation
fix(install): name GITHUB_HOST in the unrecognised-host hint; cover mixed-host install - #4665
Conversation
Lifecycle scenarios prove each host-qualified package keeps its host, subpath and ref across install, reload, frozen reinstall, update and removal, with per-host credential isolation. The unrecognised-host hint now names GITHUB_HOST for GitHub Enterprise Server. apm-spec-waiver: hint wording only; no normative manifest or lockfile behaviour changes Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The removal scenario leaves the package in the model, and the host-configuration hint can redirect existing shorthand dependencies to another server.
2 open issues
What changed in this PR
This PR improves the unrecognised-host hint for GitHub Enterprise Server and adds regression coverage for the supported mixed-host install workflow.
Changes:
- Names
GITHUB_HOSTand the public-package qualification step in the install hint. - Adds lifecycle coverage for host identity, credential isolation, reinstall, update, uninstall, and recovery guidance.
- Documents mixed-host usage and records the fix in the changelog and bug ledger.
| File | Description |
|---|---|
tests/unit/install/test_validation_error_handling.py |
Checks the new GHES guidance. |
tests/lifecycle/scenarios/test_explicit_host_identity.py |
Exercises mixed-host lifecycle behavior and remedies. |
tests/fixtures/lifecycle_bug_ledger/bugs/2775.json |
Links the issue to regression coverage. |
src/apm_cli/install/validation.py |
Adds GITHUB_HOST to the unrecognised-host hint. |
packages/apm-guide/.apm/skills/apm-usage/authentication.md |
Adds mixed-host usage and configuration guidance. |
docs/src/content/docs/getting-started/authentication.md |
Documents a mixed-host global install example. |
changelog.d/4665.fixed.md |
Records the improved install hint. |
Review effort: Balanced
…hint (#2775) When GITHUB_HOST already names a server, the hint recommends keeping it and adding the second server's package as a git: + path: object entry, since switching GITHUB_HOST re-homes existing shorthand entries. The lifecycle removal step now passes the full spec so the scenario model and the CLI select the same package. apm-spec-waiver: hint wording only; no normative manifest or lockfile behaviour changes Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…-mixed-host-install
There was a problem hiding this comment.
🟡 Changes recommended
The tag- and SHA-pinned test cases do not distinguish pin resolution from fetching main because both pins remain at the branch tip; advance those repositories before installation to make the assertions meaningful.
1 open issue
2 resolved since last review
Review effort: Balanced
…arios (#2775) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…-mixed-host-install
There was a problem hiding this comment.
🟡 Changes recommended
The lifecycle tests can miss cross-host credential leaks because reinstall/update omit the reverse-token assertion and anonymous github.com fixtures bypass credential resolution.
2 open issues
1 resolved since last review
Review effort: Balanced
…t step (#2775) The shared host-isolation helper now also asserts the github.com token never reaches GHES, and the strict-mode scenario resolves github.com credentials first so the carrier check sees strict withholding. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because the non-strict scenario can pass without selecting the configured GitHub token, leaving credential-selection behavior untested.
No open issues 🎉
2 resolved since last review
Review effort: Balanced

Description
Mixed-host
apm install(GHES viaGITHUB_HOSTplus explicitgithub.com/packages) already keeps each package's host, subpath and ref on current main. I reproduced the issue's flow with the packaged CLI in the lifecycle world, where each repository exists on one host only. This PR:GITHUB_APM_PAT, never leave GHES; the github.com token never reaches GHES);GITHUB_HOST), the hint named onlyGITLAB_HOSTand object form. It now also says: "If this is GitHub Enterprise Server, set GITHUB_HOST=, write github.com/ before apm.yml entries for packages on GitHub, and re-run." WhenGITHUB_HOSTalready names a server, it instead says to keep it and add the second server's package as agit:+path:object entry, because switching would re-home existing shorthand. The lifecycle tests run every printed remedy (this one and thegit:+path:object form) to green;Dependency order: none.
Issue and approved scope
Issue: Fixes #2775
Human scope-approval comment: #2775 (comment)
Does this PR complete the issue, or what remains? It completes the record's done-when. Follow-up (out of this record, spec level): a GHES entry is written as shorthand because
GITHUB_HOSTis APM's declared implementation-default host (req-mf-009; CONFORMANCE.md). github.com entries written whileGITHUB_HOSTwas unset are also shorthand. Shorthand therefore changes meaning whenGITHUB_HOSTchanges: a reload withoutGITHUB_HOSTre-homes the GHES entry to github.com (--frozenfails closed with zero egress; plaininstallfails and keeps state), and settingGITHUB_HOSTre-homes earlier github.com shorthand to the server. The new hint names the re-qualify step; fixing the root cause needs a conformance-level decision on the implementation-default host.Type of change
Testing
Validation evidence (local, macOS, binary driver =
.venv/bin/apm0.37.0 editable):APM_E2E_TESTS=1 APM_LIFECYCLE_DRIVER=binary APM_BINARY_PATH=$PWD/.venv/bin/apm pytest tests/lifecycle/scenarios/test_explicit_host_identity.py tests/unit/install/test_validation_error_handling.py tests/quality/test_lifecycle_bug_ledger.py -p no:xdisttest_unconfigured_ghes_host_is_refused_with_working_remediesandTestGenericHostAmbiguousSubpathHint::test_unrecognised_selfhosted_ambiguous_path_returns_hinton mainGITHUB_HOSTclause; other lifecycle tests pass on main (evidence)uvx ruff@0.15.12 check/format --check(CI paths)pylint --enable=R0801 ...bash scripts/lint-auth-signals.shpython scripts/check_complexity_ratchet.py --base-ref origin/mainpython -m tests.quality.taxonomy --changedpython scripts/check_test_assertions.pypython scripts/lint_architecture_boundaries.py --root .python .apm/skills/cut-release/scripts/changelog_fragments.py check+check-unreleased --base-ref origin/mainLifecycle evidence row:
Changelog
changelog.d/<pr>.<section>.md, holdingone line: user-visible effect first, 25 words or fewer, ending with
(#PR); breaking changes only under upgrade notes; no Highlights; nonew lines under
## [Unreleased]. Seechangelog.d/README.mdand.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
CONFORMANCE.{md,json}regenerated