fix(cli): verify each system dependency install step before the next - #568
Closed
ihubanov wants to merge 5 commits into
Closed
fix(cli): verify each system dependency install step before the next#568ihubanov wants to merge 5 commits into
ihubanov wants to merge 5 commits into
Conversation
Owner
|
感谢推动安装器 fail-fast。merged #577 已在默认只读安装基础上统一检查核心依赖、可选渠道和 Skill 安装结果,并以非零状态传播失败,且有干净环境和 CI 验证,因此关闭此已取代大范围实现。 |
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.
Summary
/etc/apt/sources.list.d/github-cli.listonly after that keyring exists, and roll it back ifapt-get updatethen failsfinally/etcbrew installexit codes, and route macOS through Homebrew instead of the apt pathImportErrorfallback indoctorruffandmypyin CI, and clear the violations that had accumulatedWhy
The gh CLI branch wrote an apt source whose
signed-by=pointed at a keyring downloaded by an uncheckedcurl. When that download failed — offline, proxy, transient 404 — the machine was left with a source referencing a keyring that does not exist, which breaksapt-get updatesystem-wide and not only for Agent Reach.except Exceptionthen reported it as a cosmetic "gh CLI install failed", so the breakage surfaced long after the installer exited and with no indication of the cause.The same pattern affected Node.js:
bashexits 0 on an empty file, so a failed script download read as "setup succeeded" right up untilapt-getfound no package. That temp file also leaked wheneverbashraised, because theos.unlinkwas not in afinally.Non-root runs previously turned every step into a
PermissionErrorfolded into the same generic message, and non-apt systems (Fedora, Arch) had an/etc/aptsource written for them regardless.macOS had the same unchecked-exit-code problem in the Homebrew branch, and the Node.js branch was not platform-gated at all — a Mac without Node.js ran the NodeSource script and
apt-get, then advisedapt install nodejs npm. Node.js now installs viabrewon Darwin, and the guidance matches the platform.ruffandmypywere declared in[dev]and configured inpyproject.toml, but the workflow only ranpytest, so 20 ruff violations and one mypy error accumulated unnoticed. That error was in_cmd_doctor, whererprintwas bound to Rich'sprintby the import and then reassigned to the builtin.richis a hard dependency anddoctor.pyimportsrich.markupat module scope, so the fallback could never have run — the import is now unconditional rather than guarded.Validation
444 passedon the PR head (428 existing + 16 new)ruff check .— cleanmypy agent_reach— clean, 35 source filesapt-get updaterollback, preservation of a pre-existing keyring, the happy path, non-root refusal, non-apt refusal, and both NodeSource failure modesbrew install, timeout, missing brew, formula pass-through, and that the Darwin path never invokesapt-get,curl,bash, ordpkg_install_system_depsand_cmd_doctortests unchanged and passingagent-reach doctorrun against a real environment renders the report with markup appliedKnown boundaries