plugin: avoid allowBuilds hint for unrelated Git fetch failures #4702
Replies: 3 comments
|
Confirmed your root cause line-for-line against 1. The profile-directory line is already unconditional, so the ask is narrower than you wrote. process.stderr.write(`${NAME}: pnpm failed in profile directory ${dir}\n`)
if (args.some(argument => /^git\+|^github:|\.git(?:#|$)/.test(argument))) {
// ... the prepare/allowBuilds hint ...
}Your first expected-behavior bullet ("Always report the profile directory on pnpm failure") is already satisfied — that write is outside the That leaves exactly one defect, which makes the fix purely subtractive: the hint's gate is a regex over argv and reads neither the exit code nor pnpm's 2. The same gate fails in the other direction, and that half isn't in your report. Because the predicate is git-shape-only, a plain npm spec that fails for precisely the reason the hint describes gets no hint at all. So keying the hint off the Interest disclosure: we publish a plugin that users install through this exact code path, so |
|
Thanks @weijiafu14 — confirmed both refinements line-for-line. I narrowed the change to the actual classifier defect and covered the inverse npm-spec failure mode you identified. The tested patch is ready here:
It:
Validation passed: built CLI E2E 19/19, lint, doc-sync 28/28, pre-push typecheck, and diff check. I attempted to open the upstream PR, but this repository currently reports “New Pull request creation is restricted” and both GitHub GraphQL and REST reject external PR creation. The branch is ready for a maintainer to pull/cherry-pick, or I can open the PR immediately if external PR creation is enabled. Thank you for the precise review — it made the fix smaller and correct in both directions. |
|
Independent confirmation of the inverse direction @weijiafu14 described: on DSH 0.1.1-rc.2 (macOS, pnpm 11), |
Uh oh!
There was an error while loading. Please reload this page.
Summary
dsh plugin prints an allowBuilds/prepare hint after any failed Git install, including failures that happen before the repository is fetched.
Reproduction
Environment reported by a real user:
pnpm reports ERR_PNPM_GIT_FETCH_FAILED and Failed to connect to github.com port 443: Timed out.
DSH then says that Git-hosted plugins build through prepare and asks the user to edit allowBuilds. No checkout or plugin prepare step was reached, so changing allowBuilds cannot resolve this failure.
Root cause
apps/cli/src/plugin.ts currently emits prepare/allowBuilds guidance whenever the argument looks like a Git spec and pnpm exits non-zero. The diagnostic is selected from the command shape rather than the actual failure category.
Expected behavior
Original downstream report: adoresever/graph-memory#87
All reactions