Skip to content

gl doctor exits 0 whether or not checks failed, so the status carries no signal #357

Description

@beardthelion

all_ok is declared at crates/gl/src/doctor.rs:83, written only at :288-290, and read only at
:301-315, where it selects which prose to print. run ends at :319 with an unconditional
Ok(()), there is no early return anywhere in it, and main.rs:171 returns that Result directly.

Both directions, run:

broken   (no identity, missing dir, --node http://127.0.0.1:1)
         4 x ✗ rows, "Some checks failed. Suggested fixes:"        EXIT=0

healthy  (real identity, mock node on 127.0.0.1:7999, all 8 rows ✓)
         "Everything looks good."                                  EXIT=0

Severity, and why it is low

Nothing consumes the exit code today. Grepped install.sh, install.ps1, .github/, npm/,
docs/, and README.md: every hit is a doc line or a post-install suggestion, with no
gl doctor && ..., no CI step, and no call from quickstart or init. Human users are not misled
either, since failures print a per-row , a "Some checks failed" header, and a remedy per check.

So the impact is scripting and CI only, and speculative until someone writes such a script. Filing it
because a diagnostic whose exit status cannot express failure is a trap waiting for the first person
who does.

The fix is not one line

GITLAWB_NODE unset is classed Fail at doctor.rs:160-164, but --node defaults to
https://node.gitlawb.com and the CLI works fine without the variable. That ✗ was observed firing on
an otherwise-healthy run. So the obvious change, returning Err when any check failed, would make
gl doctor exit non-zero on a stock working install.

Whoever picks this up should re-tier that check first (it is advisory, not a failure), then make the
exit status follow the remaining Fail-class checks: identity missing or unparseable (:98-111),
registration missing or malformed (:128-140), node unreachable or non-2xx (:194-207),
git-remote-gitlawb absent (:241-245), git absent (:268-272). The Warn-class checks (iCaptcha
reachability :219-232, shell-alias shadowing :387, version drift :457) should stay non-fatal.

Not related to #197 / PR #198, which are the same file but concern check_version querying the frozen
Gitlawb/releases repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    crate:glgl — the contributor CLIkind:bugDefect fix — wrong or unsafe behaviorsev:lowCosmetic, cleanup, or nice-to-havesubsystem:apiNode REST API request/response surfacesubsystem:identityDID/UCAN, http-sig auth, push authorizationsubsystem:storageBlob/object store, Arweave, IPFS, archives

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions