ref:main

"not logged in" is reported when repo resolution fails #33

open Opened by cole.christensen@gmail.com

Links

No links yet.

resolve_repo (src/config.rs:76-94) falls through to Err(ConfigError::NotLoggedIn) when it cannot determine a repo, which renders as (config.rs:7):

Error: not logged in — run `anvil auth login` first

The user often is logged in. The real failure is “I could not work out which repo you mean.” The suggested remedy will not fix it, and the message never mentions either thing that would: passing --repo org/repo (or the positional [REPO]), or running anvil repo set-default.

Reproduce with a valid config, from any non-git directory:

$ anvil issue list
Error: not logged in — run `anvil auth login` first
$ anvil auth status
Server https://anvil.fangorn.io
Token anvil_m8…

Every repo-scoped subcommand (~120 of them) reaches this path, and the CLI output gives no way out of the loop.

Related

config.rs:96-105 wraps a validation failure in the I/O error variant, so a bad repo string surfaces as:

Error: config I/O error: invalid repo format 'closed' — expected 'org/repo'

Nothing was read or written; “config I/O error” is simply false. Same pattern at config.rs:114-119 and :141-156.

Suggested fix

Give repo resolution its own error variant naming the two remedies, and stop routing validation failures through ConfigError::Io.

Found during a CLI-wide consistency audit.